changeset 171:42f843b391aa

Merge from eCos master repository on 2001-07-18-03:13:25-BST
author jlarmour
date Wed, 18 Jul 2001 11:38:39 +0000
parents f664e0b5f88b
children cd45958b28ff
files host/ChangeLog host/libcdl/ChangeLog host/libcdl/infer.cxx host/libcdl/interp.cxx host/libcdl/transact.cxx host/tools/configtool/ChangeLog host/tools/configtool/common/common/build.cxx host/tools/configtool/common/common/flags.cxx host/tools/configtool/common/win32/FailingRulesDialog.cpp host/tools/configtool/standalone/wxwin/CHANGES.txt host/tools/configtool/standalone/wxwin/configtool.cpp host/tools/configtool/standalone/wxwin/configtool.h host/tools/configtool/standalone/wxwin/configtoolview.cpp host/tools/configtool/standalone/wxwin/conflictsdlg.cpp host/tools/configtool/standalone/wxwin/filename.cpp host/tools/configtool/standalone/wxwin/mainwin.cpp host/tools/configtool/standalone/wxwin/mainwin.h host/tools/configtool/standalone/wxwin/symbols.h host/tools/configtool/standalone/wxwin/templatesdlg.cpp packages/ChangeLog packages/NEWS packages/devs/eth/smsc/lan91cxx/current/ChangeLog packages/devs/eth/smsc/lan91cxx/current/src/if_lan91cxx.c packages/devs/flash/arm/ebsa285/current/ChangeLog packages/devs/flash/arm/ebsa285/current/src/ebsa285_flash.c packages/devs/flash/arm/ebsa285/current/src/flash.h packages/devs/flash/intel/strata/current/ChangeLog packages/devs/flash/intel/strata/current/src/flash_program_buf.c packages/devs/flash/intel/strata/current/src/flash_query.c packages/devs/pcmcia/arm/assabet/current/ChangeLog packages/devs/pcmcia/arm/assabet/current/src/assabet_pcmcia.c packages/devs/pcmcia/arm/ipaq/current/ChangeLog packages/devs/pcmcia/arm/ipaq/current/src/ipaq_pcmcia.c packages/devs/wallclock/dallas/ds12887/current/ChangeLog packages/devs/wallclock/dallas/ds12887/current/cdl/wallclock_ds12887.cdl packages/devs/wallclock/dallas/ds12887/current/src/ds12887.cxx packages/devs/wallclock/sh/sh3/current/ChangeLog packages/devs/wallclock/sh/sh3/current/cdl/wallclock_sh3.cdl packages/devs/wallclock/sh/sh3/current/src/wallclock_sh3.cxx packages/devs/wallclock/sh3/current/ChangeLog packages/devs/wallclock/sh3/current/cdl/wallclock_sh3.cdl packages/devs/wallclock/sh3/current/src/wallclock_sh3.cxx packages/ecos.db packages/fs/rom/current/ChangeLog packages/fs/rom/current/support/mk_romfs.c packages/hal/arm/arch/current/ChangeLog packages/hal/arm/arch/current/include/hal_intr.h packages/hal/arm/arch/current/src/hal_misc.c packages/hal/i386/arch/current/ChangeLog packages/hal/i386/arch/current/cdl/hal_i386.cdl packages/hal/i386/arch/current/include/arch.inc packages/hal/i386/generic/current/cdl/hal_i386_generic.cdl packages/hal/i386/pc/current/ChangeLog packages/hal/i386/pc/current/cdl/hal_i386_pc.cdl packages/hal/mips/arch/current/ChangeLog packages/hal/mips/arch/current/cdl/hal_mips.cdl packages/hal/mips/arch/current/src/redboot_linux_exec.c packages/hal/sh/arch/current/ChangeLog packages/hal/sh/arch/current/src/sh_stub.c packages/hal/sh/cq7750/current/ChangeLog packages/hal/sh/cq7750/current/cdl/hal_sh_sh7750_cq7750.cdl packages/hal/sh/cq7750/current/include/platform.inc packages/hal/sh/sh4/current/ChangeLog packages/hal/sh/sh4/current/cdl/hal_sh_sh4.cdl packages/hal/sh/sh4/current/include/mod_7750.h packages/hal/sh/sh4/current/include/mod_regs_bsc.h packages/hal/sh/sh4/current/include/mod_regs_intc.h packages/hal/sh/sh4/current/include/mod_regs_ubc.h packages/hal/sh/sh4/current/include/variant.inc packages/hal/sh/sh4/current/src/var_misc.c packages/hal/sh/sh4/current/src/variant.S packages/infra/current/ChangeLog packages/infra/current/cdl/debug.cdl packages/infra/current/src/diag.cxx packages/io/usb/eth/slave/current/ChangeLog packages/io/usb/eth/slave/current/cdl/usbs_eth.cdl packages/io/usb/eth/slave/current/doc/io-usb-slave-eth.html packages/io/usb/eth/slave/current/doc/usbseth-control.html packages/io/usb/eth/slave/current/doc/usbseth-data.html packages/io/usb/eth/slave/current/doc/usbseth-host.html packages/io/usb/eth/slave/current/doc/usbseth-init.html packages/io/usb/eth/slave/current/doc/usbseth-intro.html packages/io/usb/eth/slave/current/doc/usbseth-netdev.html packages/io/usb/eth/slave/current/doc/usbseth-protocol.html packages/io/usb/eth/slave/current/doc/usbseth.sgml packages/kernel/current/ChangeLog packages/kernel/current/include/sched.inl packages/kernel/current/src/sched/sched.cxx packages/language/c/libc/stdio/current/ChangeLog packages/language/c/libc/stdio/current/include/stream.hxx packages/language/c/libc/stdio/current/src/common/fflush.cxx packages/pkgconf/fixhtml.tcl packages/pkgconf/rules.mak packages/redboot/current/ChangeLog packages/redboot/current/cdl/redboot.cdl packages/redboot/current/src/flash.c packages/redboot/current/src/load.c packages/redboot/current/src/main.c packages/services/memalloc/common/current/ChangeLog packages/services/memalloc/common/current/src/dlmalloc.cxx packages/services/memalloc/common/current/tests/malloc1.c
diffstat 101 files changed, 3521 insertions(+), 2189 deletions(-) [+]
line wrap: on
line diff
--- a/host/ChangeLog
+++ b/host/ChangeLog
@@ -1,3 +1,9 @@
+2001-07-09  Julian Smart <julians@redhat.com>
+
+    * Fixed (I hope) a long-term bug in both versions of the Configtool,
+    whereby conflicts involving bool-data values weren't
+    resolved.
+
 2001-06-18  Julian Smart <julians@redhat.com>
 
     * Added possible fix for Tcl crash bug under Windows 9x, by
--- a/host/libcdl/ChangeLog
+++ b/host/libcdl/ChangeLog
@@ -1,3 +1,22 @@
+2001-07-11  Bart Veer  <bartv@redhat.com>
+
+	* transact.cxx (is_preferable_to):
+	Consider active changes as well as value changes.
+
+2001-07-10  Bart Veer  <bartv@redhat.com>
+
+	* transact.cxx (is_preferable_to): 
+	Fine-tune the determination of which of two transactions has less
+	impact on the system.
+	
+	* infer.cxx (infer_handle_interface_value):
+	Add inference engine support for constraints of the form
+	(xxx == 0) and (xxx = 1), where xxx is an interface.
+	
+2001-07-08  Jonathan Larmour  <jlarmour@redhat.com>
+
+	* interp.cxx: include <cctype> as isspace() is used.
+
 2001-06-21  Bart Veer  <bartv@redhat.com>
 
 	<merge of development work>
--- a/host/libcdl/infer.cxx
+++ b/host/libcdl/infer.cxx
@@ -89,13 +89,18 @@
 //    switch statement and calls into various auxiliary functions when
 //    necessary.
 //
-// Forward declarations are needed to allow for active_if properties and
-// the like.
-//
 // For convenience the various entry points check whether or not the
 // desired condition is already satisfied.
 
 //}}}
+//{{{  Forward declarations                     
+
+// ----------------------------------------------------------------------------
+
+static bool infer_handle_interface_value(CdlTransaction, CdlInterface, CdlSimpleValue&, int);
+static bool infer_handle_reference_bool(CdlTransaction, CdlValuable, bool, int);
+
+//}}}
 //{{{  CdlInfer::make_active()                  
 
 // ----------------------------------------------------------------------------
@@ -297,6 +302,9 @@ CdlInfer::set_valuable_value(CdlTransact
                   }
                   valuable->set_source(transaction, CdlValueSource_Inferred);
                   result = transaction->resolve_recursion(level);
+              } else if (0 != dynamic_cast<CdlInterface>(valuable)) {
+                  // Interfaces are not directly modifiable, but their implementors are.
+                  result = infer_handle_interface_value(transaction, dynamic_cast<CdlInterface>(valuable), goal, level);
               }
           }
           break;
@@ -314,6 +322,9 @@ CdlInfer::set_valuable_value(CdlTransact
                 valuable->set_value(transaction, goal, CdlValueSource_Inferred);
                 valuable->set_source(transaction, CdlValueSource_Inferred);
                 result = transaction->resolve_recursion(level);
+            } else if (0 != dynamic_cast<CdlInterface>(valuable)) {
+                // Interfaces are not directly modifiable, but their implementors are.
+                result = infer_handle_interface_value(transaction, dynamic_cast<CdlInterface>(valuable), goal, level);
             }
         }
         break;
@@ -413,47 +424,62 @@ CdlInfer::set_valuable_bool(CdlTransacti
 // preferred one. This happens for many binary operators.
 
 static bool
-infer_choose2(CdlTransaction lhs_transaction, bool lhs_result, CdlTransaction rhs_transaction, bool rhs_result)
+infer_lhs_preferable(CdlTransaction lhs_transaction, bool lhs_result, CdlTransaction rhs_transaction, bool rhs_result)
 {
     CYG_REPORT_FUNCNAMETYPE("infer_choose2", "result %d");
     CYG_REPORT_FUNCARG4XV(lhs_transaction, lhs_result, rhs_transaction, rhs_result);
-    bool result = false;
+    CYG_PRECONDITIONC(lhs_result || rhs_result);
+    
+    bool result = true;
     
     if (lhs_result && !rhs_result) {
         // Only the lhs succeeded.
-        rhs_transaction->cancel();
-        lhs_transaction->commit();
         result = true;
     } else if (!lhs_result && rhs_result) {
         // Only the rhs succeeded.
-        lhs_transaction->cancel();
-        rhs_transaction->commit();
-        result = true;
+        result = false;
     } else if (lhs_result && rhs_result) {
         // Both sides succeeded. Next check for user_confirmation.
         bool lhs_confirm_needed = lhs_transaction->user_confirmation_required();
         bool rhs_confirm_needed = rhs_transaction->user_confirmation_required();
         if (lhs_confirm_needed && !rhs_confirm_needed) {
-            lhs_transaction->cancel();
-            rhs_transaction->commit();
-            result = true;
+            result = false;
         } else if (!lhs_confirm_needed && rhs_confirm_needed) {
-            rhs_transaction->cancel();
-            lhs_transaction->commit();
             result = true;
         } else {
             // Neither or both of the two sides need user confirmation, so they
             // are equal in that respect
             if (lhs_transaction->is_preferable_to(rhs_transaction)) {
-                rhs_transaction->cancel();
-                lhs_transaction->commit();
                 result = true;
             } else {
-                lhs_transaction->cancel();
-                rhs_transaction->commit();
-                result = true;
+                result = false;
             }
         }
+    }
+
+    CYG_REPORT_RETVAL(result);
+    return result;
+}
+
+// A variant which will actually do the commits and cancels. This is
+// commonly required when doing inferences of binary operators.
+static bool
+infer_choose2(CdlTransaction lhs_transaction, bool lhs_result, CdlTransaction rhs_transaction, bool rhs_result)
+{
+    CYG_REPORT_FUNCNAMETYPE("infer_choose2", "result %d");
+    CYG_REPORT_FUNCARG4XV(lhs_transaction, lhs_result, rhs_transaction, rhs_result);
+    bool result = false;
+
+    if (lhs_result || rhs_result) {
+        bool lhs_preferable = infer_lhs_preferable(lhs_transaction, lhs_result, rhs_transaction, rhs_result);
+        if (lhs_preferable) {
+            rhs_transaction->cancel();
+            lhs_transaction->commit();
+        } else {
+            lhs_transaction->cancel();
+            rhs_transaction->commit();
+        }
+        result = true;
     } else {
         // Neither side succeeded.
         lhs_transaction->cancel();
@@ -470,6 +496,139 @@ infer_choose2(CdlTransaction lhs_transac
 }
 
 //}}}
+//{{{  infer_handle_interface()                 
+
+// ----------------------------------------------------------------------------
+// Set an interface to a specific value, which should be some number n.
+// If (n == 0) then all implementers must be disabled or made inactive.
+// If (n == 1) then exactly one of the implementers must be active and enabled.
+// Other combinations are not considered here, they could lead to an
+// exponential explosion.
+
+static bool
+infer_handle_interface_value(CdlTransaction transaction, CdlInterface interface, CdlSimpleValue& goal, int level)
+{
+    CYG_REPORT_FUNCNAMETYPE("infer_handle_reference_bool", "result %d");
+    CYG_REPORT_FUNCARG4XV(transaction, interface, &goal, level);
+    bool result = false;
+
+    if (goal.has_integer_value()) {
+        cdl_int real_goal = goal.get_integer_value();
+        if (real_goal == interface->get_integer_value(transaction)) {
+            result = true;
+        } else if (0 == real_goal) {
+            // All implementers must be disabled or made inactive. This
+            // can be achieved by creating a sub-transaction and calling
+            // infer_handle_reference_bool() on all of the implementers.
+            //
+            // However there are no guarantees that the result is what
+            // is intended. Updating a later implementer may as a side
+            // effect cause an earlier one to become active again. Also
+            // there may be confusion with valuables with the data
+            // flavor being given a value of 0. Hence a final check is
+            // needed that the new interface value really is the desired goal.
+            CdlTransaction sub_transaction;
+            std::vector<CdlValuable> implementers;
+            std::vector<CdlValuable>::const_iterator impl_i;
+
+            sub_transaction = transaction->make(transaction->get_conflict());
+            try {
+                interface->get_implementers(implementers);
+                for (impl_i = implementers.begin(); impl_i != implementers.end(); impl_i++) {
+                    (void) infer_handle_reference_bool(sub_transaction, *impl_i, false, level);
+                }
+                if (0 == interface->get_integer_value(sub_transaction)) {
+                    sub_transaction->commit();
+                    result = true;
+                } else {
+                    sub_transaction->cancel();
+                }
+            } catch (...) {
+                delete sub_transaction;
+                throw;
+            }
+            delete sub_transaction;
+            sub_transaction = 0;
+            
+        } else if (1 == real_goal) {
+            // This is a bit trickier than the above. We need n
+            // sub-transactions, one per implementer. In each
+            // sub-transaction we try to set exactly one of the
+            // implementers to enabled and the rest to disabled.
+            std::vector<CdlValuable>    implementers;
+            unsigned int                impl_count;
+            unsigned int                i, j;
+            
+            interface->get_implementers(implementers);
+            impl_count = implementers.size();
+            std::vector<CdlTransaction> sub_transactions;
+            std::vector<bool>           results;
+
+            try {
+                for (i = 0; i < impl_count; i++) {
+                    CdlTransaction sub_transaction = transaction->make(transaction->get_conflict());
+                    sub_transactions.push_back(sub_transaction);
+                    results.push_back(false);
+                    results[i]          = false;
+                }
+                for (i = 0; i < impl_count; i++) {
+                    for (j = 0; j < impl_count; j++) {
+                        (void) infer_handle_reference_bool(sub_transactions[i], implementers[j], (i == j), level);
+                    }
+                    if (1 == interface->get_integer_value(sub_transactions[i])) {
+                        results[i] = true;
+                    }
+                }
+                
+                // At this point we may have some combination of successful and unsucessful
+                // sub-transactions, and it is time to choose the best one.
+                CdlTransaction  preferred = 0;
+                for (i = 0; i < impl_count; i++) {
+                    if (results[i]) {
+                        preferred = sub_transactions[i];
+                        break;
+                    }
+                }
+
+                for (j = i + 1; j < impl_count; j++) {
+                    if (results[j]) {
+                        if (!infer_lhs_preferable(preferred, true, sub_transactions[j], true)) {
+                            preferred = sub_transactions[j];
+                        }
+                    }
+                }
+
+                // Now either preferred == 0, i.e. all
+                // sub-transactions failed and we want to cancel them
+                // all. Or we have a viable sub-transaction.
+                for (i = 0; i < impl_count; i++) {
+                    if (preferred == sub_transactions[i]) {
+                        sub_transactions[i]->commit();
+                        result = true;
+                    } else {
+                        sub_transactions[i]->cancel();
+                    }
+                    delete sub_transactions[i];
+                    sub_transactions[i] = 0;
+                }
+                
+            } catch(...) {
+                for (i = 0; i < sub_transactions.size(); i++) {
+                    if (0 != sub_transactions[i]) {
+                        sub_transactions[i]->cancel();
+                        delete sub_transactions[i];
+                        sub_transactions[i] = 0;
+                    }
+                }
+            }
+        }
+    }
+    
+    CYG_REPORT_RETVAL(result);
+    return result;
+}
+
+//}}}
 //{{{  infer_handle_reference()                 
 
 // ----------------------------------------------------------------------------
--- a/host/libcdl/interp.cxx
+++ b/host/libcdl/interp.cxx
@@ -59,6 +59,9 @@
 // in <tcl.h>
 #include <cdlcore.hxx>
 
+// quote() needs access to isspace()
+#include <cctype>
+
 //}}}
 
 //{{{  Statics                                                  
--- a/host/libcdl/transact.cxx
+++ b/host/libcdl/transact.cxx
@@ -10,7 +10,7 @@
 //####COPYRIGHTBEGIN####
 //                                                                          
 // ----------------------------------------------------------------------------
-// Copyright (C) 1999, 2000 Red Hat, Inc.
+// Copyright (C) 1999, 2000, 2001 Red Hat, Inc.
 //
 // This file is part of the eCos host tools.
 //
@@ -2373,7 +2373,10 @@ CdlTransactionBody::is_preferable_to(Cdl
     CYG_PRECONDITIONC(this != other);
 
     bool result = false;
-    if (this->changes.size() < other->changes.size()) {
+    unsigned int this_changes  = this->changes.size()  + this->activated.size()  + this->deactivated.size();
+    unsigned int other_changes = other->changes.size() + other->activated.size() + other->deactivated.size();
+        
+    if (this_changes <= other_changes) {
         result = true;
     }
     
--- a/host/tools/configtool/ChangeLog
+++ b/host/tools/configtool/ChangeLog
@@ -1,3 +1,7 @@
+2001-07-08  Jonathan Larmour  <jlarmour@redhat.com>
+
+	* common/common/flags.cxx: Include <cctype> for isspace()
+
 2001-02-14  Julian Smart  <julians@redhat.com>
 
     * standalone/win32/configtool.cpp
--- a/host/tools/configtool/common/common/build.cxx
+++ b/host/tools/configtool/common/common/build.cxx
@@ -56,6 +56,12 @@
 #include "flags.hxx"
 #include "build.hxx"
 
+// Two methods of generating Cygwin filenames
+// CYGWIN_USE_CYGDRIVE = 0: use e.g. //c/, but this is deprecated in new versions of Cygwin
+// CYGWIN_USE_CYGDRIVE = 1: use e.g. /cygdrive/c/
+// CYGWIN_USE_CYGDRIVE = 2: use e.g. c:/ notation
+#define CYGWIN_USE_CYGDRIVE 1
+
 std::string makefile_header = "# eCos makefile\n\n# This is a generated file - do not edit\n\n";
 
 bool eval_tcl_command (const std::string command) {
@@ -129,11 +135,6 @@ std::string nospace_path (const std::str
 }
 #endif
 
-// Two methods of generating Cygwin filenames
-// CYGWIN_USE_CYGDRIVE = 1: use e.g. /cygdrive/c/, but this can have problems with mkdir -p
-// CYGWIN_USE_CYGDRIVE = 0: use e.g. //c/, but this is deprecated in new versions of Cygwin
-#define CYGWIN_USE_CYGDRIVE 0
-
 // convert a DOS filepath to a Cygwin filepath
 std::string cygpath (const std::string input) {
 #ifdef _WIN32
@@ -148,7 +149,7 @@ std::string cygpath (const std::string i
 	output = buffer;
 #else
 
-#if CYGWIN_USE_CYGDRIVE
+#if CYGWIN_USE_CYGDRIVE == 1
     std::string strCygdrive("/cygdrive");
 
     HKEY hKey = 0;
@@ -174,6 +175,11 @@ std::string cygpath (const std::string i
 			output += ('\\' == path [n]) ? '/' : path [n]; // convert backslash to slash
 		}
 	}
+#elif CYGWIN_USE_CYGDRIVE == 2
+    // Convert to c:/foo/bar notation
+	for (unsigned int n = 0; n < path.size (); n++) { // for each char
+			output += ('\\' == path [n]) ? '/' : path [n]; // convert backslash to slash
+	}
 #else
 	for (unsigned int n = 0; n < path.size (); n++) { // for each char
 		if ((1 == n) && (':' == path [n])) { // if a DOS logical drive letter is present
@@ -301,6 +307,11 @@ bool generate_makefile (const CdlConfigu
 	fprintf (stream, "export COMMAND_PREFIX := %s\n", command_prefix.c_str ());
 	fprintf (stream, "export CC := $(COMMAND_PREFIX)gcc\n");
 	fprintf (stream, "export OBJCOPY := $(COMMAND_PREFIX)objcopy\n");
+#ifdef _WIN32
+    fprintf (stream, "export HOST := CYGWIN\n");
+#else
+    fprintf (stream, "export HOST := UNIX\n");
+#endif
 	fprintf (stream, "export AR := $(COMMAND_PREFIX)ar\n\n");
 
 	// generate the package variables
@@ -388,7 +399,17 @@ bool generate_makefile (const CdlConfigu
 	fprintf (stream, "\n\n");
 	for (count = 0; count < info.headers.size (); count++) { // for each header
 		fprintf (stream, "$(PREFIX)/include/%s: $(REPOSITORY)/$(PACKAGE)/%s\n", info.headers [count].destination.c_str (), info.headers [count].source.c_str ());
-		fprintf (stream, "\t@mkdir -p $(dir $@)\n");
+#if defined(_WIN32) && (CYGWIN_USE_CYGDRIVE == 1)
+        fprintf (stream, "ifeq ($(HOST),CYGWIN)\n");
+	    fprintf (stream, "\t@mkdir -p `cygpath -w \"$(dir $@)\" | sed \"s/\\\\\\\\\\/\\\\//g\"`\n");
+        fprintf (stream, "else\n");
+	    fprintf (stream, "\t@mkdir -p $(dir $@)\n");
+        fprintf (stream, "endif\n");
+#else
+        // This prevents older versions of mkdir failing
+        fprintf (stream, "\t@mkdir -p $(dir $@)\n");
+#endif
+
 		fprintf (stream, "\t@cp $< $@\n");
 		fprintf (stream, "\t@chmod u+w $@\n\n");
 	}
@@ -445,6 +466,11 @@ bool generate_toplevel_makefile (const C
 
 	// generate the variables
 	fprintf (stream, "export REPOSITORY := %s\n", cygpath (config->get_database ()->get_component_repository ()).c_str ());
+#ifdef _WIN32
+    fprintf (stream, "export HOST := CYGWIN\n");
+#else
+    fprintf (stream, "export HOST := UNIX\n");
+#endif
 	fprintf (stream, "export PREFIX := %s\n", cygpath (install_tree).c_str ());
 	fprintf (stream, "export COMMAND_PREFIX := %s\n", command_prefix.c_str ());
 	fprintf (stream, "export CC := $(COMMAND_PREFIX)gcc\n");
--- a/host/tools/configtool/common/common/flags.cxx
+++ b/host/tools/configtool/common/common/flags.cxx
@@ -39,6 +39,7 @@
 //==========================================================================
 
 #include "flags.hxx"
+#include <cctype>
 
 static const std::string GLOBAL_FLAGS_PREFIX = "CYGBLD_GLOBAL_";
 static const std::string ADD_FLAGS_SUFFIX    = "_ADD";
--- a/host/tools/configtool/common/win32/FailingRulesDialog.cpp
+++ b/host/tools/configtool/common/win32/FailingRulesDialog.cpp
@@ -182,8 +182,11 @@ void CFailingRulesDialog::OnOK()
               {
                 bool bEnabled=value.is_enabled();
                 str.Format(_T("%s %s and set value to %s\n"),bEnabled?_T("disable"):_T("enable"),strName,strValue);
-                CdlSimpleValue simple_value = valuable->get_simple_value ();
-                valuable->set_enabled_and_value (m_Transaction, bEnabled, simple_value, CdlValueSource_User);
+                // This is wrong: it should set the NEW value. This is the cause of a long-standing bug...
+                // CdlSimpleValue simple_value = valuable->get_simple_value ();
+                //valuable->set_enabled_and_value (m_Transaction, bEnabled, simple_value, CdlValueSource_User);
+                valuable->set_enabled_and_value (m_Transaction, bEnabled, CUtils::UnicodeToStdStr (strValue), CdlValueSource_User);
+
               }
               break;
             case CdlValueFlavor_Data :
--- a/host/tools/configtool/standalone/wxwin/CHANGES.txt
+++ b/host/tools/configtool/standalone/wxwin/CHANGES.txt
@@ -1,7 +1,17 @@
 Release History for eCos Configuration Tool 2
 =============================================
 
-*** Version 2.03, July 2nd 2001
+
+*** Version 2.04, July 16th 2001
+
+- Now uses /cygdrive/ notation which is future-proof for newer Cygwins,
+  and works around a mkdir bug in older Cygwins. A side-effect of this
+  is that we no longer mount drives from the tool, so we don't get the
+  flashing DOS box under Windows. Makefiles now define HOST=CYGWIN
+  so that makefiles can use mkdir the right way under Windows.
+
+
+*** Version 2.03, July 9nd 2001
 
 - Corrected a bug introduced in the previous release, where the initial template
   selection was wrong.
@@ -20,6 +30,12 @@ Release History for eCos Configuration T
 - Fixed bug where message box with an empty repository name was shown if no repository
   was found at all.
 
+- Fixed long-term Configuration Tool bug where some conflicts weren't resolved properly
+  (bool-data options).
+
+- Added vertical scrollbar to Short Description window.
+
+
 *** Version 2.02, June 27th 2001
 
 - Packages are now sorted in the Packages Dialog.
@@ -50,6 +66,7 @@ Release History for eCos Configuration T
 
 - Added CHANGES.txt and TODO.txt to the distribution.
 
+
 *** Version 2.01, June 2001
 
 - Clicking Save when tool was first loaded didn't do anything.
--- a/host/tools/configtool/standalone/wxwin/configtool.cpp
+++ b/host/tools/configtool/standalone/wxwin/configtool.cpp
@@ -30,7 +30,7 @@
 // Author(s):   julians
 // Contact(s):  julians
 // Date:        2000/08/24
-// Version:     $Id: configtool.cpp,v 1.38 2001/07/05 10:42:16 julians Exp $
+// Version:     $Id: configtool.cpp,v 1.40 2001/07/16 14:02:56 julians Exp $
 // Purpose:
 // Description: Implementation file for the ConfigTool application class
 // Requires:
@@ -880,12 +880,15 @@ bool ecApp::PrepareEnvironment(bool bWit
                     // Useful for ecosconfig
                     wxSetEnv(wxT("ECOS_REPOSITORY"), pDoc->GetPackagesDir());
 
+                     // No longer necessary because we're using /cygdrive notation
+#if 0
                     if (! pDoc->GetBuildTree().IsEmpty())
                         CygMount(pDoc->GetBuildTree()[0]);
                     if (! pDoc->GetInstallTree().IsEmpty())
                         CygMount(pDoc->GetInstallTree()[0]);
                     if (! pDoc->GetRepository().IsEmpty())
                         CygMount(pDoc->GetRepository()[0]);
+#endif
                 }
             }
         }
@@ -924,27 +927,27 @@ bool ecApp::PrepareEnvironment(bool bWit
     {
         if (!strBinDir.IsEmpty())
         {
-            (* cmdLine) += wxString(wxT("export PATH=")) + strBinDir + wxT(":$PATH; ");
-
+            (* cmdLine) += wxString(wxT("export PATH=")) + wxString(strBinDir) + wxT(":$PATH; ");
+            
             // Also set the path
             wxString oldPath(wxGetenv(wxT("PATH")));
             wxString path(strBinDir);
             if (!oldPath.IsEmpty())
-	    {
-		path += wxT(":");
+            {
+                path += wxT(":");
                 path += oldPath;
-	    }
+            }
             wxSetEnv(wxT("PATH"), path);
         }
         (* cmdLine) += wxString(wxT("unset GDBTK_LIBRARY; ")) ;
         wxUnsetEnv(wxT("GDBTK_LIBRARY"));
-
+        
         (* cmdLine) += wxString(wxT("unset GCC_EXEC_PREFIX; ")) ;
         wxUnsetEnv(wxT("GCC_EXEC_PREFIX"));
-
-        (* cmdLine) += wxString(wxT("export ECOS_REPOSITORY=")) + pDoc->GetPackagesDir()+ wxT("; ");
+        
+        (* cmdLine) += wxString(wxT("export ECOS_REPOSITORY=")) + wxString(pDoc->GetPackagesDir()) + wxT("; ");
         wxSetEnv(wxT("ECOS_REPOSITORY"), pDoc->GetPackagesDir());
-
+        
 #if 0
         ecFileName strUserBinDir(GetSettings().m_userToolsDir);
         if(strUserBinDir.IsEmpty())
@@ -966,16 +969,16 @@ bool ecApp::PrepareEnvironment(bool bWit
             strHostToolsBinDir = strHostToolsBinDir.Head ();
             
             // tools directories are in the order host-tools, user-tools, comp-tools, install/bin (if present), contrib-tools (if present) on the path
-
+            
             // TODO: is this right? Assuming that the user tools are already in the user's path.
             // const ecFileName strContribBinDir(strUserBinDir, wxT("..\\contrib\\bin"));
             // const ecFileName strUsrBinDir(strUserBinDir, wxT("..\\usr\\bin"));
             const ecFileName strInstallBinDir(pDoc->GetInstallTree (), wxT("bin"));
-
-            (* cmdLine) += wxString(wxT("export PATH=")) + strInstallBinDir + wxT(":$PATH; ");
+            
+            (* cmdLine) += wxString(wxT("export PATH=")) + wxString(strInstallBinDir) + wxT(":$PATH; ");
             (* cmdLine) += wxString(wxT("unset GDBTK_LIBRARY; ")) ;
             (* cmdLine) += wxString(wxT("unset GCC_EXEC_PREFIX; ")) ;
-            (* cmdLine) += wxString(wxT("export ECOS_REPOSITORY=")) + pDoc->GetPackagesDir()+ wxT("; ");
+            (* cmdLine) += wxString(wxT("export ECOS_REPOSITORY=")) + wxString(pDoc->GetPackagesDir()) + wxT("; ");
         }
 #endif
     }
@@ -1038,7 +1041,14 @@ void ecApp::Build(const wxString &strWha
             strCmd += GetSettings().m_strMakeOptions;
         }
         strCmd += wxT(" --directory ");
-        strCmd += pDoc->GetBuildTree();
+
+        // Quoting the name may not mix with the 'sh' command on Unix, so only do it
+        // under Windows where it's more likely there will be spaces needing quoting.
+#ifdef __WXMSW__
+        strCmd += wxString(wxT("\"")) + wxString(pDoc->GetBuildTree()) + wxString(wxT("\""));
+#else
+        strCmd += wxString(pDoc->GetBuildTree()) ;
+#endif
 
         wxString variableSettings;
 
--- a/host/tools/configtool/standalone/wxwin/configtool.h
+++ b/host/tools/configtool/standalone/wxwin/configtool.h
@@ -30,7 +30,7 @@
 // Author(s):   julians
 // Contact(s):  julians
 // Date:        2000/08/24
-// Version:     $Id: configtool.h,v 1.23 2001/06/18 14:41:13 julians Exp $
+// Version:     $Id: configtool.h,v 1.24 2001/07/13 15:17:43 julians Exp $
 // Purpose:
 // Description: main header file for the ConfigTool application
 // Requires:
@@ -102,7 +102,7 @@ class ecPipedProcess;
 // Define a new application type, each program should derive a class from wxApp
 class ecApp : public wxApp
 {
-    friend ecMainFrame;
+    friend class ecMainFrame;
 public:
 //// Ctor & dtor
     ecApp();
--- a/host/tools/configtool/standalone/wxwin/configtoolview.cpp
+++ b/host/tools/configtool/standalone/wxwin/configtoolview.cpp
@@ -30,7 +30,7 @@
 // Author(s):   julians
 // Contact(s):  julians
 // Date:        2000/10/05
-// Version:     $Id: configtoolview.cpp,v 1.10 2001/06/04 17:00:43 julians Exp $
+// Version:     $Id: configtoolview.cpp,v 1.11 2001/07/13 15:17:43 julians Exp $
 // Purpose:
 // Description: Implementation file for the ecConfigToolView class
 // Requires:
@@ -431,17 +431,17 @@ ecConfigItem *ecConfigToolView::DoFind(c
             strName.MakeLower();
         }
 
-        int nIndex=strName.Find(strFind);
+        int nIndex = strName.Find(strFind);
         if(-1!=nIndex)
         {
             if (wxGetApp().GetSettings().m_findMatchWholeWord)
             {
                 // Enforce whole-word semantics: to left and right
-                if(nIndex>0 && IsWordChar(strName[nIndex-1])){
+                if(nIndex>0 && IsWordChar(strName[(unsigned) (nIndex-1)])){
                     continue;
                 }
                 nIndex += strFind.Length();
-                if (nIndex < strName.Length() && IsWordChar(strName[nIndex])){
+                if (nIndex < strName.Length() && IsWordChar(strName[(unsigned) nIndex])){
                     continue;
                 }
             }		
--- a/host/tools/configtool/standalone/wxwin/conflictsdlg.cpp
+++ b/host/tools/configtool/standalone/wxwin/conflictsdlg.cpp
@@ -30,7 +30,7 @@
 // Author(s):   julians
 // Contact(s):  julians
 // Date:        2000/09/06
-// Version:     $Id: conflictsdlg.cpp,v 1.3 2001/04/03 14:28:56 julians Exp $
+// Version:     $Id: conflictsdlg.cpp,v 1.4 2001/07/09 14:21:32 julians Exp $
 // Purpose:
 // Description: Implementation file for the ecResolveConflictsDialog
 // Requires:
@@ -291,8 +291,11 @@ void ecResolveConflictsDialog::OnContinu
                         {
                             bool bEnabled=value.is_enabled();
                             str.Printf(_("%s %s and set value to %s\n"), (const wxChar*) (bEnabled? _("disable"):_("enable")), (const wxChar*) strName, (const wxChar*) strValue);
-                            CdlSimpleValue simple_value = valuable->get_simple_value ();
-                            valuable->set_enabled_and_value (m_Transaction, bEnabled, simple_value, CdlValueSource_User);
+                            // Surely this is wrong - we don't want to set the same value, we want to
+                            // set a NEW value.
+                            // CdlSimpleValue simple_value = valuable->get_simple_value ();
+                            //valuable->set_enabled_and_value (m_Transaction, bEnabled, simple_value, CdlValueSource_User);
+                            valuable->set_enabled_and_value (m_Transaction, bEnabled, ecUtils::UnicodeToStdStr (strValue), CdlValueSource_User);
                         }
                         break;
                     case CdlValueFlavor_Data :
--- a/host/tools/configtool/standalone/wxwin/filename.cpp
+++ b/host/tools/configtool/standalone/wxwin/filename.cpp
@@ -239,7 +239,7 @@ const ecFileName ecFileName::FullName() 
         return *this;
     }
 #else
-    return wxGetCwd() + wxString(cSep) + *this;
+    return wxGetCwd() + wxString(cSep) + wxString(*this);
 #endif
 }
 
@@ -706,7 +706,7 @@ int ecFileName::FindFiles (const wxStrin
 void ecFileName::ReplaceExtension(const wxString& newExt)
 {
     wxString ext = newExt;
-    if (ext[0] == wxT('.'))
+    if (ext[(unsigned) 0] == wxT('.'))
         ext = ext.Mid(1);
 
     wxStripExtension(* this);
--- a/host/tools/configtool/standalone/wxwin/mainwin.cpp
+++ b/host/tools/configtool/standalone/wxwin/mainwin.cpp
@@ -30,7 +30,7 @@
 // Author(s):   julians
 // Contact(s):  julians
 // Date:        2000/08/24
-// Version:     $Id: mainwin.cpp,v 1.46 2001/06/29 13:48:22 julians Exp $
+// Version:     $Id: mainwin.cpp,v 1.47 2001/07/09 14:21:32 julians Exp $
 // Purpose:
 // Description: Implementation file for the ConfigTool main window
 // Requires:
@@ -458,7 +458,7 @@ void ecMainFrame::CreateWindows()
     m_shortDescrSashWindow->SetOrientation(wxLAYOUT_HORIZONTAL);
     m_shortDescrSashWindow->SetAlignment(wxLAYOUT_TOP);
     //m_shortDescrSashWindow->SetSashVisible(wxSASH_TOP, TRUE);
-    m_shortDescrWindow = new ecShortDescriptionWindow(m_shortDescrSashWindow, ecID_SHORT_DESCR_WINDOW, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxCLIP_CHILDREN|wxTE_NO_VSCROLL|wxTE_READONLY);
+    m_shortDescrWindow = new ecShortDescriptionWindow(m_shortDescrSashWindow, ecID_SHORT_DESCR_WINDOW, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxCLIP_CHILDREN/*|wxTE_NO_VSCROLL*/|wxTE_READONLY);
     m_shortDescrWindow->SetBackgroundColour(wxColour(255, 255, 225));
     m_shortDescrWindow->SetHelpText(_("The short description window displays brief help on a selected configuration item."));
     
--- a/host/tools/configtool/standalone/wxwin/mainwin.h
+++ b/host/tools/configtool/standalone/wxwin/mainwin.h
@@ -30,7 +30,7 @@
 // Author(s):   julians
 // Contact(s):  julians
 // Date:        2000/08/24
-// Version:     $Id: mainwin.h,v 1.17 2001/04/24 17:01:45 julians Exp $
+// Version:     $Id: mainwin.h,v 1.18 2001/07/13 15:17:43 julians Exp $
 // Purpose:
 // Description: Header file for the ConfigTool main window
 // Requires:
@@ -74,7 +74,7 @@ class WXDLLEXPORT wxSashLayoutWindow;
 // Define a new frame type: this is going to be our main frame
 class ecMainFrame : public wxDocParentFrame
 {
-    friend ecFindDialog;
+    friend class ecFindDialog;
 
 public:
 // Ctor(s)
--- a/host/tools/configtool/standalone/wxwin/symbols.h
+++ b/host/tools/configtool/standalone/wxwin/symbols.h
@@ -30,7 +30,7 @@
 // Author(s):   julians
 // Contact(s):  julians
 // Date:        2001/05/14
-// Version:     $Id: symbols.h,v 1.6 2001/06/28 15:54:25 julians Exp $
+// Version:     $Id: symbols.h,v 1.7 2001/07/16 14:02:56 julians Exp $
 // Purpose:
 // Description: Some important symbols, such as the version
 // Requires:
@@ -43,5 +43,5 @@
 //
 //===========================================================================
 
-#define ecCONFIGURATION_TOOL_VERSION        2.03
+#define ecCONFIGURATION_TOOL_VERSION        2.04
 
--- a/host/tools/configtool/standalone/wxwin/templatesdlg.cpp
+++ b/host/tools/configtool/standalone/wxwin/templatesdlg.cpp
@@ -30,7 +30,7 @@
 // Author(s):   julians
 // Contact(s):  julians
 // Date:        2000/09/27
-// Version:     $Id: templatesdlg.cpp,v 1.7 2001/06/28 15:54:25 julians Exp $
+// Version:     $Id: templatesdlg.cpp,v 1.8 2001/07/13 15:17:43 julians Exp $
 // Purpose:
 // Description: Implementation file for ecTemplatesDialog
 // Requires:
@@ -219,14 +219,14 @@ void ecTemplatesDialog::PopulateControls
 
 		// use the first alias (if any) as the description
 		wxString strTargetDescription = aliases.size () ? aliases [0].c_str () : target_i->c_str ();
-		cdlHardwareCtrl->Append(strTargetDescription, (void*) target_i); // store the target iterator
+		cdlHardwareCtrl->Append(strTargetDescription, (void*) &(*target_i)); // store the target iterator
         std::string str(* (target_i));
 		if (m_hardware == str.c_str())            // if current target...
         {
             int sel = 0;
             int i;
             for (i = 0; i <= nIndex; i++)
-                if (cdlHardwareCtrl->GetClientData(i) == (void*) target_i)
+                if (cdlHardwareCtrl->GetClientData(i) == (void*) &(*target_i))
                     sel = i;
 			cdlHardwareCtrl->SetSelection (sel); // ...select the string
         }
@@ -244,7 +244,7 @@ void ecTemplatesDialog::PopulateControls
 	for (template_i = templates.begin (); template_i != templates.end (); template_i++)
 	{
 		wxString strTemplateDescription = template_i->c_str ();
-		cdlPackageCtrl->Append(strTemplateDescription, (void*) template_i); // store the template iterator
+		cdlPackageCtrl->Append(strTemplateDescription, (void*) &(*template_i)); // store the template iterator
 		/// m_cboCdlTemplate.SetItemData (nIndex, (DWORD) template_i); // store the template iterator
 		std::string str(* (template_i));
 		if (m_template == str.c_str())          // if current template...
@@ -319,7 +319,8 @@ void ecTemplatesDialog::OnSelHardwareTem
 
 	// the target has changed so retrieve the new target description
 	const int nIndex = cdlHardwareCtrl->GetSelection ();
-	std::vector<std::string>::const_iterator template_i = (std::vector<std::string>::const_iterator) cdlHardwareCtrl->GetClientData (nIndex);
+	//std::vector<std::string>::const_iterator template_i = (std::vector<std::string>::const_iterator) cdlHardwareCtrl->GetClientData (nIndex);
+    std::string* template_i =  (std::string*) cdlHardwareCtrl->GetClientData (nIndex);
 	m_hardware = template_i->c_str();
 
 	m_strCdlHardwareDescription = doc->GetCdlPkgData ()->get_target_description ((const wxChar*) m_hardware).c_str ();
@@ -338,7 +339,8 @@ void ecTemplatesDialog::OnSelPackageTemp
 	// the template has changed so update the version combo box
 	int nIndex = cdlPackageCtrl->GetSelection ();
 
-	std::vector<std::string>::const_iterator template_i = (std::vector<std::string>::const_iterator) cdlPackageCtrl->GetClientData (nIndex);
+	//std::vector<std::string>::const_iterator template_i = (std::vector<std::string>::const_iterator) cdlPackageCtrl->GetClientData (nIndex);
+    std::string *template_i = (std::string*) cdlPackageCtrl->GetClientData (nIndex);
 	m_template = template_i->c_str();
 	
 	UpdateVersionList (wxT("")); // repopulate template versions combo box and select most recent version
--- a/packages/ChangeLog
+++ b/packages/ChangeLog
@@ -1,3 +1,18 @@
+2001-07-16  Bart Veer  <bartv@redhat.com>
+
+	* pkgconf/fixhtml.tcl:
+	Add smarttags protection to the HTML files generated from DocBook.
+	Remove spurious comment.
+
+2001-07-16  Julian Smart <julians@redhat.com>
+
+	* pkconf/rules.mak: worked around Cygwin mkdir problem
+      by introducing a HOST variable and testing for HOST=CYGWIN.
+
+2001-07-06  Jesper Skov  <jskov@redhat.com>
+
+	* ecos.db: Added wallclock driver for DS12887. Moved SH3 wallclock
+	driver into SH directory.
 2001-06-28  Jonathan Larmour  <jlarmour@redhat.com>
 
 	* ecos.db: Clarify edb7xxx description.
--- a/packages/NEWS
+++ b/packages/NEWS
@@ -1,3 +1,4 @@
+* Added wallclock driver for DS12887
 * AM33 STB flash driver added.
 * C library now supports multiple locales with multibyte character set support,
   and the possibility of plugging in more. Current locales supported
--- a/packages/devs/eth/smsc/lan91cxx/current/ChangeLog
+++ b/packages/devs/eth/smsc/lan91cxx/current/ChangeLog
@@ -1,3 +1,12 @@
+2001-07-11  Hugo Tyson  <hmt@redhat.com>
+
+	* src/if_lan91cxx.c (lan91cxx_stop): Clean up any pending tx both
+	to prevent mbuf leak due to noncompletion, and to clear tx_busy so
+	that the newly upbrung device can be used.
+	(lan91cxx_can_send): Similarly detect a stopped tx engine and
+	restart it, and clean up any pending tx, in here.  Otherwise the
+	system cannot progress.
+
 2001-03-27  Hugo Tyson  <hmt@redhat.com>
 2001-03-27  Robin Farine  <acnrf@dial.eunet.ch>
 	
--- a/packages/devs/eth/smsc/lan91cxx/current/src/if_lan91cxx.c
+++ b/packages/devs/eth/smsc/lan91cxx/current/src/if_lan91cxx.c
@@ -255,10 +255,24 @@ smsc_lan91cxx_init(struct cyg_netdevtab_
 static void
 lan91cxx_stop(struct eth_drv_sc *sc)
 {
+    struct lan91cxx_priv_data *cpd =
+        (struct lan91cxx_priv_data *)sc->driver_private;
     DEBUG_FUNCTION();
+
+    CYG_ASSERT( cpd->within_send < 10, "stop: Excess send recursions" );
+    cpd->within_send++;
+    // Complete any outstanding activity:
+    if ( cpd->txbusy ) {
+        cpd->txbusy = 0;
+#if DEBUG & 9
+        diag_printf("LAN91CXX - Stopping, cleaning up pending TX\n" );
+#endif
+        (sc->funs->eth_drv->tx_done)(sc, cpd->txkey, 0);
+    }
     // Reset chip
     put_reg(sc, LAN91CXX_RCR, LAN91CXX_RCR_SOFT_RST);
     put_reg(sc, LAN91CXX_RCR, 0);
+    cpd->txbusy = cpd->within_send = 0;
 }
 
 //
@@ -514,6 +528,7 @@ lan91cxx_can_send(struct eth_drv_sc *sc)
     struct lan91cxx_priv_data *cpd =
         (struct lan91cxx_priv_data *)sc->driver_private;
     unsigned short stat;
+    int tcr;
 
     DEBUG_FUNCTION();
     stat = get_reg(sc, LAN91CXX_EPH_STATUS);
@@ -523,6 +538,24 @@ lan91cxx_can_send(struct eth_drv_sc *sc)
 
     CYG_ASSERT( cpd->within_send < 10, "can_send: Excess send recursions" );
     cpd->within_send++;
+
+    tcr = get_reg(sc, LAN91CXX_TCR);
+    if ( 0 == (LAN91CXX_TCR_TXENA & tcr) ) {
+#if DEBUG & 1
+        diag_printf("%s: ENGINE RESTART: tcr %x\n", __FUNCTION__, tcr );
+#endif
+        // Complete any outstanding activity:
+        if ( cpd->txbusy ) {
+            cpd->txbusy = 0;
+#if DEBUG & 9
+            diag_printf("LAN91CXX - can_send, cleaning up pending TX\n" );
+#endif
+            (sc->funs->eth_drv->tx_done)(sc, cpd->txkey, 0);
+        }
+        tcr |= LAN91CXX_TCR_TXENA;
+        put_reg(sc, LAN91CXX_TCR, tcr);
+    }
+
     // This helps unstick deadly embraces.
     lan91cxx_poll( sc ); // Deal with any outstanding rx state
     cpd->within_send--;
--- a/packages/devs/flash/arm/ebsa285/current/ChangeLog
+++ b/packages/devs/flash/arm/ebsa285/current/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-11  Andrew Lunn <andrew.lunn@ascom.ch>
+
+	* src/flash.h:
+	* src/ebsa285_flash.c (flash_hwr_init): Support new device 28F008SC.
+
 2001-06-11  Gary Thomas  <gthomas@redhat.com>
 
 	* src/ebsa285_flash.c: Remove dependency on printf() via user functions.
--- a/packages/devs/flash/arm/ebsa285/current/src/ebsa285_flash.c
+++ b/packages/devs/flash/arm/ebsa285/current/src/ebsa285_flash.c
@@ -23,7 +23,7 @@
 //                                                                          
 // The Initial Developer of the Original Code is Red Hat.                   
 // Portions created by Red Hat are                                          
-// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.                             
 // All Rights Reserved.                                                     
 // -------------------------------------------                              
 //                                                                          
@@ -70,7 +70,8 @@ flash_hwr_init(void)
 
     HAL_ICACHE_ENABLE();
 
-    if ((data[0] == FLASH_Intel_code) && (data[4] == FLASH_28F008SA)) {
+    if ((data[0] == FLASH_Intel_code) && ((data[4] == FLASH_28F008SA) ||
+					  (data[4] == FLASH_28F008SC))) {
         num_regions = 16;
         region_size = 0x40000;
         flash_info.block_size = region_size;
--- a/packages/devs/flash/arm/ebsa285/current/src/flash.h
+++ b/packages/devs/flash/arm/ebsa285/current/src/flash.h
@@ -23,7 +23,7 @@
 //                                                                          
 // The Initial Developer of the Original Code is Red Hat.                   
 // Portions created by Red Hat are                                          
-// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.                             
 // All Rights Reserved.                                                     
 // -------------------------------------------                              
 //                                                                          
@@ -61,5 +61,5 @@
 
 #define FLASH_Intel_code   0x89
 #define FLASH_28F008SA     0xA2
-
+#define FLASH_28F008SC     0xA6
 #endif  // _FLASH_HWR_H_
--- a/packages/devs/flash/intel/strata/current/ChangeLog
+++ b/packages/devs/flash/intel/strata/current/ChangeLog
@@ -1,3 +1,12 @@
+2001-07-17 Jeroen Dobbelaere  <jeroen.dobbelaere@acunia.com>
+
+	* src/flash_query.c (flash_query): Query needs to be done on even
+	addresses for byte-enabled strata flash 
+
+	* src/flash_program_buf.c (flash_program_buf): Fix of conversion of
+	write buffer length (in bytes) to the length in 'flash_t' words.
+	
+
 2001-06-22  Hugo Tyson  <hmt@redhat.com>
 
 	* src/strata.c (flash_hwr_init): Need to refer to the query code
--- a/packages/devs/flash/intel/strata/current/src/flash_program_buf.c
+++ b/packages/devs/flash/intel/strata/current/src/flash_program_buf.c
@@ -85,7 +85,8 @@ flash_program_buf(volatile flash_t *addr
         wc = buffer_size;
         if (wc > len) wc = len;
         len -= wc;
-        wc = wc / (CYGNUM_FLASH_DEVICES*2);  // Word count
+	// convert 'wc' in bytes to 'wc' in 'flash_t' 
+        wc = wc / sizeof(flash_t);  // Word count
         *BA = FLASH_Write_Buffer;
         timeout = 5000000;
         while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) {
--- a/packages/devs/flash/intel/strata/current/src/flash_query.c
+++ b/packages/devs/flash/intel/strata/current/src/flash_query.c
@@ -86,6 +86,13 @@ flash_query(unsigned char *data)
         // It is very deliberate that data is chars NOT flash_t:
         // The info comes out in bytes regardless of device.
         *data++ = (unsigned char) (*ROM++);
+#ifndef CYGOPT_FLASH_IS_BOOTBLOCK
+# if  8 == CYGNUM_FLASH_WIDTH
+	// strata flash with 'byte-enable' contains the configuration data
+	// at even addresses
+	++ROM;
+# endif
+#endif
     }
     ROM[0] = FLASH_Reset;
 
--- a/packages/devs/pcmcia/arm/assabet/current/ChangeLog
+++ b/packages/devs/pcmcia/arm/assabet/current/ChangeLog
@@ -1,3 +1,9 @@
+2001-07-13  Gary Thomas  <gthomas@redhat.com>
+
+	* src/assabet_pcmcia.c (cf_hwr_change_state): Check for VERS_1
+	field instead of MANID since some cards don't seem to have that one.
+	Suggested by I-Jui Sung <ijsung@csie.nctu.edu.tw>.
+
 2000-09-17  Gary Thomas  <gthomas@redhat.com>
 
 	* src/assabet_pcmcia.c: Change interrupt functions to have same
--- a/packages/devs/pcmcia/arm/assabet/current/src/assabet_pcmcia.c
+++ b/packages/devs/pcmcia/arm/assabet/current/src/assabet_pcmcia.c
@@ -212,7 +212,7 @@ bool
 cf_hwr_change_state(struct cf_slot *slot, int new_state)
 {    
     int i, ptr, len;
-    unsigned char buf[64];
+    unsigned char buf[256];
 
     if (new_state == CF_SLOT_STATE_Ready) {
         if (slot->state == CF_SLOT_STATE_Inserted) {
@@ -242,7 +242,7 @@ cf_hwr_change_state(struct cf_slot *slot
             // Wait until the card is ready to talk
             for (i = 0;  i < 10;  i++) {
                 ptr = 0;
-                if (cf_get_CIS(slot, CF_CISTPL_MANFID, buf, &len, &ptr)) {
+                if (cf_get_CIS(slot, CF_CISTPL_VERS_1, buf, &len, &ptr)) {
                     slot->state = CF_SLOT_STATE_Ready;
                     break;
                 }
--- a/packages/devs/pcmcia/arm/ipaq/current/ChangeLog
+++ b/packages/devs/pcmcia/arm/ipaq/current/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-13  Gary Thomas  <gthomas@redhat.com>
+
+	* src/ipaq_pcmcia.c (cf_hwr_change_state): Use VERS_1 instead of
+	MANID since some cards don't seem to support that.
+
 2001-03-14  Gary Thomas  <gthomas@redhat.com>
 
 	* src/ipaq_pcmcia.c (cf_hwr_init): Leave GPIO/timing setup to HAL code.
--- a/packages/devs/pcmcia/arm/ipaq/current/src/ipaq_pcmcia.c
+++ b/packages/devs/pcmcia/arm/ipaq/current/src/ipaq_pcmcia.c
@@ -211,7 +211,7 @@ bool
 cf_hwr_change_state(struct cf_slot *slot, int new_state)
 {    
     int i, ptr, len;
-    unsigned char buf[64];
+    unsigned char buf[256];
 
     if (new_state == CF_SLOT_STATE_Ready) {
         if (slot->state == CF_SLOT_STATE_Inserted) {
@@ -227,8 +227,7 @@ cf_hwr_change_state(struct cf_slot *slot
             // Wait until the card is ready to talk
             for (i = 0;  i < 10;  i++) {
                 ptr = 0;
-                if (cf_get_CIS(slot, CF_CISTPL_MANFID, buf, &len, &ptr)) {
-		    diag_printf("Ready!\n");
+                if (cf_get_CIS(slot, CF_CISTPL_VERS_1, buf, &len, &ptr)) {
                     slot->state = CF_SLOT_STATE_Ready;
                     break;
                 }
new file mode 100644
--- /dev/null
+++ b/packages/devs/wallclock/dallas/ds12887/current/ChangeLog
@@ -0,0 +1,32 @@
+2001-07-06  Jesper Skov  <jskov@redhat.com>
+
+	* src/ds12887.cxx (get_ds_hwclock): Instead of locking while
+	reading (which prevents updates if polled), disable interrupts.
+
+	* New package, based on 1742 driver.
+	
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+
+
new file mode 100644
--- /dev/null
+++ b/packages/devs/wallclock/dallas/ds12887/current/cdl/wallclock_ds12887.cdl
@@ -0,0 +1,96 @@
+# ====================================================================
+#
+#      wallclock_ds12887.cdl
+#
+#      eCos configuration data for Dallas 12887
+#
+# ====================================================================
+#####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, 2001 Red Hat, Inc. 
+# All Rights Reserved.                                                     
+# -------------------------------------------                              
+#                                                                          
+#####COPYRIGHTEND####
+# ====================================================================
+######DESCRIPTIONBEGIN####
+#
+# Author(s):      jskov
+# Contributors:   jskov
+# Date:           2001-07-06
+#
+#####DESCRIPTIONEND####
+#
+# ====================================================================
+
+cdl_package CYGPKG_DEVICES_WALLCLOCK_DALLAS_DS12887 {
+    parent        CYGPKG_IO_WALLCLOCK
+    active_if     CYGPKG_IO_WALLCLOCK
+    display       "Wallclock device driver for Dallas 12887"
+    description   "
+        This package provides a file with init, get and set functions
+        for the Dallas 12887 clock part."
+
+    compile       ds12887.cxx
+
+    implements    CYGINT_WALLCLOCK_HW_IMPLEMENTATIONS
+    active_if     CYGIMP_WALLCLOCK_HARDWARE
+    implements    CYGINT_WALLCLOCK_SET_GET_MODE_SUPPORTED
+
+    cdl_option CYGIMP_WALLCLOCK_HARDWARE {
+        parent    CYGPKG_IO_WALLCLOCK_IMPLEMENTATION
+        display       "Hardware wallclock"
+        default_value 1
+        implements    CYGINT_WALLCLOCK_IMPLEMENTATIONS
+    }
+
+
+    cdl_component CYGPKG_DEVICES_WALLCLOCK_DALLAS_DS12887_OPTIONS {
+        display "DS12887 wallclock build options"
+        flavor  none
+        description   "
+	    Package specific build options including control over
+	    compiler flags used only in building this package,
+	    and details of which tests are built."
+
+
+        cdl_option CYGPKG_DEVICES_WALLCLOCK_DALLAS_DS12887_CFLAGS_ADD {
+            display "Additional compiler flags"
+            flavor  data
+            no_define
+            default_value { "" }
+            description   "
+                This option modifies the set of compiler flags for
+                building the wallclock device. These flags are used in addition
+                to the set of global flags."
+        }
+
+        cdl_option CYGPKG_DEVICES_WALLCLOCK_DALLAS_DS12887_CFLAGS_REMOVE {
+            display "Suppressed compiler flags"
+            flavor  data
+            no_define
+            default_value { "" }
+            description   "
+                This option modifies the set of compiler flags for
+                building the wallclock device. These flags are removed from
+                the set of global flags if present."
+        }
+
+    }
+}
new file mode 100644
--- /dev/null
+++ b/packages/devs/wallclock/dallas/ds12887/current/src/ds12887.cxx
@@ -0,0 +1,258 @@
+//==========================================================================
+//
+//      devs/wallclock/ds12887.inl
+//
+//      Wallclock implementation for Dallas 12887
+//
+//==========================================================================
+//####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, 2001 Red Hat, Inc.
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):     jskov
+// Contributors:  jskov
+// Date:          2001-07-06
+// Purpose:       Wallclock driver for Dallas 12887
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#include <pkgconf/wallclock.h>          // Wallclock device config
+
+#include <cyg/hal/hal_io.h>             // IO macros
+#include <cyg/hal/hal_intr.h>           // interrupt enable/disable
+#include <cyg/infra/cyg_type.h>         // Common type definitions and support
+
+#include <cyg/io/wallclock.hxx>         // The WallClock API
+#include <cyg/io/wallclock/wallclock.inl> // Helpers
+
+#include <cyg/infra/diag.h>
+
+#define nDEBUG
+
+// Platform details
+#include CYGDAT_DEVS_WALLCLOCK_DALLAS_12887_INL
+
+#ifndef DS_READ_UINT8
+# define DS_READ_UINT8(x,y) HAL_READ_UINT8(x,y)
+# define DS_WRITE_UINT8(x,y) HAL_WRITE_UINT8(x,y)
+#endif
+
+#ifdef DS_LINEAR
+# ifndef DS_STEP
+#  define DS_STEP 0
+# endif
+# ifndef DS_BASE
+#  error "Need to know base of DS12887 part"
+# endif
+# define DS_READ(offset, data) DS_READ_UINT8(DS_BASE + ((offset) << DS_STEP), (data))
+# define DS_WRITE(offset, data) DS_WRITE_UINT8(DS_BASE + ((offset) << DS_STEP), (data))
+#else
+# if !defined(DS_ADDR) || !defined(DS_DATA)
+#  error "Need to know addr/data locations of DS12887 part"
+# endif
+# define DS_READ(offset, data)                 \
+  CYG_MACRO_START                              \
+  DS_WRITE_UINT8(DS_ADDR, (offset));           \
+  DS_READ_UINT8(DS_DATA, (data));              \
+  CYG_MACRO_END
+# define DS_WRITE(offset, data)                \
+  CYG_MACRO_START                              \
+  DS_WRITE_UINT8(DS_ADDR, (offset));           \
+  DS_WRITE_UINT8(DS_DATA, (data));             \
+  CYG_MACRO_END
+#endif
+
+// Registers
+#define DS_SECONDS         0x00
+#define DS_SECONDS_ALARM   0x01
+#define DS_MINUTES         0x02
+#define DS_MINUTES_ALARM   0x03
+#define DS_HOURS           0x04
+#define DS_HOURS_ALARM     0x05
+#define DS_DOW             0x06
+#define DS_DOM             0x07
+#define DS_MONTH           0x08
+#define DS_YEAR            0x09
+#define DS_CENTURY         0x32
+
+#define DS_REG_A           0x0a
+#define DS_REG_B           0x0b
+#define DS_REG_C           0x0c
+#define DS_REG_D           0x0d
+
+// Control bits
+#define DS_REG_A_UIP       0x80
+#define DS_REG_A_ENABLE    0x20
+
+#define DS_REG_B_SET       0x80
+#define DS_REG_B_DM        0x04
+#define DS_REG_B_24H       0x02
+
+
+//----------------------------------------------------------------------------
+// Accessor functions
+static inline void
+init_ds_hwclock(void)
+{
+    // Set binary and 24H mode
+    DS_WRITE(DS_REG_B, DS_REG_B_DM | DS_REG_B_24H);
+    // Enable clock
+    DS_WRITE(DS_REG_A, DS_REG_A_ENABLE);
+}
+
+
+static inline void
+set_ds_hwclock(cyg_uint32 year, cyg_uint32 month, cyg_uint32 mday,
+               cyg_uint32 hour, cyg_uint32 minute, cyg_uint32 second)
+{
+    cyg_uint8 _regb;
+    // Stop counting
+    DS_READ(DS_REG_B, _regb);
+    _regb |= DS_REG_B_SET;
+    DS_WRITE(DS_REG_B, _regb);
+
+    DS_WRITE(DS_CENTURY, (cyg_uint8)(year / 100));
+    DS_WRITE(DS_YEAR, (cyg_uint8)(year % 100));
+    DS_WRITE(DS_MONTH, (cyg_uint8)month);
+    DS_WRITE(DS_DOM, (cyg_uint8)mday);
+    DS_WRITE(DS_HOURS, (cyg_uint8)hour);
+    DS_WRITE(DS_MINUTES, (cyg_uint8)minute);
+    DS_WRITE(DS_SECONDS, (cyg_uint8)second);
+
+    // Restart counting
+    _regb &= ~DS_REG_B_SET;
+    DS_WRITE(DS_REG_B, _regb);
+
+#ifdef DEBUG
+    // This will cause the test to eventually fail due to these printouts
+    // causing timer interrupts to be lost...
+    diag_printf("Set -------------\n");
+    diag_printf("year %02d\n", year);
+    diag_printf("month %02d\n", month);
+    diag_printf("mday %02d\n", mday);
+    diag_printf("hour %02d\n", hour);
+    diag_printf("minute %02d\n", minute);
+    diag_printf("second %02d\n", second);
+#endif
+}
+
+static inline void
+get_ds_hwclock(cyg_uint32* year, cyg_uint32* month, cyg_uint32* mday,
+               cyg_uint32* hour, cyg_uint32* minute, cyg_uint32* second)
+{
+    cyg_uint8 _reg, _t1, _t2;
+    cyg_uint32 _old;
+
+    // Wait for update flag clears
+    do {
+        DS_READ(DS_REG_A, _reg);
+    } while (_reg & DS_REG_A_UIP);
+
+    // Disable interrupts while reading to ensure it doesn't take more
+    // than 244us.
+    HAL_DISABLE_INTERRUPTS(_old);
+
+    DS_READ(DS_CENTURY, _t1);
+    DS_READ(DS_YEAR, _t2);
+    *year = (cyg_uint32)_t1*100 + (cyg_uint32)_t2;
+
+    DS_READ(DS_MONTH, _t1);
+    *month = (cyg_uint32)_t1;
+
+    DS_READ(DS_DOM, _t1);
+    *mday = (cyg_uint32)_t1;
+
+    DS_READ(DS_HOURS, _t1);
+    *hour = (cyg_uint32)_t1;
+
+    DS_READ(DS_MINUTES, _t1);
+    *minute = (cyg_uint32)_t1;
+
+    DS_READ(DS_SECONDS, _t1);
+    *second = (cyg_uint32)_t1;
+
+    // Reenable interrupts
+    HAL_RESTORE_INTERRUPTS(_old);
+
+#ifdef DEBUG
+    // This will cause the test to eventually fail due to these printouts
+    // causing timer interrupts to be lost...
+    diag_printf("year %02d\n", *year);
+    diag_printf("month %02d\n", *month);
+    diag_printf("mday %02d\n", *mday);
+    diag_printf("hour %02d\n", *hour);
+    diag_printf("minute %02d\n", *minute);
+    diag_printf("second %02d\n", *second);
+#endif
+}
+
+//-----------------------------------------------------------------------------
+// Functions required for the hardware-driver API.
+
+// Returns the number of seconds elapsed since 1970-01-01 00:00:00.
+cyg_uint32 
+Cyg_WallClock::get_hw_seconds(void)
+{
+    cyg_uint32 year, month, mday, hour, minute, second;
+
+    get_ds_hwclock(&year, &month, &mday, &hour, &minute, &second);
+
+    cyg_uint32 now = _simple_mktime(year, month, mday, hour, minute, second);
+    return now;
+}
+
+#ifdef CYGSEM_WALLCLOCK_SET_GET_MODE
+
+// Sets the clock. Argument is seconds elapsed since 1970-01-01 00:00:00.
+void
+Cyg_WallClock::set_hw_seconds( cyg_uint32 secs )
+{
+    cyg_uint32 year, month, mday, hour, minute, second;
+
+    _simple_mkdate(secs, &year, &month, &mday, &hour, &minute, &second);
+
+    set_ds_hwclock(year, month, mday, hour, minute, second);
+}
+
+#endif
+
+void
+Cyg_WallClock::init_hw_seconds(void)
+{
+#ifdef CYGSEM_WALLCLOCK_SET_GET_MODE
+    init_ds_hwclock();
+#else
+    // This is our base: 1970-01-01 00:00:00
+    // Set the HW clock - if for nothing else, just to be sure it's in a
+    // legal range. Any arbitrary base could be used.
+    // After this the hardware clock is only read.
+    set_ds_hwclock(1970,1,1,0,0,0);
+#endif
+}
+
+//-----------------------------------------------------------------------------
+// End of devs/wallclock/ds12887.inl
new file mode 100644
--- /dev/null
+++ b/packages/devs/wallclock/sh/sh3/current/ChangeLog
@@ -0,0 +1,74 @@
+2001-07-09  Jesper Skov  <jskov@redhat.com>
+
+	* src/wallclock_sh3.cxx: fix description.
+
+2001-03-20  Jesper Skov  <jskov@redhat.com>
+
+	* src/wallclock_sh3.cxx: Don't include kernel config.
+
+2000-05-26  Jesper Skov  <jskov@redhat.com>
+
+	* cdl/wallclock_sh3.cdl: CYGSEM_WALLCLOCK_SET_GET_MODE moved to IO
+	package.
+
+	* src/wallclock_sh3.cxx: Get helpers from new file.
+
+2000-04-06  Jesper Skov  <jskov@redhat.com>
+
+	* cdl/wallclock_sh3.cdl: Only active when wallclock is.
+
+2000-04-05  John Dallaway  <jld@cygnus.co.uk>
+
+	* cdl/wallclock_sh3.cdl: 
+
+	Provide hardware wallclock implementation as a radio button.
+
+2000-04-05  Jesper Skov  <jskov@redhat.com>
+
+	* src/wallclock_sh3.cxx: 
+	Moved from devs/wallclock/current to here.
+	Get API from io/wallclock.
+	Deleted all non-SH3 changelog entries
+
+2000-03-29  Jesper Skov  <jskov@redhat.com>
+
+	* tests/wallclock2.cxx:
+	* include/wallclock.hxx:
+	* src/sh3.cxx: 
+	* src/wallclock.cxx: 
+	* cdl/wallclock.cdl:
+	Reworked WallClock API. It should now be simpler to add new
+	wallclock drivers. Added a simple test to print out the current
+	wallclock value so a human can verify battery backup works.
+
+2000-03-17  Jesper Skov  <jskov@redhat.com>
+
+	* cdl/wallclock.cdl: 
+	* src/sh3.cxx: 
+	Added wallclock driver for SH3 RTC module.
+
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+
+
new file mode 100644
--- /dev/null
+++ b/packages/devs/wallclock/sh/sh3/current/cdl/wallclock_sh3.cdl
@@ -0,0 +1,92 @@
+# ====================================================================
+#
+#      wallclock_sh3.cdl
+#
+#      eCos wallclock SH3 RTC-module driver configuration data
+#
+# ====================================================================
+#####COPYRIGHTBEGIN####
+#                                                                          
+# -------------------------------------------                              
+# The contents of this file are subject to the Red Hat eCos Public License 
+# Version 1.1 (the "License"); you may not use this file except in         
+# compliance with the License.  You may obtain a copy of the License at    
+# http://www.redhat.com/                                                   
+#                                                                          
+# Software distributed under the License is distributed on an "AS IS"      
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+# License for the specific language governing rights and limitations under 
+# the License.                                                             
+#                                                                          
+# The Original Code is eCos - Embedded Configurable Operating System,      
+# released September 30, 1998.                                             
+#                                                                          
+# The Initial Developer of the Original Code is Red Hat.                   
+# Portions created by Red Hat are                                          
+# Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+# All Rights Reserved.                                                     
+# -------------------------------------------                              
+#                                                                          
+#####COPYRIGHTEND####
+# ====================================================================
+######DESCRIPTIONBEGIN####
+#
+# Author(s):      jskov
+# Original data:  nickg
+# Contributors:
+# Date:           2000-04-05
+#
+#####DESCRIPTIONEND####
+#
+# ====================================================================
+
+cdl_package CYGPKG_DEVICES_WALLCLOCK_SH3 {
+    parent        CYGPKG_IO_WALLCLOCK
+    active_if     CYGPKG_IO_WALLCLOCK
+    display       "SH3 RTC-module wallclock driver"
+    requires      CYGPKG_HAL_SH
+    hardware
+    compile       wallclock_sh3.cxx
+    implements    CYGINT_WALLCLOCK_HW_IMPLEMENTATIONS
+    active_if     CYGIMP_WALLCLOCK_HARDWARE
+
+    cdl_option CYGIMP_WALLCLOCK_HARDWARE {
+        parent    CYGPKG_IO_WALLCLOCK_IMPLEMENTATION
+        display       "Hardware wallclock"
+        default_value 1
+        implements    CYGINT_WALLCLOCK_IMPLEMENTATIONS
+    }
+
+    cdl_component CYGPKG_DEVICES_WALLCLOCK_SH3_OPTIONS {
+        display "SH3 RTC-module wallclock build options"
+        flavor  none
+        description   "
+	    Package specific build options including control over
+	    compiler flags used only in building this package,
+	    and details of which tests are built."
+
+
+        cdl_option CYGPKG_DEVICES_WALLCLOCK_SH3_CFLAGS_ADD {
+            display "Additional compiler flags"
+            flavor  data
+            no_define
+            default_value { "" }
+            description   "
+                This option modifies the set of compiler flags for
+                building the wallclock device. These flags are used in addition
+                to the set of global flags."
+        }
+
+        cdl_option CYGPKG_DEVICES_WALLCLOCK_SH3_CFLAGS_REMOVE {
+            display "Suppressed compiler flags"
+            flavor  data
+            no_define
+            default_value { "" }
+            description   "
+                This option modifies the set of compiler flags for
+                building the wallclock device. These flags are removed from
+                the set of global flags if present."
+        }
+
+    }
+}
new file mode 100644
--- /dev/null
+++ b/packages/devs/wallclock/sh/sh3/current/src/wallclock_sh3.cxx
@@ -0,0 +1,166 @@
+//==========================================================================
+//
+//      devs/wallclock/sh3.cxx
+//
+//      SH3 RTC module driver.
+//
+//==========================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):     jskov
+// Contributors:  jskov
+// Date:          2000-03-17
+// Purpose:       Wallclock driver for SH3 CPU RTC module
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#include <pkgconf/wallclock.h>          // Wallclock device config
+
+#include <cyg/hal/hal_io.h>             // IO macros
+#include <cyg/infra/cyg_type.h>         // Common type definitions and support
+
+#include <cyg/io/wallclock.hxx>         // The WallClock API
+#include <cyg/io/wallclock/wallclock.inl> // Helpers
+
+#include <cyg/hal/sh_regs.h>            // RTC register definitions
+
+#include <cyg/infra/diag.h>             // For debugging
+
+
+
+//-----------------------------------------------------------------------------
+// Functions for setting and getting the hardware clock counters
+
+// Year must be last two digits of "western calendar year". Leap year when
+// divisible by four.
+static void
+set_sh3_hwclock(cyg_uint32 year, cyg_uint32 month, cyg_uint32 mday,
+                cyg_uint32 hour, cyg_uint32 minute, cyg_uint32 second)
+{
+    // Stop RTC
+    HAL_WRITE_UINT8(CYGARC_REG_RCR2, CYGARC_REG_RCR2_RESET);
+
+    // Program it
+    HAL_WRITE_UINT8(CYGARC_REG_RYRCNT,  TO_BCD(year));
+    HAL_WRITE_UINT8(CYGARC_REG_RMONCNT, TO_BCD(month));
+    HAL_WRITE_UINT8(CYGARC_REG_RDAYCNT, TO_BCD(mday));
+    HAL_WRITE_UINT8(CYGARC_REG_RHRCNT,  TO_BCD(hour));
+    HAL_WRITE_UINT8(CYGARC_REG_RMINCNT, TO_BCD(minute));
+    HAL_WRITE_UINT8(CYGARC_REG_RSECCNT, TO_BCD(second));
+
+    // Start RTC
+    HAL_WRITE_UINT8(CYGARC_REG_RCR1, CYGARC_REG_RCR1_CIE);
+    HAL_WRITE_UINT8(CYGARC_REG_RCR2, 
+                    CYGARC_REG_RCR2_RTCEN | CYGARC_REG_RCR2_START);
+
+}
+
+static void
+get_sh3_hwclock(cyg_uint32* year, cyg_uint32* month, cyg_uint32* mday,
+                cyg_uint32* hour, cyg_uint32* minute, cyg_uint32* second)
+{
+    cyg_uint8 tmp;
+
+    do {
+        // Clear carry flag
+        HAL_WRITE_UINT8(CYGARC_REG_RCR1, 0);
+        
+        // Read time
+        HAL_READ_UINT8(CYGARC_REG_RYRCNT, tmp);
+        *year = TO_DEC(tmp);
+        HAL_READ_UINT8(CYGARC_REG_RMONCNT, tmp);
+        *month = TO_DEC(tmp);
+        HAL_READ_UINT8(CYGARC_REG_RDAYCNT, tmp);
+        *mday = TO_DEC(tmp);
+        HAL_READ_UINT8(CYGARC_REG_RHRCNT, tmp);
+        *hour = TO_DEC(tmp);
+        HAL_READ_UINT8(CYGARC_REG_RMINCNT, tmp);
+        *minute = TO_DEC(tmp);
+        HAL_READ_UINT8(CYGARC_REG_RSECCNT, tmp);
+        *second = TO_DEC(tmp);
+
+        // Read carry flag
+        HAL_READ_UINT8(CYGARC_REG_RCR1, tmp);
+    } while (CYGARC_REG_RCR1_CF & tmp); // loop if carry set
+}
+
+//-----------------------------------------------------------------------------
+// Functions required for the hardware-driver API.
+
+// Returns the number of seconds elapsed since 1970-01-01 00:00:00.
+cyg_uint32 
+Cyg_WallClock::get_hw_seconds(void)
+{
+    cyg_uint32 year, month, mday, hour, minute, second;
+
+    get_sh3_hwclock(&year, &month, &mday, &hour, &minute, &second);
+
+#if 0
+    // This will cause the test to eventually fail due to these printouts
+    // causing timer interrupts to be lost...
+    diag_printf("year %02d\n", year);
+    diag_printf("month %02d\n", month);
+    diag_printf("mday %02d\n", mday);
+    diag_printf("hour %02d\n", hour);
+    diag_printf("minute %02d\n", minute);
+    diag_printf("second %02d\n", second);
+#endif
+
+#ifndef CYGSEM_WALLCLOCK_SET_GET_MODE
+    // We know what we initialized the hardware for : 1970, so by doing this
+    // the returned time should be OK for 30 years uptime.
+    year += 1900;
+#else
+    // Need to use sliding window or similar to figure out what the
+    // century should be... Patent issue is unclear, and since there's
+    // no battery backup of the clock, there's little point in
+    // investigating.
+# error "Need some magic here to figure out century counter"
+#endif
+
+    cyg_uint32 now = _simple_mktime(year, month, mday, hour, minute, second);
+    return now;
+}
+
+#ifndef CYGSEM_WALLCLOCK_SET_GET_MODE
+
+void
+Cyg_WallClock::init_hw_seconds(void)
+{
+    // This is our base: 1970-01-01 00:00:00
+    // Set the HW clock - if for nothing else, just to be sure it's in a
+    // legal range. Any arbitrary base could be used.
+    // After this the hardware clock is only read.
+    set_sh3_hwclock(70,1,1,0,0,0);
+}
+
+#endif // CYGSEM_WALLCLOCK_SET_GET_MODE
+
+//-----------------------------------------------------------------------------
+// End of devs/wallclock/sh3.cxx
deleted file mode 100644
--- a/packages/devs/wallclock/sh3/current/ChangeLog
+++ /dev/null
@@ -1,70 +0,0 @@
-2001-03-20  Jesper Skov  <jskov@redhat.com>
-
-	* src/wallclock_sh3.cxx: Don't include kernel config.
-
-2000-05-26  Jesper Skov  <jskov@redhat.com>
-
-	* cdl/wallclock_sh3.cdl: CYGSEM_WALLCLOCK_SET_GET_MODE moved to IO
-	package.
-
-	* src/wallclock_sh3.cxx: Get helpers from new file.
-
-2000-04-06  Jesper Skov  <jskov@redhat.com>
-
-	* cdl/wallclock_sh3.cdl: Only active when wallclock is.
-
-2000-04-05  John Dallaway  <jld@cygnus.co.uk>
-
-	* cdl/wallclock_sh3.cdl: 
-
-	Provide hardware wallclock implementation as a radio button.
-
-2000-04-05  Jesper Skov  <jskov@redhat.com>
-
-	* src/wallclock_sh3.cxx: 
-	Moved from devs/wallclock/current to here.
-	Get API from io/wallclock.
-	Deleted all non-SH3 changelog entries
-
-2000-03-29  Jesper Skov  <jskov@redhat.com>
-
-	* tests/wallclock2.cxx:
-	* include/wallclock.hxx:
-	* src/sh3.cxx: 
-	* src/wallclock.cxx: 
-	* cdl/wallclock.cdl:
-	Reworked WallClock API. It should now be simpler to add new
-	wallclock drivers. Added a simple test to print out the current
-	wallclock value so a human can verify battery backup works.
-
-2000-03-17  Jesper Skov  <jskov@redhat.com>
-
-	* cdl/wallclock.cdl: 
-	* src/sh3.cxx: 
-	Added wallclock driver for SH3 RTC module.
-
-//####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####
-
-
deleted file mode 100644
--- a/packages/devs/wallclock/sh3/current/cdl/wallclock_sh3.cdl
+++ /dev/null
@@ -1,92 +0,0 @@
-# ====================================================================
-#
-#      wallclock_sh3.cdl
-#
-#      eCos wallclock SH3 RTC-module driver configuration data
-#
-# ====================================================================
-#####COPYRIGHTBEGIN####
-#                                                                          
-# -------------------------------------------                              
-# The contents of this file are subject to the Red Hat eCos Public License 
-# Version 1.1 (the "License"); you may not use this file except in         
-# compliance with the License.  You may obtain a copy of the License at    
-# http://www.redhat.com/                                                   
-#                                                                          
-# Software distributed under the License is distributed on an "AS IS"      
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
-# License for the specific language governing rights and limitations under 
-# the License.                                                             
-#                                                                          
-# The Original Code is eCos - Embedded Configurable Operating System,      
-# released September 30, 1998.                                             
-#                                                                          
-# The Initial Developer of the Original Code is Red Hat.                   
-# Portions created by Red Hat are                                          
-# Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
-# All Rights Reserved.                                                     
-# -------------------------------------------                              
-#                                                                          
-#####COPYRIGHTEND####
-# ====================================================================
-######DESCRIPTIONBEGIN####
-#
-# Author(s):      jskov
-# Original data:  nickg
-# Contributors:
-# Date:           2000-04-05
-#
-#####DESCRIPTIONEND####
-#
-# ====================================================================
-
-cdl_package CYGPKG_DEVICES_WALLCLOCK_SH3 {
-    parent        CYGPKG_IO_WALLCLOCK
-    active_if     CYGPKG_IO_WALLCLOCK
-    display       "SH3 RTC-module wallclock driver"
-    requires      CYGPKG_HAL_SH
-    hardware
-    compile       wallclock_sh3.cxx
-    implements    CYGINT_WALLCLOCK_HW_IMPLEMENTATIONS
-    active_if     CYGIMP_WALLCLOCK_HARDWARE
-
-    cdl_option CYGIMP_WALLCLOCK_HARDWARE {
-        parent    CYGPKG_IO_WALLCLOCK_IMPLEMENTATION
-        display       "Hardware wallclock"
-        default_value 1
-        implements    CYGINT_WALLCLOCK_IMPLEMENTATIONS
-    }
-
-    cdl_component CYGPKG_DEVICES_WALLCLOCK_SH3_OPTIONS {
-        display "SH3 RTC-module wallclock build options"
-        flavor  none
-        description   "
-	    Package specific build options including control over
-	    compiler flags used only in building this package,
-	    and details of which tests are built."
-
-
-        cdl_option CYGPKG_DEVICES_WALLCLOCK_SH3_CFLAGS_ADD {
-            display "Additional compiler flags"
-            flavor  data
-            no_define
-            default_value { "" }
-            description   "
-                This option modifies the set of compiler flags for
-                building the wallclock device. These flags are used in addition
-                to the set of global flags."
-        }
-
-        cdl_option CYGPKG_DEVICES_WALLCLOCK_SH3_CFLAGS_REMOVE {
-            display "Suppressed compiler flags"
-            flavor  data
-            no_define
-            default_value { "" }
-            description   "
-                This option modifies the set of compiler flags for
-                building the wallclock device. These flags are removed from
-                the set of global flags if present."
-        }
-
-    }
-}
deleted file mode 100644
--- a/packages/devs/wallclock/sh3/current/src/wallclock_sh3.cxx
+++ /dev/null
@@ -1,166 +0,0 @@
-//==========================================================================
-//
-//      devs/wallclock/sh3.cxx
-//
-//      Wallclock emulation implementation
-//
-//==========================================================================
-//####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-03-17
-// Purpose:       Wallclock driver for SH3 CPU RTC module
-//
-//####DESCRIPTIONEND####
-//
-//==========================================================================
-
-#include <pkgconf/wallclock.h>          // Wallclock device config
-
-#include <cyg/hal/hal_io.h>             // IO macros
-#include <cyg/infra/cyg_type.h>         // Common type definitions and support
-
-#include <cyg/io/wallclock.hxx>         // The WallClock API
-#include <cyg/io/wallclock/wallclock.inl> // Helpers
-
-#include <cyg/hal/sh_regs.h>            // RTC register definitions
-
-#include <cyg/infra/diag.h>             // For debugging
-
-
-
-//-----------------------------------------------------------------------------
-// Functions for setting and getting the hardware clock counters
-
-// Year must be last two digits of "western calendar year". Leap year when
-// divisible by four.
-static void
-set_sh3_hwclock(cyg_uint32 year, cyg_uint32 month, cyg_uint32 mday,
-                cyg_uint32 hour, cyg_uint32 minute, cyg_uint32 second)
-{
-    // Stop RTC
-    HAL_WRITE_UINT8(CYGARC_REG_RCR2, CYGARC_REG_RCR2_RESET);
-
-    // Program it
-    HAL_WRITE_UINT8(CYGARC_REG_RYRCNT,  TO_BCD(year));
-    HAL_WRITE_UINT8(CYGARC_REG_RMONCNT, TO_BCD(month));
-    HAL_WRITE_UINT8(CYGARC_REG_RDAYCNT, TO_BCD(mday));
-    HAL_WRITE_UINT8(CYGARC_REG_RHRCNT,  TO_BCD(hour));
-    HAL_WRITE_UINT8(CYGARC_REG_RMINCNT, TO_BCD(minute));
-    HAL_WRITE_UINT8(CYGARC_REG_RSECCNT, TO_BCD(second));
-
-    // Start RTC
-    HAL_WRITE_UINT8(CYGARC_REG_RCR1, CYGARC_REG_RCR1_CIE);
-    HAL_WRITE_UINT8(CYGARC_REG_RCR2, 
-                    CYGARC_REG_RCR2_RTCEN | CYGARC_REG_RCR2_START);
-
-}
-
-static void
-get_sh3_hwclock(cyg_uint32* year, cyg_uint32* month, cyg_uint32* mday,
-                cyg_uint32* hour, cyg_uint32* minute, cyg_uint32* second)
-{
-    cyg_uint8 tmp;
-
-    do {
-        // Clear carry flag
-        HAL_WRITE_UINT8(CYGARC_REG_RCR1, 0);
-        
-        // Read time
-        HAL_READ_UINT8(CYGARC_REG_RYRCNT, tmp);
-        *year = TO_DEC(tmp);
-        HAL_READ_UINT8(CYGARC_REG_RMONCNT, tmp);
-        *month = TO_DEC(tmp);
-        HAL_READ_UINT8(CYGARC_REG_RDAYCNT, tmp);
-        *mday = TO_DEC(tmp);
-        HAL_READ_UINT8(CYGARC_REG_RHRCNT, tmp);
-        *hour = TO_DEC(tmp);
-        HAL_READ_UINT8(CYGARC_REG_RMINCNT, tmp);
-        *minute = TO_DEC(tmp);
-        HAL_READ_UINT8(CYGARC_REG_RSECCNT, tmp);
-        *second = TO_DEC(tmp);
-
-        // Read carry flag
-        HAL_READ_UINT8(CYGARC_REG_RCR1, tmp);
-    } while (CYGARC_REG_RCR1_CF & tmp); // loop if carry set
-}
-
-//-----------------------------------------------------------------------------
-// Functions required for the hardware-driver API.
-
-// Returns the number of seconds elapsed since 1970-01-01 00:00:00.
-cyg_uint32 
-Cyg_WallClock::get_hw_seconds(void)
-{
-    cyg_uint32 year, month, mday, hour, minute, second;
-
-    get_sh3_hwclock(&year, &month, &mday, &hour, &minute, &second);
-
-#if 0
-    // This will cause the test to eventually fail due to these printouts
-    // causing timer interrupts to be lost...
-    diag_printf("year %02d\n", year);
-    diag_printf("month %02d\n", month);
-    diag_printf("mday %02d\n", mday);
-    diag_printf("hour %02d\n", hour);
-    diag_printf("minute %02d\n", minute);
-    diag_printf("second %02d\n", second);
-#endif
-
-#ifndef CYGSEM_WALLCLOCK_SET_GET_MODE
-    // We know what we initialized the hardware for : 1970, so by doing this
-    // the returned time should be OK for 30 years uptime.
-    year += 1900;
-#else
-    // Need to use sliding window or similar to figure out what the
-    // century should be... Patent issue is unclear, and since there's
-    // no battery backup of the clock, there's little point in
-    // investigating.
-# error "Need some magic here to figure out century counter"
-#endif
-
-    cyg_uint32 now = _simple_mktime(year, month, mday, hour, minute, second);
-    return now;
-}
-
-#ifndef CYGSEM_WALLCLOCK_SET_GET_MODE
-
-void
-Cyg_WallClock::init_hw_seconds(void)
-{
-    // This is our base: 1970-01-01 00:00:00
-    // Set the HW clock - if for nothing else, just to be sure it's in a
-    // legal range. Any arbitrary base could be used.
-    // After this the hardware clock is only read.
-    set_sh3_hwclock(70,1,1,0,0,0);
-}
-
-#endif // CYGSEM_WALLCLOCK_SET_GET_MODE
-
-//-----------------------------------------------------------------------------
-// End of devs/wallclock/sh3.cxx
--- a/packages/ecos.db
+++ b/packages/ecos.db
@@ -597,6 +597,7 @@ package CYGPKG_DEVS_USB_SA11X0 {
         description     "A device driver for the SA11X0 on-chip USB slave port"
 }
 
+
 package CYGPKG_NET {
 	alias 		{ "Networking" net }
 	directory	net/tcpip
@@ -734,7 +735,7 @@ package CYGPKG_IO_WALLCLOCK {
 
 package CYGPKG_DEVICES_WALLCLOCK_SH3 {
 	alias		{ "Wallclock driver for SH3 RTC module" devices_wallclock_sh3 device_wallclock_sh3 }
-	directory	devs/wallclock/sh3
+	directory	devs/wallclock/sh/sh3
 	script          wallclock_sh3.cdl
 	hardware
         description "
@@ -752,6 +753,16 @@ package CYGPKG_DEVICES_WALLCLOCK_DALLAS_
            the Dallas 1742 wallclock."
 }
 
+package CYGPKG_DEVICES_WALLCLOCK_DALLAS_DS12887 {
+	alias		{ "Wallclock driver for Dallas 12887" devices_wallclock_ds12887 device_wallclock_ds12887 }
+	directory	devs/wallclock/dallas/ds12887
+	script          wallclock_ds12887.cdl
+	hardware
+        description "
+           This package provides a driver implementation for 
+           the Dallas 12887 wallclock."
+}
+
 package CYGPKG_DEVICES_WALLCLOCK_MIPS_REF4955 {
 	alias		{ "Wallclock driver for REF4955 board" devices_wallclock_ref4955 device_wallclock_ref4955 }
 	directory	devs/wallclock/mips/ref4955
@@ -761,7 +772,6 @@ package CYGPKG_DEVICES_WALLCLOCK_MIPS_RE
            This package provides a wallclock driver implementation for the
            Toshiba REF4955 board."
 }
-
 package CYGPKG_DEVICES_WATCHDOG_ARM_AEB {
 	alias		{ "Watchdog driver for ARM/AEB board" devices_watchdog_aeb device_watchdog_aeb }
 	directory	devs/watchdog/arm/aeb
@@ -850,6 +860,7 @@ package CYGPKG_COMPRESS_ZLIB {
 This package provides zlib compression and decompression support."
 }
 
+
 package CYGPKG_UITRON {
 	alias		{ "uITRON compatibility" uitron }
 	directory	compat/uitron
--- a/packages/fs/rom/current/ChangeLog
+++ b/packages/fs/rom/current/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-13  Richard Panton (richard.panton@3glab.com)
+
+	* support/mk_romfs.c: Convert between host FS file modes and eCos
+	ones.
+
 2000-10-25  Richard Panton (richard.panton@3glab.com)
 
 	* cdl/romfs.cdl:
--- a/packages/fs/rom/current/support/mk_romfs.c
+++ b/packages/fs/rom/current/support/mk_romfs.c
@@ -53,6 +53,7 @@
 #include <dirent.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <errno.h>
 
 //==========================================================================
 //
@@ -148,7 +149,7 @@ typedef struct romfs_disk {
 typedef struct node {
     const char *path;		// Filename (inc. path) of a link to this node
     size_t size;		// Size of file/directory/link
-    mode_t mode;		// Type and permissions
+    mode_t st_mode;		// Type and permissions
     uid_t uid;			// Owner id
     gid_t gid;			// Group id
     time_t ctime;		// File creation time
@@ -249,6 +250,28 @@ static void outputshort( unsigned char *
     }
 }
 
+static unsigned long ConvertMode( unsigned long posix_mode ) {
+    unsigned long result = 0;
+    if ( S_ISDIR( posix_mode ) ) result |= 1<<0;
+    if ( S_ISCHR( posix_mode ) ) result |= 1<<1;
+    if ( S_ISBLK( posix_mode ) ) result |= 1<<2;
+    if ( S_ISREG( posix_mode ) ) result |= 1<<3;
+    if ( S_ISFIFO(posix_mode ) ) result |= 1<<4;
+    // We cannot create MQ, SEM, or SHM entries here
+    if ( posix_mode & S_IRUSR )  result |= 1<<8;
+    if ( posix_mode & S_IWUSR )  result |= 1<<9;
+    if ( posix_mode & S_IXUSR )  result |= 1<<10;
+    if ( posix_mode & S_IRGRP )  result |= 1<<11;
+    if ( posix_mode & S_IWGRP )  result |= 1<<12;
+    if ( posix_mode & S_IXGRP )  result |= 1<<13;
+    if ( posix_mode & S_IROTH )  result |= 1<<14;
+    if ( posix_mode & S_IWOTH )  result |= 1<<15;
+    if ( posix_mode & S_IXOTH )  result |= 1<<16;
+    if ( posix_mode & S_ISUID )  result |= 1<<17;
+    if ( posix_mode & S_ISGID )  result |= 1<<18;
+    return result;
+}
+
 static const char *AddDirEntry( const char *name, node *parent_node, int node_num ) {
     int this_size = ((strlen(name) + 4 + 4 + 1) + 31) & ~31;
     int start = parent_node->size;
@@ -313,7 +336,7 @@ static node * GetNodeInfo( const char *p
     node->path = strdup( newpath );
     // We re-calculate the size for directories
     node->size = IS_DIRECTORY( stbuff.st_mode ) ? 0 : stbuff.st_size;
-    node->mode = stbuff.st_mode;
+    node->st_mode = stbuff.st_mode;
     node->uid = stbuff.st_uid;
     node->gid = stbuff.st_gid;
     node->ctime = stbuff.st_ctime;
@@ -374,7 +397,7 @@ static void ScanDirectory(node *mynode, 
     verb_printf(VERB_EXCESSIVE,"Completed '%s'. Checking for child directories...\n", mynode->path);
 
     for ( th = mynode->child ; th ; th = th->sibling ) {
-	if ( IS_DIRECTORY( th->mode ) ) {
+	if ( IS_DIRECTORY( th->st_mode ) ) {
 	    mynode->nlink++;
 	    ScanDirectory( th, mynode->nodenum );
 	}
@@ -385,7 +408,7 @@ static void AllocateSpaceToDirectories( 
     node *np;
 
     for ( np = first ; np ; np = np->sibling ) {
-	if ( IS_DIRECTORY( np->mode ) ) {
+	if ( IS_DIRECTORY( np->st_mode ) ) {
 	    // The first node is a directory. Add its data
 	    np->offset = coffset;
 	    np->entry_size = ALIGN_TO( np->size, DIRECTORY_ALIGN );
@@ -403,7 +426,7 @@ static void AllocateSpaceToDirectories( 
     
     // Now add any child directories
     for ( np = first ; np ; np = np->sibling ) {
-	if ( IS_DIRECTORY( np->mode ) && np->child )
+	if ( IS_DIRECTORY( np->st_mode ) && np->child )
 	    AllocateSpaceToDirectories( np->child );
     }
 }
@@ -417,7 +440,7 @@ static void AllocateSpaceToDataFiles( no
 
     // Search for child data files
     for ( np = first->child ; np ; np = np->sibling ) {
-	if ( IS_DATAFILE( np->mode ) || IS_SYMLINK( np->mode ) ) {
+	if ( IS_DATAFILE( np->st_mode ) || IS_SYMLINK( np->st_mode ) ) {
 	    np->offset = coffset;
 	    np->entry_size = ALIGN_TO( np->size, DATA_ALIGN );
 	    coffset += np->entry_size;
@@ -433,7 +456,7 @@ static void AllocateSpaceToDataFiles( no
 
     // Recurse into sub-directories
     for ( np = first->child ; np ; np = np->sibling ) {
-	if ( IS_DIRECTORY( np->mode ) ) {
+	if ( IS_DIRECTORY( np->st_mode ) ) {
 	    AllocateSpaceToDataFiles( np );
 	}
     }
@@ -446,7 +469,7 @@ static void AllocateSpaceToExecutables( 
 
     // Search for child executables
     for ( np = first->child ; np ; np = np->sibling ) {
-	if ( IS_EXECUTABLE( np->mode ) ) {
+	if ( IS_EXECUTABLE( np->st_mode ) ) {
 	    np->offset = coffset;
 	    np->entry_size = ALIGN_TO( np->size, EXEC_ALIGN );
 	    coffset += np->entry_size;
@@ -462,7 +485,7 @@ static void AllocateSpaceToExecutables( 
 
     // Recurse into sub-directories
     for ( np = first->child ; np ; np = np->sibling ) {
-	if ( IS_DIRECTORY( np->mode ) ) {
+	if ( IS_DIRECTORY( np->st_mode ) ) {
 	    AllocateSpaceToExecutables( np );
 	}
     }
@@ -471,7 +494,7 @@ static void AllocateSpaceToExecutables( 
 static void WriteNode( int fd, node *np ) {
     romfs_node anode;
     char padhere[9];
-    outputlong( (char*) &anode.mode, np->mode );
+    outputlong( (char*) &anode.mode, ConvertMode( np->st_mode ) );
     outputlong( (char*) &anode.nlink, np->nlink );
     outputshort((char*) &anode.uid, np->uid );
     outputshort((char*) &anode.gid, np->gid );
@@ -495,7 +518,7 @@ static int WriteNodeAndSiblings( int fd,
     }
 
     for ( np = first ; np ; np = np->sibling ) {
-	if ( IS_DIRECTORY( np->mode ) && np->child ) {
+	if ( IS_DIRECTORY( np->st_mode ) && np->child ) {
 	    nodenum = WriteNodeAndSiblings( fd, nodenum, np->child );
 	}
     }
@@ -524,7 +547,7 @@ static void WriteData( int fd, node *np 
     int ffd;
     unsigned long todo;
 
-    if ( IS_SYMLINK( np->mode ) ) {
+    if ( IS_SYMLINK( np->st_mode ) ) {
 	if ( (ffd = readlink( np->path, newpath, sizeof(newpath) )) < 0 )
 	    fatal_error(EXIT_FILESYS, "Error reading symlink \"%s\": %s\n", np->path, strerror(errno) );
 
@@ -569,7 +592,7 @@ static void WriteDataBlocks( int fd, nod
     for ( ; first ; first = first->next_in_rom ) {
 	if ( dowrite && lseek( fd, first->offset, SEEK_SET ) != first->offset )
 	    fatal_error(EXIT_SEEK, "Error seeking to offset 0x%lX: %s\n", first->offset, strerror(errno) );
-	if ( IS_DIRECTORY( first->mode ) ) {
+	if ( IS_DIRECTORY( first->st_mode ) ) {
 	    if ( dowrite && write( fd, first->entry, first->size ) != first->size )
 		fatal_error(EXIT_WRITE, "Write error: %s\n", strerror(errno) );
 	} else {
--- a/packages/hal/arm/arch/current/ChangeLog
+++ b/packages/hal/arm/arch/current/ChangeLog
@@ -1,3 +1,12 @@
+2001-07-17  Jonathan Larmour  <jlarmour@redhat.com>
+
+	* include/hal_intr.h: Define range of exceptions more accurately.
+
+2001-07-16  Gary Thomas  <gthomas@redhat.com>
+
+	* src/hal_misc.c (exception_handler): Allow memory faults to be
+	caught, even when GDB stubs are not included.
+
 2001-06-22  Gary Thomas  <gthomas@redhat.com>
 
 	* include/arm_stub.h (NUMREGBYTES): Define - this tells GDB how 
--- a/packages/hal/arm/arch/current/include/hal_intr.h
+++ b/packages/hal/arm/arch/current/include/hal_intr.h
@@ -98,10 +98,9 @@
           CYGNUM_HAL_VECTOR_SOFTWARE_INTERRUPT
 #define CYGNUM_HAL_EXCEPTION_CODE_ACCESS    CYGNUM_HAL_VECTOR_ABORT_PREFETCH
 #define CYGNUM_HAL_EXCEPTION_DATA_ACCESS    CYGNUM_HAL_VECTOR_ABORT_DATA
-#define CYGNUM_HAL_EXCEPTION_FIQ            CYGNUM_HAL_VECTOR_FIQ
 
 #define CYGNUM_HAL_EXCEPTION_MIN     CYGNUM_HAL_EXCEPTION_ILLEGAL_INSTRUCTION
-#define CYGNUM_HAL_EXCEPTION_MAX     CYGNUM_HAL_EXCEPTION_FIQ
+#define CYGNUM_HAL_EXCEPTION_MAX     CYGNUM_HAL_EXCEPTION_DATA_ACCESS
 #define CYGNUM_HAL_EXCEPTION_COUNT   (CYGNUM_HAL_EXCEPTION_MAX - \
                                       CYGNUM_HAL_EXCEPTION_MIN + 1)
 
--- a/packages/hal/arm/arch/current/src/hal_misc.c
+++ b/packages/hal/arm/arch/current/src/hal_misc.c
@@ -66,7 +66,11 @@ externC void diag_printf(const char *fmt
 externC void __handle_exception (void);
 
 externC HAL_SavedRegisters *_hal_registers;
-externC void* volatile __mem_fault_handler;
+#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
+// Historical - this datum is defined by the GDB stubs if present
+externC 
+#endif
+        void* volatile __mem_fault_handler;
 
 #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
 /* Force exception handling into the GDB stubs.  This is done by taking over
@@ -108,13 +112,18 @@ static void
 void
 exception_handler(HAL_SavedRegisters *regs)
 {
-#if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) && !defined(CYGPKG_CYGMON)
+    // Special case handler for code which has chosen to take care
+    // of data exceptions (i.e. code which expects them to happen)
+    // This is common in discovery code, e.g. checking for a particular
+    // device which may generate an exception when probing if the
+    // device is not present
     if (__mem_fault_handler && 
         regs->vector == CYGNUM_HAL_EXCEPTION_DATA_ACCESS) {
         regs->pc = (unsigned long)__mem_fault_handler;
         return; // Caught an exception inside stubs        
     }
 
+#if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) && !defined(CYGPKG_CYGMON)
     if (++exception_level == 1) __take_over_debug_traps();
 
     _hal_registers = regs;
@@ -165,7 +174,6 @@ extern pfunc __CTOR_END__[];
 void
 cyg_hal_invoke_constructors (void)
 {
-
 #ifdef CYGSEM_HAL_STOP_CONSTRUCTORS_ON_FLAG
     static pfunc *p = &__CTOR_END__[-1];
     
--- a/packages/hal/i386/arch/current/ChangeLog
+++ b/packages/hal/i386/arch/current/ChangeLog
@@ -1,3 +1,13 @@
+2001-07-13  Nick Garnett  <nickg@redhat.com>
+
+	* include/arch.inc:
+	Added code to clear CR0:TS bit in hal_fpu_init macro. If this bit
+	is not clear, then the following finit might trap, and we don't
+	want that.
+	Added a compare to hal_fpu_push_exc macro for a zero fpu state
+	owner. The code was assuming the move set the condition codes,
+	which it doesn't.
+
 2001-07-08  Jonathan Larmour  <jlarmour@redhat.com>
 
 	* include/hal_arch.h (HAL_THREAD_INIT_FPU_CONTEXT): Fix indirection to
@@ -296,12 +306,10 @@ 2000-02-10  Nick Garnett  <nickg@cygnus.
 
 	* src/vectors.S: Added PC support code.
 
-start-sanitize-net	
 2000-01-28  Gary Thomas  <gthomas@cygnus.co.uk>
 
 	* src/i386.ld: Add support for network package.
 
-end-sanitize-net	
 2000-01-21  Jesper Skov  <jskov@cygnus.co.uk>
 
 	* include/hal_intr.h (HAL_INTERRUPT_MASK, HAL_INTERRUPT_UNMASK): 
--- a/packages/hal/i386/arch/current/cdl/hal_i386.cdl
+++ b/packages/hal/i386/arch/current/cdl/hal_i386.cdl
@@ -120,7 +120,7 @@ cdl_package CYGPKG_HAL_I386 {
 	cdl_option CYGHWR_HAL_I386_FPU_SWITCH_LAZY {
 	    display       "Use lazy FPU state switching"
 	    flavor        bool
-	    default_value 0
+	    default_value 1
 
 	    description "
 	                This option enables lazy FPU state switching.
--- a/packages/hal/i386/arch/current/include/arch.inc
+++ b/packages/hal/i386/arch/current/include/arch.inc
@@ -91,7 +91,8 @@
 	.macro	hal_fpu_init
 	# Tell the CPU to use the math hardware.
 	movl	%cr0, %eax
-	orl	$0x32, %eax
+	orl	$0x32, %eax	# Set MP, ET, NE bits
+	andl	$~0x8, %eax	# And clear TS bit
 	movl	%eax, %cr0
 
 	finit			# and initialize...
@@ -278,7 +279,8 @@ 1:
 	.macro	hal_fpu_push_exc
 	pushl	cyg_hal_fpustate_current	# push our FPU state ptr
 	movl	cyg_hal_fpustate_owner,%eax	# EAX = FPU state owner
-	jz	1f				# skip if zero
+	cmpl	$0,%eax				# test it
+	je	1f				# skip if zero
 	fsave	i386reg_fpucontext_state(%eax)	# save state
 	movl	$1,i386reg_fpucontext_valid(%eax) # set valid
 	movl	$0,cyg_hal_fpustate_owner	# zero owner pointer
--- a/packages/hal/i386/generic/current/cdl/hal_i386_generic.cdl
+++ b/packages/hal/i386/generic/current/cdl/hal_i386_generic.cdl
@@ -41,13 +41,13 @@
 # ====================================================================
 
 cdl_package CYGPKG_HAL_I386_GENERIC {
-    display  "i386 PC target"
+    display       "i386 generic target"
     parent        CYGPKG_HAL_I386
     define_header hal_i386_generic.h
     include_dir   cyg/hal
     description   "
     This package provides support for generic IA32 CPU variants.
-    Any CPU from a80386 to the latest Pentium/Athlon should work
+    Any CPU from an 80386 to the latest Pentium/Athlon should work
     with this variant HAL. Essentially this variant is empty, it
     just avoids providing any configuration to the generic architecture
     support in the architecture HAL."
--- a/packages/hal/i386/pc/current/ChangeLog
+++ b/packages/hal/i386/pc/current/ChangeLog
@@ -1,3 +1,9 @@
+2001-07-13  Nick Garnett  <nickg@redhat.com>
+
+	* cdl/hal_i386_pc.cdl: Added requires statement to
+	CYGSEM_HAL_ROM_MONITOR option to turn off lazy FPU switching. ROM
+	monitors should not be playing these kinds of games.
+
 2001-05-22  Jonathan Larmour  <jlarmour@redhat.com>
 
 	* include/pkgconf/mlt_i386_pc_ram.mlt: Fix pci_window description.
--- a/packages/hal/i386/pc/current/cdl/hal_i386_pc.cdl
+++ b/packages/hal/i386/pc/current/cdl/hal_i386_pc.cdl
@@ -256,6 +256,7 @@ cdl_package CYGPKG_HAL_I386_PC {
 	
         parent        CYGPKG_HAL_ROM_MONITOR
         requires      { CYG_HAL_STARTUP == "FLOPPY" || CYG_HAL_STARTUP == "ROM" }
+	requires      { !CYGHWR_HAL_I386_FPU_SWITCH_LAZY }
         description   "
             Enable this option if this program is to be used as a ROM monitor,
             i.e. applications will be loaded into RAM on the board, and this
--- a/packages/hal/mips/arch/current/ChangeLog
+++ b/packages/hal/mips/arch/current/ChangeLog
@@ -1,3 +1,18 @@
+2001-07-17  David Woodhouse <dwmw2@redhat.com>
+
+	* src/redboot_linux_exec.c: Add environment stuff to the 'exec' 
+	command, also make it use the entry point from the last 'load' 
+	command if there is one.
+	Also add '-w' delay option.
+
+2001-07-09  David Woodhouse <dwmw2@redhat.com>
+
+	* src/redboot_linux_exec.c: New 'exec' command for RedBoot, mostly
+	copied from the SH version, hacked to pass arguments in argc/argv
+	form as that seems to be what most Linux/MIPS kernels expect to
+	receive from PMON.
+	* cdl/hal_mips.cdl: Add necessary magic for the above.
+	
 2001-07-03  Hugo Tyson  <hmt@redhat.com>
 
 	* src/vectors.S (restore_state): When restoring the CPU status
--- a/packages/hal/mips/arch/current/cdl/hal_mips.cdl
+++ b/packages/hal/mips/arch/current/cdl/hal_mips.cdl
@@ -115,4 +115,42 @@ cdl_package CYGPKG_HAL_MIPS {
 	been compiled as 32-bit.  Do not use this for real 64-bit code."
     }
 
+    cdl_component CYGPKG_REDBOOT_MIPS_OPTIONS {
+        display       "Redboot for MIPS 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_component CYGSEM_REDBOOT_MIPS_LINUX_BOOT {
+            display        "Support booting Linux via RedBoot"
+            flavor         bool
+            default_value  1
+            description    "
+               This option enables RedBoot to support booting of a Linux kernel."
+            compile -library=libextras.a redboot_linux_exec.c
+
+            cdl_option CYGDAT_REDBOOT_MIPS_LINUX_BOOT_ENTRY {
+                display        "Default kernel entry address"
+                flavor         data
+                default_value  0x80100750
+            }
+
+            cdl_option CYGDAT_REDBOOT_MIPS_LINUX_BOOT_ARGV_ADDR {
+                display        "Default argv address"
+                flavor         data
+                default_value  0x80080000
+            }
+
+            cdl_option CYGDAT_REDBOOT_MIPS_LINUX_BOOT_COMMAND_LINE {
+                display        "Default COMMAND_LINE"
+                flavor         data
+                default_value  { "" }
+            }
+        }
+    }
+
 }
new file mode 100644
--- /dev/null
+++ b/packages/hal/mips/arch/current/src/redboot_linux_exec.c
@@ -0,0 +1,161 @@
+//==========================================================================
+//
+//      redboot_linux_exec.c
+//
+//      RedBoot exec command for Linux booting
+//
+//==========================================================================
+//####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, 2001 Red Hat, Inc.
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):    t@keshi.org
+// Contributors: t@keshi.org, jskov, dwmw2
+// Date:         2001-07-09
+// Purpose:      RedBoot exec command for Linux booting
+//
+//####DESCRIPTIONEND####
+//
+//===========================================================================
+
+#include <redboot.h>
+
+#include <cyg/infra/cyg_type.h>
+#include <cyg/hal/hal_intr.h>
+#include <cyg/hal/hal_cache.h>
+
+#define xstr(s) str(s)
+#define str(s...) #s
+
+typedef struct
+{
+	char *name;
+	char *val;
+} t_env_var;
+
+struct parmblock {
+	t_env_var memsize;
+	t_env_var modetty0;
+	t_env_var ethaddr;
+	t_env_var env_end;
+	char *argv[2];
+	char text[0];
+};
+
+static void do_exec(int argc, char *argv[]);
+RedBoot_cmd("exec", 
+            "Execute an image", 
+            "[-b <argv addr>] [-c \"kernel command line\"] [-w <timeout>]\n"
+	    "        [<entry point>]",
+            do_exec
+    );
+
+static void 
+do_exec(int argc, char *argv[])
+{
+    cyg_uint32 entry = (cyg_uint32)entry_address?:CYGDAT_REDBOOT_MIPS_LINUX_BOOT_ENTRY;
+    cyg_uint32 base_addr = CYGDAT_REDBOOT_MIPS_LINUX_BOOT_ARGV_ADDR;
+    char *cmd_line = xstr(CYGDAT_REDBOOT_MIPS_LINUX_BOOT_COMMAND_LINE);
+    bool base_addr_set, cmd_line_set, wait_time_set;
+    int wait_time, res;
+    char line[8];
+    
+    struct option_info opts[3];
+    char *pcmd;
+    struct parmblock *pb;
+    void (*linux)(int, char **, void *);
+    int oldints;
+
+    init_opts(&opts[0], 'b', true, OPTION_ARG_TYPE_NUM, 
+              (void **)&base_addr, &base_addr_set, "base address");
+    init_opts(&opts[1], 'w', true, OPTION_ARG_TYPE_NUM, 
+              (void **)&wait_time, (bool *)&wait_time_set, "wait timeout");
+    init_opts(&opts[2], 'c', true, OPTION_ARG_TYPE_STR, 
+              (void **)&cmd_line, &cmd_line_set, "kernel command line");
+    
+    if (!scan_opts(argc, argv, 1, opts, 3, (void *)&entry, 
+                   OPTION_ARG_TYPE_NUM, "entry address"))
+        return;
+
+    linux = (void *)entry;
+
+    printf("Now booting linux kernel:\n");
+    printf(" Base address 0x%08x Entry 0x%08x\n", base_addr, entry);
+    printf(" Cmdline : %s\n", cmd_line);
+
+    if (wait_time_set) {
+        printf("About to start execution at %p - abort with ^C within %d seconds\n",
+               (void *)entry, wait_time);
+        res = gets(line, sizeof(line), wait_time*1000);
+        if (res == _GETS_CTRLC) {
+            return;
+        }
+    }
+    
+    HAL_DISABLE_INTERRUPTS(oldints);
+
+    pb = (struct parmblock *)base_addr;
+    pcmd = pb->text;
+
+    pb->memsize.name = pcmd;
+    pcmd += sprintf(pcmd, "memsize");
+    pb->memsize.val = ++pcmd;
+    pcmd += sprintf(pcmd, "0x%08x", (ram_end - ram_start + 0xFFFFF) & ~0xFFFFF);
+
+    pb->modetty0.name = ++pcmd;
+    pcmd += sprintf(pcmd, "modetty0");
+    pb->modetty0.val = ++pcmd;
+    pcmd += sprintf(pcmd, "%d,n,8,1,hw", CYGNUM_HAL_VIRTUAL_VECTOR_CHANNELS_DEFAULT_BAUD);
+
+#ifdef CYGPKG_REDBOOT_NETWORKING
+    pb->ethaddr.name = ++pcmd;
+    pcmd += sprintf(pcmd, "ethaddr");
+    pb->ethaddr.val = ++pcmd;
+    pcmd += sprintf(pcmd, "%02x.%02x.%02x.%02x.%02x.%02x",
+            __local_enet_addr[0], __local_enet_addr[1],
+            __local_enet_addr[2], __local_enet_addr[3],
+            __local_enet_addr[4], __local_enet_addr[5]);
+    pb->env_end.name = NULL;
+    pb->env_end.val = NULL;
+#else
+    pb->ethaddr.name = NULL;
+    pb->ethaddr.val = NULL;
+#endif
+
+    /* Point argv[0] at a handy `\0` */
+    pb->argv[0] = pcmd;
+    pb->argv[1] = ++pcmd;
+    
+    strcpy(pcmd, cmd_line);
+    
+    HAL_DCACHE_SYNC();
+    HAL_ICACHE_DISABLE();
+    HAL_DCACHE_DISABLE();
+    HAL_DCACHE_SYNC();
+    HAL_ICACHE_INVALIDATE_ALL();
+    HAL_DCACHE_INVALIDATE_ALL();
+
+    linux(2, pb->argv, pb);
+}
--- a/packages/hal/sh/arch/current/ChangeLog
+++ b/packages/hal/sh/arch/current/ChangeLog
@@ -1,3 +1,7 @@
+2001-07-09  Jesper Skov  <jskov@redhat.com>
+
+	* src/sh_stub.c: Fixed potential SH4 problem in UBC handling.
+
 2001-07-02  Jesper Skov  <jskov@redhat.com>
 
 	* include/hal_arch.h: CYGARC_PHYSICAL_ADDRESS renamed to
--- a/packages/hal/sh/arch/current/src/sh_stub.c
+++ b/packages/hal/sh/arch/current/src/sh_stub.c
@@ -23,7 +23,7 @@
 //                                                                          
 // The Initial Developer of the Original Code is Red Hat.                   
 // Portions created by Red Hat are                                          
-// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
 // All Rights Reserved.                                                     
 // -------------------------------------------                              
 //                                                                          
@@ -147,6 +147,12 @@ void __single_step (void)
     HAL_WRITE_UINT16(CYGARC_REG_BBRA, 
                      CYGARC_REG_BBRA_IFETCH|CYGARC_REG_BBRA_READ);
 #endif
+
+#ifdef CYGPKG_HAL_SH_SH4
+    // Must execute at least 11 instructions before reaching
+    // any address that may be affected by the UBC settings.
+    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;");
+#endif
 }
 
 /* Clear the single-step state. */
@@ -157,6 +163,12 @@ void __clear_single_step (void)
     HAL_WRITE_UINT16(CYGARC_REG_BBRA, 0);
     // Clear status flags
     HAL_WRITE_UINT16(CYGARC_REG_BRCR, 0);
+
+#ifdef CYGPKG_HAL_SH_SH4
+    // Must execute at least 11 instructions before reaching
+    // any address that may be affected by the UBC settings.
+    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;");
+#endif
 }
 
 #else // CYGARC_SH_MOD_UBC
--- a/packages/hal/sh/cq7750/current/ChangeLog
+++ b/packages/hal/sh/cq7750/current/ChangeLog
@@ -1,3 +1,12 @@
+2001-07-13  Jesper Skov  <jskov@redhat.com>
+
+	* include/platform.inc (BSC_settings_table): Replaced
+	CYGARC_REG_SDMR2 with the value specific to the board.
+
+2001-07-09  Jesper Skov  <jskov@redhat.com>
+
+	* cdl/hal_sh_sh7750_cq7750.cdl: Option description tweaks.
+
 2001-05-29  Jesper Skov  <jskov@redhat.com>
 
 	* include/plf_io.h: Added.
--- a/packages/hal/sh/cq7750/current/cdl/hal_sh_sh7750_cq7750.cdl
+++ b/packages/hal/sh/cq7750/current/cdl/hal_sh_sh7750_cq7750.cdl
@@ -130,20 +130,14 @@ cdl_package CYGPKG_HAL_SH_SH7750_CQ7750 
                 other clocks are derived from."
         }
 
-        cdl_option CYGHWR_HAL_SH_OOC_CKIO {
-            display          "SH clock CKIO output enable"
-            default_value    1
-            description      "
-                This selects whether CKIO output is enabled."
-        }
-
         cdl_option CYGHWR_HAL_SH_OOC_PLL_1 {
             display          "SH clock PLL circuit 1"
             flavor           data
             default_value    6
             legal_values     { 0 6 }
             description      "
-                This selects whether PLL1 is enabled."
+                This selects the multiplication factor provided by
+                PLL1."
         }
 
         cdl_option CYGHWR_HAL_SH_OOC_PLL_2 {
@@ -152,20 +146,22 @@ cdl_package CYGPKG_HAL_SH_SH7750_CQ7750 
             default_value    1
             legal_values     { 0 1 }
             description      "
-                This selects whether PLL2 is enabled."
+                This selects the multiplication factor provided by
+                PLL2. If PLL2 is disabled this option should
+                be set to zero."
         }
 
         cdl_option CYGHWR_HAL_SH_OOC_DIVIDER_IFC {
-            display          "SH clock divider, core"
+            display          "SH CPU clock divider"
             flavor           data
             default_value    1
             legal_values     { 1 2 3 4 6 8 }
             description      "
-                This divider option affects the CPU core clock."
+                This divider option affects the CPU clock."
         }
 
         cdl_option CYGHWR_HAL_SH_OOC_DIVIDER_BFC {
-            display          "SH clock divider, bus"
+            display          "SH bus clock divider"
             flavor           data
             default_value    3
             legal_values     { 1 2 3 4 6 8 }
@@ -174,7 +170,7 @@ cdl_package CYGPKG_HAL_SH_SH7750_CQ7750 
         }
 
         cdl_option CYGHWR_HAL_SH_OOC_DIVIDER_PFC {
-            display          "SH clock divider, peripheral"
+            display          "SH peripheral clock divider"
             flavor           data
             default_value    6
             legal_values     { 1 2 3 4 6 8 }
--- a/packages/hal/sh/cq7750/current/include/platform.inc
+++ b/packages/hal/sh/cq7750/current/include/platform.inc
@@ -135,7 +135,7 @@ BSC_settings_table:
         .long   0x10192194
         .long   2
         # SDMR2:
-        .long   CYGARC_REG_SDMR2
+        .long   0xFF90008c
         .long   0xaa
         .long   0
         # MCR:
@@ -143,7 +143,7 @@ BSC_settings_table:
         .long   0x50192194
         .long   2
         # SDMR2:
-        .long   CYGARC_REG_SDMR2
+        .long   0xFF90008c
         .long   0xaa
         .long   0
         # Table end
--- a/packages/hal/sh/sh4/current/ChangeLog
+++ b/packages/hal/sh/sh4/current/ChangeLog
@@ -1,3 +1,53 @@
+2001-07-17  Jesper Skov  <jskov@redhat.com>
+
+	* cdl/hal_sh_sh4.cdl: Allow caching.
+
+	* include/mod_regs_intc.h (CYGARC_REG_ICR_INIT): Revert
+	CYGHWR_HAL_SH_IRQ_USE_IRQLVL sense.
+
+	* include/variant.inc: Fix alignment bug.
+
+	* include/mod_regs_ubc.h: Compile when UBC disabled.
+
+2001-07-16  Jesper Skov  <jskov@redhat.com>
+
+	* src/var_misc.c (hal_interrupt_update_level): Fix typo.
+
+	* include/variant.inc: Added ICR initialization.
+
+	* include/mod_regs_intc.h: Added ICR definitions.
+
+	* cdl/hal_sh_sh4.cdl: Interrupt option cleanup.
+
+	* include/mod_regs_bsc.h: Added some BCR1 and MCR register bit
+	definitions. Deleted wrong register definitions.
+
+	* src/pcic.c (cyg_hal_sh_pcic_pci_init): Set PCIC MCR
+	register. Set BCR1 master flag. Set PCI cache line size.
+
+2001-07-13  Jesper Skov  <jskov@redhat.com>
+
+	* include/mod_regs_bsc.h: Removed SDMR2 definition - it is
+	platform specific.
+
+2001-07-10  Jesper Skov  <jskov@redhat.com>
+
+	* include/mod_7750.h: define intc macro.
+
+2001-07-09  Jesper Skov  <jskov@redhat.com>
+
+	* include/mod_regs_ubc.h: Ignore ASID when stepping.
+
+	* include/mod_7750.h: Fix DCAC address top.
+
+	* src/variant.S: Let all cache functions delay for 8 nops before
+	returning.
+
+	* include/mod_regs_bsc.h: Added more registers.
+
+	* cdl/hal_sh_sh4.cdl: Tweak options, add options for interrupts
+	and cache settings.
+
 2001-05-29  Jesper Skov  <jskov@redhat.com>
 
 	* include/var_io.h: Added. Includes plf_io.h
@@ -94,7 +144,7 @@ 2000-04-18  Ryozaburo Suzuki  <ryos@atom
 //                                                                          
 // The Initial Developer of the Original Code is Red Hat.                   
 // Portions created by Red Hat are                                          
-// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
 // All Rights Reserved.                                                     
 // -------------------------------------------                              
 //                                                                          
--- a/packages/hal/sh/sh4/current/cdl/hal_sh_sh4.cdl
+++ b/packages/hal/sh/sh4/current/cdl/hal_sh_sh4.cdl
@@ -23,7 +23,7 @@
 #                                                                          
 # The Initial Developer of the Original Code is Red Hat.                   
 # Portions created by Red Hat are                                          
-# Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+# Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
 # All Rights Reserved.                                                     
 # -------------------------------------------                              
 #                                                                          
@@ -44,9 +44,6 @@ 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
@@ -80,6 +77,7 @@ cdl_package CYGPKG_HAL_SH_SH4 {
         display       "SH 7750 microprocessor"
         parent        CYGPKG_HAL_SH_CPU
         implements    CYGINT_HAL_SH_VARIANT
+        implements    CYGINT_HAL_SH_CPG_T1
         default_value 0
         no_define
         define        -file=system.h CYGPKG_HAL_SH_7750
@@ -102,6 +100,10 @@ cdl_package CYGPKG_HAL_SH_SH4 {
         flavor        none
         no_define
 
+        cdl_interface CYGINT_HAL_SH_CPG_T1 {
+            display     "Clock pulse generator type 1"
+        }
+
         cdl_option CYGHWR_HAL_SH_TMU_PRESCALE_0 {
             display       "TMU counter 0 prescaling"
             description   "
@@ -112,11 +114,28 @@ cdl_package CYGPKG_HAL_SH_SH4 {
             default_value 4
         }
 
+        cdl_option CYGHWR_HAL_SH_CLOCK_CKIO {
+            display    "CKIO clock"
+            no_define
+            flavor     data
+            calculated { CYGHWR_HAL_SH_PLL2_OUTPUT }
+        }
+
         cdl_option CYGHWR_HAL_SH_PLL1_OUTPUT {
             display    "The clock output from PLL1"
             no_define
             flavor     data
-            calculated { CYGHWR_HAL_SH_OOC_XTAL * CYGHWR_HAL_SH_OOC_PLL_1 }
+            calculated { CYGHWR_HAL_SH_DIVIDER1_OUTPUT * CYGHWR_HAL_SH_OOC_PLL_1 }
+        }
+
+        cdl_option CYGHWR_HAL_SH_DIVIDER1_OUTPUT {
+            display    "The clock output from divider 1"
+            no_define
+            flavor     data
+            # DIV1 output is either 1 or 1/2 XTAL
+            calculated { (CYGHWR_HAL_SH_OOC_DIVIDER_1 == 1)
+                           ? CYGHWR_HAL_SH_OOC_XTAL
+                           : CYGHWR_HAL_SH_OOC_XTAL / 2 }
         }
 
         cdl_option CYGHWR_HAL_SH_PROCESSOR_SPEED {
@@ -124,8 +143,8 @@ cdl_package CYGPKG_HAL_SH_SH4 {
             flavor           data
             calculated       { CYGHWR_HAL_SH_PLL1_OUTPUT / CYGHWR_HAL_SH_OOC_DIVIDER_IFC }
             description      "
-                The core (CPU, cache and MMU) speed is computed from
-                the input clock speed and the IFC divider setting."
+                The peripheral speed is computed from the PLL2 output clock
+                speed and the IFC divider settings."
         }
 
         cdl_option CYGHWR_HAL_SH_BOARD_SPEED {
@@ -133,8 +152,8 @@ cdl_package CYGPKG_HAL_SH_SH4 {
             flavor           data
             calculated       { CYGHWR_HAL_SH_PLL1_OUTPUT / CYGHWR_HAL_SH_OOC_DIVIDER_BFC }
             description      "
-                The bus speed is computed from
-                the input clock speed and the BFC divider setting."
+                The peripheral speed is computed from the PLL2 output clock
+                speed and the BFC divider settings."
         }
 
         cdl_option CYGHWR_HAL_SH_ONCHIP_PERIPHERAL_SPEED {
@@ -142,8 +161,8 @@ cdl_package CYGPKG_HAL_SH_SH4 {
             flavor           data
             calculated       { CYGHWR_HAL_SH_PLL1_OUTPUT / CYGHWR_HAL_SH_OOC_DIVIDER_PFC }
             description      "
-                The peripheral speed is computed from the input clock
-                speed and the PFC divider setting."
+                The peripheral speed is computed from the PLL2 output clock
+                speed and the PFC divider settings."
         }
     }
 
@@ -157,4 +176,53 @@ cdl_package CYGPKG_HAL_SH_SH4 {
            This controls the default baud rate used for communicating
            with GDB / displaying diagnostic output."
     }
+
+    cdl_component CYGPKG_HAL_SH_INTERRUPT {
+        display          "Interrupt controls"
+        flavor     none
+        no_define
+        description      "
+            Initial interrupt settings can be specified using these option."
+
+        cdl_option CYGHWR_HAL_SH_IRQ_USE_IRQLVL {
+            display          "Use IRL0-3 pins as IRL input"
+            default_value    0
+            description      "
+                It is possible for the IRL0-3 pins to be used as IRL
+                inputs by enabling this option."
+        }
+    }
+
+    # Cache settings
+    cdl_option CYGHWR_HAL_SH_CACHE_MODE_P0 {
+        display       "Select cache mode set for P0/U0/P3 at startup"
+        parent        CYGPKG_HAL_SH_CACHE
+        default_value { "WRITE_BACK" }
+        legal_values  { "WRITE_BACK" "WRITE_THROUGH" }
+        flavor        data
+        description "
+            Controls what cache mode the cache should be put in at
+            startup for areas P0, U0 and P3. Write-back mode improves
+            performance by letting dirty data to be kept in the
+            cache for a period of time, allowing mutiple writes to
+            the same cache line to be written back to memory in
+            one memory transaction. In Write-through mode, each
+            individual write will cause a memory transaction."
+    }
+    
+    cdl_option CYGHWR_HAL_SH_CACHE_MODE_P1 {
+        display       "Select cache mode set for P1 at startup"
+        parent        CYGPKG_HAL_SH_CACHE
+        default_value { "WRITE_BACK" }
+        legal_values  { "WRITE_BACK" "WRITE_THROUGH" }
+        flavor        data
+        description "
+            Controls what cache mode the cache should be put in at
+            startup for area P1. Write-back mode improves
+            performance by letting dirty data to be kept in the
+            cache for a period of time, allowing mutiple writes to
+            the same cache line to be written back to memory in
+            one memory transaction. In Write-through mode, each
+            individual write will cause a memory transaction."
+    }
 }
--- a/packages/hal/sh/sh4/current/include/mod_7750.h
+++ b/packages/hal/sh/sh4/current/include/mod_7750.h
@@ -51,6 +51,7 @@
 #define CYGARC_SH_MOD_CPG  1
 #define CYGARC_SH_MOD_SCIF 1
 #define CYGARC_SH_MOD_UBC  1
+#define CYGARC_SH_MOD_INTC 1
 
 
 //-----------------------------------------------------------------------------
@@ -83,7 +84,7 @@
 // Cache addressing information
 // entry: bits 13 -  5
 #define CYGARC_SH_MOD_DCAC_ADDRESS_BASE   0xf4000000
-#define CYGARC_SH_MOD_DCAC_ADDRESS_TOP    0xf0004000
+#define CYGARC_SH_MOD_DCAC_ADDRESS_TOP    0xf4004000
 #define CYGARC_SH_MOD_DCAC_ADDRESS_STEP   0x00000020
 // U : bit 1
 // V : bit 0
--- a/packages/hal/sh/sh4/current/include/mod_regs_bsc.h
+++ b/packages/hal/sh/sh4/current/include/mod_regs_bsc.h
@@ -23,7 +23,7 @@
 //                                                                          
 // The Initial Developer of the Original Code is Red Hat.                   
 // Portions created by Red Hat are                                          
-// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
 // All Rights Reserved.                                                     
 // -------------------------------------------                              
 //                                                                          
@@ -53,99 +53,24 @@
 #define CYGARC_REG_RTCOR                0xFF800024
 #define CYGARC_REG_RFCR                 0xFF800028
 
-#define CYGARC_REG_SDMR2                0xFF90008c
+#define CYGARC_REG_PCTRA                0xFF80002c
+#define CYGARC_REG_PDTRA                0xFF800030
+#define CYGARC_REG_PCTRB                0xFF800040
+#define CYGARC_REG_PDTRB                0xFF800044
+#define CYGARC_REG_GPIOIC               0xFF800048
 
 #define CYGARC_REG_SDMR_AREA2_BASE      0xff900000
 #define CYGARC_REG_SDMR_AREA3_BASE      0xff940000
 
-#define CYGARC_REG_BCR1_DRAMTP2         0x0010
-#define CYGARC_REG_BCR1_DRAMTP1         0x0008
-#define CYGARC_REG_BCR1_DRAMTP0         0x0004
-
-// Bus widths for areas
-#define CYGARC_REG_BCR2_A6_8            0x1000
-#define CYGARC_REG_BCR2_A6_16           0x2000
-#define CYGARC_REG_BCR2_A6_32           0x3000
-#define CYGARC_REG_BCR2_A5_8            0x0400
-#define CYGARC_REG_BCR2_A5_16           0x0800
-#define CYGARC_REG_BCR2_A5_32           0x0c00
-#define CYGARC_REG_BCR2_A4_8            0x0100
-#define CYGARC_REG_BCR2_A4_16           0x0200
-#define CYGARC_REG_BCR2_A4_32           0x0300
-#define CYGARC_REG_BCR2_A3_8            0x0040
-#define CYGARC_REG_BCR2_A3_16           0x0080
-#define CYGARC_REG_BCR2_A3_32           0x00c0
-#define CYGARC_REG_BCR2_A2_8            0x0010
-#define CYGARC_REG_BCR2_A2_16           0x0020
-#define CYGARC_REG_BCR2_A2_32           0x0030
-
-// Memory type selection and other IO behavior controls
-#define CYGARC_REG_BCR1_PULA            0x8000 // Pin A25 to A0 Pull-Up
-#define CYGARC_REG_BCR1_PULD            0x4000 // Pin D31 to D0 Pull-Up
-#define CYGARC_REG_BCR1_HIZMEM          0x2000 // Hi-Z memory control
-#define CYGARC_REG_BCR1_HIZCNT          0x1000 // High-Z Control
-#define CYGARC_REG_BCR1_ENDIAN          0x0800 // Endian Flag
-#define CYGARC_REG_BCR1_A0_BST_MASK     0x0600 // Area 0 Burst ROM Control
-#define CYGARC_REG_BCR1_A0_BST_4        0x0200
-#define CYGARC_REG_BCR1_A0_BST_8        0x0400
-#define CYGARC_REG_BCR1_A0_BST_16       0x0600
-#define CYGARC_REG_BCR1_A5_BST_MASK     0x0180 // Area 5 Burst ROM Control
-#define CYGARC_REG_BCR1_A5_BST_4        0x0080
-#define CYGARC_REG_BCR1_A5_BST_8        0x0100
-#define CYGARC_REG_BCR1_A5_BST_16       0x0180
-#define CYGARC_REG_BCR1_A6_BST_MASK     0x0060 // Area 6 Burst ROM Control
-#define CYGARC_REG_BCR1_A6_BST_4        0x0020
-#define CYGARC_REG_BCR1_A6_BST_8        0x0040
-#define CYGARC_REG_BCR1_A6_BST_16       0x0060
-#define CYGARC_REG_BCR1_DRAMTP_MASK     0x001c // Area 2, Area 3 Memory Type
-#define CYGARC_REG_BCR1_A5PCM           0x0002 // Area 5 Bus Type
-#define CYGARC_REG_BCR1_A6PCM           0x0001 // Area 6 Bus Type
+#define CYGARC_REG_BCR1_MASTER          0x40000000
 
-// Intercycle wait states
-#define CYGARC_REG_WCR1_WAITSEL         0x8000 // WAIT Sampling Timing Select
-#define CYGARC_REG_WCR1_A6I_MASK        0x3000 // Intercycle Idle Specification
-#define CYGARC_REG_WCR1_A6I_SHIFT       12
-#define CYGARC_REG_WCR1_A5I_MASK        0x0c00
-#define CYGARC_REG_WCR1_A5I_SHIFT       10
-#define CYGARC_REG_WCR1_A4I_MASK        0x0300
-#define CYGARC_REG_WCR1_A4I_SHIFT       8
-#define CYGARC_REG_WCR1_A3I_MASK        0x00c0
-#define CYGARC_REG_WCR1_A3I_SHIFT       6
-#define CYGARC_REG_WCR1_A2I_MASK        0x0030
-#define CYGARC_REG_WCR1_A2I_SHIFT       4
-#define CYGARC_REG_WCR1_A0I_MASK        0x0003
-#define CYGARC_REG_WCR1_A0I_SHIFT       0
-
-#define CYGARC_REG_WCR1_0WS         0
-#define CYGARC_REG_WCR1_1WS         1
-#define CYGARC_REG_WCR1_2WS         2
-#define CYGARC_REG_WCR1_3WS         3
-
-
-// Wait states
-#define CYGARC_REG_WCR2_A6_MASK         0xe000 // Wait states + burst pitch
-#define CYGARC_REG_WCR2_A6_SHIFT        13
-#define CYGARC_REG_WCR2_A5_MASK         0x1c00 // Wait states + burst pitch
-#define CYGARC_REG_WCR2_A5_SHIFT        10
-#define CYGARC_REG_WCR2_A4_MASK         0x0380 // Wait states
-#define CYGARC_REG_WCR2_A4_SHIFT        7
-#define CYGARC_REG_WCR2_A3_MASK         0x0060 // Wait states / CAS latency
-#define CYGARC_REG_WCR2_A3_SHIFT        5
-#define CYGARC_REG_WCR2_A2_MASK         0x0018 // Wait states / CAS latency
-#define CYGARC_REG_WCR2_A2_SHIFT        3
-#define CYGARC_REG_WCR2_A0_MASK         0x0007 // Wait states + burst pitch
-#define CYGARC_REG_WCR2_A0_SHIFT        0
-
-#define CYGARC_REG_WCR2_0WS             0
-#define CYGARC_REG_WCR2_1WS             1
-#define CYGARC_REG_WCR2_2WS             2
-#define CYGARC_REG_WCR2_3WS             3
-#define CYGARC_REG_WCR2_4WS             4
-#define CYGARC_REG_WCR2_6WS             5
-#define CYGARC_REG_WCR2_8WS             6
-#define CYGARC_REG_WCR2_10WS            7
-
-
+#define CYGARC_REG_MCR_RASD             0x80000000
+#define CYGARC_REG_MCR_MRSET            0x40000000
+#define CYGARC_REG_MCR_TCAS             0x00800000
+#define CYGARC_REG_MCR_BE               0x00000100
+#define CYGARC_REG_MCR_RFSH             0x00000004
+#define CYGARC_REG_MCR_RMODE            0x00000002
+#define CYGARC_REG_MCR_EDO_MODE         0x00000001
 
 //-----------------------------------------------------------------------------
 // Calculate constants needed to drive the proper SDRAM refresh rate. Argument
--- a/packages/hal/sh/sh4/current/include/mod_regs_intc.h
+++ b/packages/hal/sh/sh4/current/include/mod_regs_intc.h
@@ -49,6 +49,13 @@
 #define CYGARC_REG_IPRB                 0xFFD00008
 #define CYGARC_REG_IPRC                 0xFFD0000C
 
+#define CYGARC_REG_ICR_NMIL             0x8000
+#define CYGARC_REG_ICR_MAI              0x4000
+#define CYGARC_REG_ICR_NMIB             0x0200
+#define CYGARC_REG_ICR_NMIE             0x0100
+#define CYGARC_REG_ICR_IRLM             0x0080
+#define CYGARC_REG_ICR_SRST             0x0001
+
 #define CYGARC_REG_IPRA_TMU0_MASK       0xf000
 #define CYGARC_REG_IPRA_TMU0_PRI1       0x1000
 #define CYGARC_REG_IPRA_TMU1_MASK       0x0f00
@@ -74,3 +81,10 @@
 #define CYGARC_REG_IPRC_HUDI_MASK       0x000F
 #define CYGARC_REG_IPRC_HUDI_PRI1       0x0001
 
+
+// The (initial) IRQ mode is controlled by configuration.
+#ifdef CYGHWR_HAL_SH_IRQ_USE_IRQLVL
+# define CYGARC_REG_ICR_INIT 0x0000
+#else
+# define CYGARC_REG_ICR_INIT (CYGARC_REG_ICR_IRLM)
+#endif
--- a/packages/hal/sh/sh4/current/include/mod_regs_ubc.h
+++ b/packages/hal/sh/sh4/current/include/mod_regs_ubc.h
@@ -23,7 +23,7 @@
 //                                                                          
 // The Initial Developer of the Original Code is Red Hat.                   
 // Portions created by Red Hat are                                          
-// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
 // All Rights Reserved.                                                     
 // -------------------------------------------                              
 //                                                                          
@@ -44,7 +44,6 @@
 #define CYGARC_REG_BARA                 0xFF200000 // 32 bit
 #define CYGARC_REG_BAMRA                0xFF200004 // 8 bit
 #define CYGARC_REG_BBRA                 0xFF200008 // 16 bit
-
 #define CYGARC_REG_BARB                 0xFF20000C // 32 bit
 #define CYGARC_REG_BAMRB                0xFF200010 // 8 bit
 
@@ -63,14 +62,16 @@
 #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)
+#if defined(CYGARC_SH_MOD_UBC) && (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
+
+#define CYGARC_REG_BAMRA_BARA_UNMASKED  (0x00|CYGARC_REG_BAMRA_BASMA)   // BARA not masked, ignore ASID
+
 #else
 // mask is fully configurable in other versions of the UBC
 #endif
--- a/packages/hal/sh/sh4/current/include/variant.inc
+++ b/packages/hal/sh/sh4/current/include/variant.inc
@@ -70,7 +70,7 @@
 ##-----------------------------------------------------------------------------
 ## Hardware init macros
 #ifndef CYGPKG_HAL_SH_POST_RESET_INIT
-	.macro  hal_post_reset_init
+        .macro  hal_post_reset_init
         # Initialize CPU
         mov.l   $nCYG_SR,r1             ! Put CPU in a well-known state
         ldc     r1,sr
@@ -93,9 +93,12 @@
         mov.w   r0,@r1
         mov.l   $CYGARC_REG_IPRC,r1
         mov.w   r0,@r1
-	mov.w	$nCYG_WTCSR,r0          ! Clear watchdog
-	mov.l   $nCYGARC_REG_WTCSR,r1
-	mov.w	r0,@r1
+        mov.w   $nCYG_WTCSR,r0          ! Clear watchdog
+        mov.l   $nCYGARC_REG_WTCSR,r1
+        mov.w   r0,@r1
+        mov.w   $nCYG_ICR_INIT,r0
+        mov.l   $CYGARC_REG_ICR,r1      ! Set interrupt controller to IRQ mode
+        mov.w   r0,@r1
 
         # Initialize VBR if necessary
 #if     !defined(CYG_HAL_STARTUP_RAM) ||                \
@@ -104,25 +107,25 @@
         mov.l   $_reset,r1             ! Set VBR
         ldc     r1,vbr
 #endif
-	bra	1f
-	 nop
-	
+        bra     1f
+         nop
+        
 $nCYG_WTCSR:
-	.word	0xa500		! clear all CSR bits
+        .word   0xa500          ! clear all CSR bits
 
-	.align	2
+        .align  2
 $nCYG_SR:
         .long   CYG_SR
 $nCYGARC_REG_CCR:
-	.long	CYGARC_REG_CCR
+        .long   CYGARC_REG_CCR
 $nCYGARC_REG_MMUCR:
-	.long	CYGARC_REG_MMUCR
+        .long   CYGARC_REG_MMUCR
 $nCYGARC_REG_BBRA:
-	.long	CYGARC_REG_BBRA
+        .long   CYGARC_REG_BBRA
 $nCYGARC_REG_BBRB:
-	.long	CYGARC_REG_BBRB
+        .long   CYGARC_REG_BBRB
 $nCYGARC_REG_BRCR:
-	.long	CYGARC_REG_BRCR
+        .long   CYGARC_REG_BRCR
 $CYGARC_REG_TSTR:
         .long   CYGARC_REG_TSTR
 $CYGARC_REG_IPRA:
@@ -132,34 +135,38 @@
 $CYGARC_REG_IPRC:
         .long   CYGARC_REG_IPRC
 $nCYGARC_REG_WTCSR:
-	.long	CYGARC_REG_WTCSR
+        .long   CYGARC_REG_WTCSR
+$CYGARC_REG_ICR:
+        .long   CYGARC_REG_ICR
+        SYM_PTR_REF(_reset)
+	# Data below only need word alignment
+$nCYG_ICR_INIT:
+        .word   CYGARC_REG_ICR_INIT
 
-	SYM_PTR_REF(_reset)
-
-1:	
-	.endm
+1:      
+        .endm
 #define CYGPKG_HAL_SH_POST_RESET_INIT
 #endif
 
 ##-----------------------------------------------------------------------------
 ## Interrupt decode macros
-	.macro	hal_intc_decode tmp,inum
+        .macro  hal_intc_decode tmp,inum
         mov.l   $nCYGARC_REG_INTEVT,\tmp
         mov.l   @\tmp,\inum
         mov     #-5,\tmp                ! divide cause by 0x20
         shld    \tmp,\inum
         add     #-14,\inum              ! adjust so NMI becomes 0
-	.endm
-	
+        .endm
+        
 #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN
-	.macro	hal_intc_translate inum,vnum
-	mov     #0,\vnum		! Just vector zero is supported
-	.endm
-#else			
-	.macro	hal_intc_translate inum,vnum
-	mov	\inum,\vnum		! Vector == interrupt number
+        .macro  hal_intc_translate inum,vnum
+        mov     #0,\vnum                ! Just vector zero is supported
+        .endm
+#else                   
+        .macro  hal_intc_translate inum,vnum
+        mov     \inum,\vnum             ! Vector == interrupt number
         shll2   \vnum                   ! get from vector number to ISR index
-	.endm
+        .endm
 #endif
 
 #------------------------------------------------------------------------------
--- a/packages/hal/sh/sh4/current/src/var_misc.c
+++ b/packages/hal/sh/sh4/current/src/var_misc.c
@@ -192,8 +192,8 @@ hal_interrupt_update_level(int vector)
     case CYGNUM_HAL_INTERRUPT_SCIF_BRI:
     case CYGNUM_HAL_INTERRUPT_SCIF_TXI:
         HAL_READ_UINT16(CYGARC_REG_IPRC, iprX);
-        iprX &= ~CYGARC_REG_IPRC_DMAC_MASK;
-        iprX |= (level)*CYGARC_REG_IPRC_DMAC_PRI1;
+        iprX &= ~CYGARC_REG_IPRC_SCIF_MASK;
+        iprX |= (level)*CYGARC_REG_IPRC_SCIF_PRI1;
         HAL_WRITE_UINT16(CYGARC_REG_IPRC, iprX);
         break;
     case CYGNUM_HAL_INTERRUPT_RESERVED_1E0:
--- a/packages/hal/sh/sh4/current/src/variant.S
+++ b/packages/hal/sh/sh4/current/src/variant.S
@@ -68,6 +68,19 @@
 10:
         .endm
 
+        .macro RETURN_FROM_NONCACHED_SHADOW
+        nop                             ! Wait for 8 instructions
+        nop                             ! before jumping to a non-P2
+        nop                             ! area
+        nop
+        nop
+        nop
+        nop
+        nop
+	rts
+	 nop
+	.endm
+
 FUNC_START(cyg_hal_dcache_enable)
         GOTO_NONCACHED_SHADOW
         mov.l   $nCYGARC_REG_CCR,r1
@@ -75,9 +88,7 @@ FUNC_START(cyg_hal_dcache_enable)
         mov     #CYGARC_REG_CCR_OCE,r2
         or      r2,r0
         mov.l   r0,@r1
-        nop
-        rts
-         nop
+        RETURN_FROM_NONCACHED_SHADOW
 
 FUNC_START(cyg_hal_dcache_disable)
         GOTO_NONCACHED_SHADOW
@@ -87,9 +98,7 @@ FUNC_START(cyg_hal_dcache_disable)
         not     r2,r2
         and     r2,r0
         mov.l   r0,@r1
-        nop
-        rts
-         nop
+        RETURN_FROM_NONCACHED_SHADOW
         
 FUNC_START(cyg_hal_dcache_invalidate_all)
         GOTO_NONCACHED_SHADOW
@@ -98,11 +107,7 @@ FUNC_START(cyg_hal_dcache_invalidate_all
         mov     #CYGARC_REG_CCR_OCI,r2
         or      r2,r0
         mov.l   r0,@r1
-        nop                             ! Nothing in the docs suggest we need
-        nop                             ! nops here, but without them, the
-        nop                             ! CPU crashes.
-        rts
-         nop
+        RETURN_FROM_NONCACHED_SHADOW
 
 FUNC_START(cyg_hal_dcache_sync)
         GOTO_NONCACHED_SHADOW
@@ -115,9 +120,8 @@ 1:      cmp/hi  r1,r2
         mov.l   r0,@r1
         bra     1b        
          add     r3,r1                  ! delay slot!
-2:      nop
-        rts
-         nop
+2:
+        RETURN_FROM_NONCACHED_SHADOW
 
         .align  2
 $CYGARC_REG_DCACHE_ADDRESS_FLUSH:
@@ -139,8 +143,7 @@ 1:	ocbp	@r4                     ! operan
 	add     #-CYGARC_SH_MOD_DCAC_ADDRESS_STEP,r5
         cmp/pl  r5
 	bt	1b
-        rts
-         nop
+        RETURN_FROM_NONCACHED_SHADOW
 
 FUNC_START(cyg_hal_dcache_write_mode)
         GOTO_NONCACHED_SHADOW
@@ -155,10 +158,7 @@ FUNC_START(cyg_hal_dcache_write_mode)
         # Or in the new settings and restore to CCR
         or      r4,r3
         mov.l   r3,@r1
-        nop
-        rts
-         nop
-
+        RETURN_FROM_NONCACHED_SHADOW
 
 FUNC_START(cyg_hal_icache_enable)
         GOTO_NONCACHED_SHADOW
@@ -167,9 +167,7 @@ FUNC_START(cyg_hal_icache_enable)
         mov.l   $nCYGARC_REG_CCR_ICE,r2
         or      r2,r0
         mov.l   r0,@r1
-        nop
-        rts
-         nop
+        RETURN_FROM_NONCACHED_SHADOW
 
 FUNC_START(cyg_hal_icache_disable)
         GOTO_NONCACHED_SHADOW
@@ -179,9 +177,7 @@ FUNC_START(cyg_hal_icache_disable)
         not     r2,r2
         and     r2,r0
         mov.l   r0,@r1
-        nop
-        rts
-         nop
+        RETURN_FROM_NONCACHED_SHADOW
         
 FUNC_START(cyg_hal_icache_invalidate_all)
         GOTO_NONCACHED_SHADOW
@@ -190,11 +186,7 @@ FUNC_START(cyg_hal_icache_invalidate_all
         mov.l   $nCYGARC_REG_CCR_ICI,r2
         or      r2,r0
         mov.l   r0,@r1
-        nop                             ! Nothing in the docs suggest we need
-        nop                             ! nops here, but without them, the
-        nop                             ! CPU crashes.
-        rts
-         nop
+        RETURN_FROM_NONCACHED_SHADOW
 
 	.align	2
 $MASK:
--- a/packages/infra/current/ChangeLog
+++ b/packages/infra/current/ChangeLog
@@ -1,3 +1,11 @@
+2001-07-13  Jonathan Larmour  <jlarmour@redhat.com>
+
+	* src/diag.cxx (diag_vprintf): Fix long longs (patch from
+	Motoya Kurotsu <kurotsu [at] allied-telesis.co.jp>
+
+	* cdl/debug.cdl: Make tracing styles be mutually exclusive properly
+	using an interface.
+
 2001-06-14  Jonathan Larmour  <jlarmour@redhat.com>
 
 	* include/clist.hxx (Cyg_DNode_T): Don't qualify constructor or
--- a/packages/infra/current/cdl/debug.cdl
+++ b/packages/infra/current/cdl/debug.cdl
@@ -50,6 +50,7 @@
 cdl_component CYGDBG_USE_ASSERTS {
     display       "Use asserts"
     default_value 1
+    requires      { 1 == CYGINT_INFRA_DEBUG_TRACE_IMPL }
     description   "
         If this option is defined, asserts in the code are tested.
         Assert functions (CYG_ASSERT()) are defined in
@@ -63,6 +64,7 @@ cdl_component CYGDBG_USE_ASSERTS {
 cdl_component CYGDBG_USE_TRACING {
     display       "Use tracing"
     default_value 0
+    requires      { 1 == CYGINT_INFRA_DEBUG_TRACE_IMPL }
     description   "
         If this option is defined, tracing operations
         result in output or logging, depending on other options.
@@ -109,11 +111,14 @@ cdl_component CYGDBG_USE_TRACING {
     }
 }
 
-# FIXME: The below options should be mutually exclusive.
+cdl_interface CYGINT_INFRA_DEBUG_TRACE_IMPL {
+    display "Trace output implementations"
+}
+
 cdl_option CYGDBG_INFRA_DEBUG_TRACE_ASSERT_NULL {
     display       "Null output"
-#          type             radio
     default_value 0
+    implements    CYGINT_INFRA_DEBUG_TRACE_IMPL
     description   "
         A null output module which is useful when
         debugging interactively; the output routines
@@ -122,24 +127,24 @@ cdl_option CYGDBG_INFRA_DEBUG_TRACE_ASSE
 }
 cdl_option CYGDBG_INFRA_DEBUG_TRACE_ASSERT_SIMPLE {
     display          "Simple output"
-#          type             radio
     default_value 0
+    implements    CYGINT_INFRA_DEBUG_TRACE_IMPL
     description   "
         An output module which produces simple output
         from tracing and assertion events."
 }
 cdl_option CYGDBG_INFRA_DEBUG_TRACE_ASSERT_FANCY {
     display       "Fancy output"
-#          type             radio
     default_value 0
+    implements    CYGINT_INFRA_DEBUG_TRACE_IMPL
     description "
         An output module which produces fancy output
         from tracing and assertion events."
 }
 cdl_component CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER {
     display       "Buffered tracing"
-#          type             radio
     default_value 1
+    implements    CYGINT_INFRA_DEBUG_TRACE_IMPL
     description   "
         An output module which buffers output
         from tracing and assertion events. The stored
--- a/packages/infra/current/src/diag.cxx
+++ b/packages/infra/current/src/diag.cxx
@@ -262,6 +262,9 @@ static cyg_bool diag_check_string( const
 
 externC void diag_vprintf( const char *fmt, CYG_ADDRWORD *args)
 {
+
+    cyg_bool pad = true;
+
     if( !diag_check_string(fmt) )
     {
         int i;
@@ -309,6 +312,13 @@ externC void diag_vprintf( const char *f
                 }
             }
 
+            if (long_op) {
+                    if(pad) args++;
+                    pad=false;
+            } else {
+                    pad=!pad;
+            }
+               
             switch( c )
             {
             case 'd':
--- a/packages/io/usb/eth/slave/current/ChangeLog
+++ b/packages/io/usb/eth/slave/current/ChangeLog
@@ -1,3 +1,17 @@
+2001-07-10  Bart Veer  <bartv@redhat.com>
+
+	* doc/usbseth.sgml, doc/*.html:
+	Document the below changes.
+
+	* cdl/usbs_eth.cdl:
+	The USB-ethernet device now registers itself as either eth0 or
+	eth1 by default, depending on what else is present in the system.
+	Also bootp/dhcp support is prohibited for this network device on
+	the ground that it is rather unlikely that a host will provide
+	a dhcp service for a network device that does not exist until the
+	host-target connection has been fully established.
+	
+
 2001-07-02  Bart Veer  <bartv@redhat.com>
 
 	* host/ecos_usbeth.c (ecos_usbeth_probe):
--- a/packages/io/usb/eth/slave/current/cdl/usbs_eth.cdl
+++ b/packages/io/usb/eth/slave/current/cdl/usbs_eth.cdl
@@ -88,7 +88,7 @@ cdl_package CYGPKG_IO_USB_SLAVE_ETH {
 	cdl_option CYGDAT_USBS_ETHDRV_NAME {
 	    display       "Name to use for this network device"
 	    flavor        data
-	    default_value { "\"eth0\"" }
+	    default_value { (1 == CYGHWR_NET_DRIVERS) ? "\"eth0\"" : "\"eth1\"" }
 	    description "
 	        The name of this network device for control purposes.
 	    "
@@ -99,12 +99,15 @@ cdl_package CYGPKG_IO_USB_SLAVE_ETH {
 	    flavor        bool
 	    calculated    { "\"eth0\"" == CYGDAT_USBS_ETHDRV_NAME }
 	    implements    CYGHWR_NET_DRIVER_ETH0
+	    requires      !CYGHWR_NET_DRIVER_ETH0_BOOTP
 	}
+	
 	cdl_option CYGPRI_USBS_ETHDRV_ETH1 {
 	    display       "Enable/disable generic eth1 configury"
 	    flavor        bool
 	    calculated    { "\"eth1\"" == CYGDAT_USBS_ETHDRV_NAME }
 	    implements    CYGHWR_NET_DRIVER_ETH1
+	    requires      !CYGHWR_NET_DRIVER_ETH1_BOOTP
 	}
     }
 }
--- a/packages/io/usb/eth/slave/current/doc/io-usb-slave-eth.html
+++ b/packages/io/usb/eth/slave/current/doc/io-usb-slave-eth.html
@@ -2,165 +2,167 @@
 <!-- This material may be distributed only subject to the terms      -->
 <!-- and conditions set forth in the Open Publication License, v1.0  -->
 <!-- or later (the latest version is presently available at          -->
-<!-- http://www.opencontent.org/openpub/)                            -->
+<!-- http://www.opencontent.org/openpub/).                           -->
 <!-- Distribution of substantively modified versions of this         -->
 <!-- document is prohibited without the explicit permission of the   -->
 <!-- copyright holder.                                               -->
 <!-- Distribution of the work or derivative of the work in any       -->
 <!-- standard (paper) book form is prohibited unless prior           -->
-<!-- permission obtained from the copyright holder                   -->
-<HTML>
-<HEAD>
-<TITLE>
-eCos Support for Developing USB-ethernet Peripherals</TITLE>
-<META
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>eCos Support for Developing USB-ethernet Peripherals</TITLE
+><META
 NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.54"><LINK
+CONTENT="Modular DocBook HTML Stylesheet Version 1.64
+"><LINK
 REL="NEXT"
 TITLE="Introduction"
-HREF="usbseth-intro.html"></HEAD>
-<BODY
+HREF="usbseth-intro.html"></HEAD
+><BODY
 CLASS="REFERENCE"
 BGCOLOR="#FFFFFF"
 TEXT="#000000"
 LINK="#0000FF"
 VLINK="#840084"
-ALINK="#0000FF">
-<DIV
-CLASS="NAVHEADER">
-<TABLE
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TD
+CELLSPACING="0"
+><TR
+><TD
 WIDTH="10%"
 ALIGN="left"
-VALIGN="bottom">
-&nbsp;</TD>
-<TD
+VALIGN="bottom"
+>&nbsp;</TD
+><TD
 WIDTH="80%"
 ALIGN="center"
-VALIGN="bottom">
-</TD>
-<TD
+VALIGN="bottom"
+></TD
+><TD
 WIDTH="10%"
 ALIGN="right"
-VALIGN="bottom">
-<A
-HREF="usbseth-intro.html">
-Next</A>
-</TD>
-</TR>
-</TABLE>
-<HR
+VALIGN="bottom"
+><A
+HREF="usbseth-intro.html"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
 ALIGN="LEFT"
-WIDTH="100%"></DIV>
-<DIV
-CLASS="REFERENCE">
-<A
-NAME="IO-USB-SLAVE-ETH">
-</A>
-<DIV
-CLASS="TITLEPAGE">
-<H1
-CLASS="TITLE">
-I. eCos Support for Developing USB-ethernet Peripherals</H1>
-<DIV
-CLASS="TOC">
-<DL>
-<DT>
-<B>
-Table of Contents</B>
-</DT>
-<DT>
-<A
-HREF="usbseth-intro.html">
-Introduction</A>
- &#8212; eCos support for developing USB ethernet peripherals</DT>
-<DT>
-<A
-HREF="usbseth-init.html">
-Initializing the USB-ethernet Package</A>
- &#8212; Initializing the USB-ethernet Package</DT>
-<DT>
-<A
-HREF="usbseth-data.html">
-USB-ethernet Data Transfers</A>
- &#8212; Exchanging ethernet packets with the USB host</DT>
-<DT>
-<A
-HREF="usbseth-control.html">
-USB-ethernet State Handling</A>
- &#8212; Maintaining the USB-ethernet connection with the host</DT>
-<DT>
-<A
-HREF="usbseth-netdev.html">
-Network Device for the eCos TCP/IP Stack</A>
- &#8212; USB-ethernet support for the eCos TCP/IP Stack</DT>
-<DT>
-<A
-HREF="usbseth-host.html">
-Example Host-side Device Driver</A>
- &#8212; Provide host-side support for the eCos USB-ethernet package</DT>
-<DT>
-<A
-HREF="usbseth-protocol.html">
-Communication Protocol</A>
- &#8212; Protocol used between the host-side device driver and the eCos
-USB-ethernet package </DT>
-</DL>
-</DIV>
-</DIV>
-</DIV>
-<DIV
-CLASS="NAVFOOTER">
-<HR
+WIDTH="100%"></DIV
+><DIV
+CLASS="REFERENCE"
+><A
+NAME="IO-USB-SLAVE-ETH"
+></A
+><DIV
+CLASS="TITLEPAGE"
+><H1
+CLASS="TITLE"
+>I. eCos Support for Developing USB-ethernet Peripherals</H1
+><DIV
+CLASS="TOC"
+><DL
+><DT
+><B
+>Table of Contents</B
+></DT
+><DT
+><A
+HREF="usbseth-intro.html"
+>Introduction</A
+> &#8212; eCos support for developing USB ethernet peripherals</DT
+><DT
+><A
+HREF="usbseth-init.html"
+>Initializing the USB-ethernet Package</A
+> &#8212; Initializing the USB-ethernet Package</DT
+><DT
+><A
+HREF="usbseth-data.html"
+>USB-ethernet Data Transfers</A
+> &#8212; Exchanging ethernet packets with the USB host</DT
+><DT
+><A
+HREF="usbseth-control.html"
+>USB-ethernet State Handling</A
+> &#8212; Maintaining the USB-ethernet connection with the host</DT
+><DT
+><A
+HREF="usbseth-netdev.html"
+>Network Device for the eCos TCP/IP Stack</A
+> &#8212; USB-ethernet support for the eCos TCP/IP Stack</DT
+><DT
+><A
+HREF="usbseth-host.html"
+>Example Host-side Device Driver</A
+> &#8212; Provide host-side support for the eCos USB-ethernet package</DT
+><DT
+><A
+HREF="usbseth-protocol.html"
+>Communication Protocol</A
+> &#8212; Protocol used between the host-side device driver and the eCos
+USB-ethernet package </DT
+></DL
+></DIV
+></DIV
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
 ALIGN="LEFT"
 WIDTH="100%"><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TD
+CELLSPACING="0"
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-&nbsp;</TD>
-<TD
+VALIGN="top"
+>&nbsp;</TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-&nbsp;</TD>
-<TD
+VALIGN="top"
+>&nbsp;</TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-<A
-HREF="usbseth-intro.html">
-Next</A>
-</TD>
-</TR>
-<TR>
-<TD
+VALIGN="top"
+><A
+HREF="usbseth-intro.html"
+>Next</A
+></TD
+></TR
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-&nbsp;</TD>
-<TD
+VALIGN="top"
+>&nbsp;</TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-&nbsp;</TD>
-<TD
+VALIGN="top"
+>&nbsp;</TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-Introduction</TD>
-</TR>
-</TABLE>
-</DIV>
-</BODY>
-</HTML>
+VALIGN="top"
+>Introduction</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
--- a/packages/io/usb/eth/slave/current/doc/usbseth-control.html
+++ b/packages/io/usb/eth/slave/current/doc/usbseth-control.html
@@ -2,20 +2,21 @@
 <!-- This material may be distributed only subject to the terms      -->
 <!-- and conditions set forth in the Open Publication License, v1.0  -->
 <!-- or later (the latest version is presently available at          -->
-<!-- http://www.opencontent.org/openpub/)                            -->
+<!-- http://www.opencontent.org/openpub/).                           -->
 <!-- Distribution of substantively modified versions of this         -->
 <!-- document is prohibited without the explicit permission of the   -->
 <!-- copyright holder.                                               -->
 <!-- Distribution of the work or derivative of the work in any       -->
 <!-- standard (paper) book form is prohibited unless prior           -->
-<!-- permission obtained from the copyright holder                   -->
-<HTML>
-<HEAD>
-<TITLE>
-USB-ethernet State Handling</TITLE>
-<META
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>USB-ethernet State Handling</TITLE
+><META
 NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.54"><LINK
+CONTENT="Modular DocBook HTML Stylesheet Version 1.64
+"><LINK
 REL="HOME"
 TITLE="eCos Support for Developing USB-ethernet Peripherals"
 HREF="io-usb-slave-eth.html"><LINK
@@ -24,152 +25,155 @@ TITLE="USB-ethernet Data Transfers"
 HREF="usbseth-data.html"><LINK
 REL="NEXT"
 TITLE="Network Device for the eCos TCP/IP Stack"
-HREF="usbseth-netdev.html"></HEAD>
-<BODY
+HREF="usbseth-netdev.html"></HEAD
+><BODY
 CLASS="REFENTRY"
 BGCOLOR="#FFFFFF"
 TEXT="#000000"
 LINK="#0000FF"
 VLINK="#840084"
-ALINK="#0000FF">
-<DIV
-CLASS="NAVHEADER">
-<TABLE
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TH
+CELLSPACING="0"
+><TR
+><TH
 COLSPAN="3"
-ALIGN="center">
-eCos Support for Developing USB-ethernet Peripherals</TH>
-</TR>
-<TR>
-<TD
+ALIGN="center"
+>eCos Support for Developing USB-ethernet Peripherals</TH
+></TR
+><TR
+><TD
 WIDTH="10%"
 ALIGN="left"
-VALIGN="bottom">
-<A
-HREF="usbseth-data.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="bottom"
+><A
+HREF="usbseth-data.html"
+>Prev</A
+></TD
+><TD
 WIDTH="80%"
 ALIGN="center"
-VALIGN="bottom">
-</TD>
-<TD
+VALIGN="bottom"
+></TD
+><TD
 WIDTH="10%"
 ALIGN="right"
-VALIGN="bottom">
-<A
-HREF="usbseth-netdev.html">
-Next</A>
-</TD>
-</TR>
-</TABLE>
-<HR
+VALIGN="bottom"
+><A
+HREF="usbseth-netdev.html"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
 ALIGN="LEFT"
-WIDTH="100%"></DIV>
-<H1>
-<A
-NAME="USBSETH-CONTROL">
-USB-ethernet State Handling</A>
-</H1>
-<DIV
-CLASS="REFNAMEDIV">
-<A
-NAME="AEN163">
-</A>
-<H2>
-Name</H2>
-USB-ethernet State Handling&nbsp;--&nbsp;Maintaining the USB-ethernet connection with the host</DIV>
-<DIV
-CLASS="REFSYNOPSISDIV">
-<A
-NAME="AEN166">
-</A>
-<H2>
-Synopsis</H2>
-<DIV
-CLASS="FUNCSYNOPSIS">
-<P>
-</P>
-<TABLE
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="USBSETH-CONTROL"
+>USB-ethernet State Handling</A
+></H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN163"
+></A
+><H2
+>Name</H2
+>USB-ethernet State Handling&nbsp;--&nbsp;Maintaining the USB-ethernet connection with the host</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN166"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN167"
+></A
+><P
+></P
+><TABLE
 BORDER="0"
 BGCOLOR="#E0E0E0"
-WIDTH="100%">
-<TR>
-<TD>
-<PRE
-CLASS="FUNCSYNOPSISINFO">
-#include &lt;cyg/io/usb/usbs_eth.h&gt;</PRE>
-</TD>
-</TR>
-</TABLE>
-<P>
-<CODE>
-<CODE
-CLASS="FUNCDEF">
-usbs_control_return usbs_eth_class_control_handler</CODE>
-(usbs_control_endpoint* ep0, void* callback_data);</CODE>
-</P>
-<P>
-<CODE>
-<CODE
-CLASS="FUNCDEF">
-void usbs_eth_state_change_handler</CODE>
-(usbs_control_endpoint* ep0, void* callback_data, usbs_state_change change, int old_state);</CODE>
-</P>
-<P>
-<CODE>
-<CODE
-CLASS="FUNCDEF">
-void usbs_eth_disable</CODE>
-(usbs_eth* usbseth&#62;);</CODE>
-</P>
-<P>
-<CODE>
-<CODE
-CLASS="FUNCDEF">
-void usbs_eth_enable</CODE>
-(usbs_eth* usbseth&#62;);</CODE>
-</P>
-<P>
-</P>
-</DIV>
-</DIV>
-<DIV
-CLASS="REFSECT1">
-<A
-NAME="AEN197">
-</A>
-<H2>
-Description</H2>
-<P>
-When the USB-ethernet package is initialized by a call to <A
-HREF="usbseth-init.html">
-<TT
-CLASS="FUNCTION">
-usbs_eth_init</TT>
-</A>
- it
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &lt;cyg/io/usb/usbs_eth.h&gt;</PRE
+></TD
+></TR
+></TABLE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>usbs_control_return usbs_eth_class_control_handler</CODE
+>(usbs_control_endpoint* ep0, void* callback_data);</CODE
+></P
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void usbs_eth_state_change_handler</CODE
+>(usbs_control_endpoint* ep0, void* callback_data, usbs_state_change change, int old_state);</CODE
+></P
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void usbs_eth_disable</CODE
+>(usbs_eth* usbseth&#62;);</CODE
+></P
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void usbs_eth_enable</CODE
+>(usbs_eth* usbseth&#62;);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN197"
+></A
+><H2
+>Description</H2
+><P
+>When the USB-ethernet package is initialized by a call to <A
+HREF="usbseth-init.html"
+><TT
+CLASS="FUNCTION"
+>usbs_eth_init</TT
+></A
+> it
 installs <TT
-CLASS="FUNCTION">
-usbs_eth_state_change_handler</TT>
- to handle
+CLASS="FUNCTION"
+>usbs_eth_state_change_handler</TT
+> to handle
 USB state changes. This allows the package to detect when the
 connection between the host and the peripheral is established or
 broken, resulting in internal calls to
 <TT
-CLASS="FUNCTION">
-usbs_eth_enable</TT>
- and
+CLASS="FUNCTION"
+>usbs_eth_enable</TT
+> and
 <TT
-CLASS="FUNCTION">
-usbs_eth_disable</TT>
- respectively. This is
+CLASS="FUNCTION"
+>usbs_eth_disable</TT
+> respectively. This is
 appropriate if no other code needs to access the USB device. However,
 if there is other code, either other USB-related packages or the
 application itself, that needs to perform I/O over the USB bus, then
@@ -178,39 +182,39 @@ state change events. Instead, the assump
 code, typically provided by the application, will install an
 alternative state change handler in the control endpoint data
 structure after the call to <TT
-CLASS="FUNCTION">
-usbs_eth_init</TT>
-. This
+CLASS="FUNCTION"
+>usbs_eth_init</TT
+>. This
 alternative handler will either chain into
 <TT
-CLASS="FUNCTION">
-usbs_eth_state_change_handler</TT>
- when appropriate,
+CLASS="FUNCTION"
+>usbs_eth_state_change_handler</TT
+> when appropriate,
 or else it will invoke <TT
-CLASS="FUNCTION">
-usbs_eth_enable</TT>
- and
+CLASS="FUNCTION"
+>usbs_eth_enable</TT
+> and
 <TT
-CLASS="FUNCTION">
-usbs_eth_disable</TT>
- directly. For further details of
+CLASS="FUNCTION"
+>usbs_eth_disable</TT
+> directly. For further details of
 state change handlers and control endpoints generally, see the
-documentation for the common USB-slave package.</P>
-<P>
-Similarly, <TT
-CLASS="FUNCTION">
-usbs_eth_init</TT>
- will install
+documentation for the common USB-slave package.</P
+><P
+>Similarly, <TT
+CLASS="FUNCTION"
+>usbs_eth_init</TT
+> will install
 <TT
-CLASS="FUNCTION">
-usbs_eth_class_control_handler</TT>
- in the control
+CLASS="FUNCTION"
+>usbs_eth_class_control_handler</TT
+> in the control
 endpoint data structure as the appropriate handler for class-specific
 USB control messages. This code will handle the ethernet-specific
 <A
-HREF="usbseth-protocol.html">
-control messages </A>
-, for example
+HREF="usbseth-protocol.html"
+>control messages </A
+>, for example
 requests by the host to enable or disable promiscuous mode or to
 obtain the MAC address. If the USB device is not shared with any other
 code then this is both necessary and sufficient. However, if other code
@@ -221,84 +225,85 @@ request code is encoded in just a single
 possibility that exactly the same number will be used by different
 protocols for different requests. Any such problems will have to be
 identified and resolved by application developers, and may involve
-modifying the source code for the USB-ethernet package.</P>
-<P>
-As an alternative to chaining the state change handler, higher-level
+modifying the source code for the USB-ethernet package.</P
+><P
+>As an alternative to chaining the state change handler, higher-level
 code can instead call <TT
-CLASS="FUNCTION">
-usbs_eth_disable</TT>
- and
+CLASS="FUNCTION"
+>usbs_eth_disable</TT
+> and
 <TT
-CLASS="FUNCTION">
-usbs_eth_enable</TT>
- directly. These functions may
+CLASS="FUNCTION"
+>usbs_eth_enable</TT
+> directly. These functions may
 also be called if the USB-ethernet package should become inactive for
 reasons not related directly to events on the USB bus. The main effect
 of <TT
-CLASS="FUNCTION">
-usbs_eth_enable</TT>
- is to restart receive
+CLASS="FUNCTION"
+>usbs_eth_enable</TT
+> is to restart receive
 operations and to allow transmits. The main effect of
 <TT
-CLASS="FUNCTION">
-usbs_eth_disable</TT>
- is to block further transmits:
+CLASS="FUNCTION"
+>usbs_eth_disable</TT
+> is to block further transmits:
 any current receive operations need to be aborted at the USB level,
-for example by halting the appropriate endpoint.</P>
-</DIV>
-<DIV
-CLASS="NAVFOOTER">
-<HR
+for example by halting the appropriate endpoint.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
 ALIGN="LEFT"
 WIDTH="100%"><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TD
+CELLSPACING="0"
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-<A
-HREF="usbseth-data.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="usbseth-data.html"
+>Prev</A
+></TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-<A
-HREF="io-usb-slave-eth.html">
-Home</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="io-usb-slave-eth.html"
+>Home</A
+></TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-<A
-HREF="usbseth-netdev.html">
-Next</A>
-</TD>
-</TR>
-<TR>
-<TD
+VALIGN="top"
+><A
+HREF="usbseth-netdev.html"
+>Next</A
+></TD
+></TR
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-USB-ethernet Data Transfers</TD>
-<TD
+VALIGN="top"
+>USB-ethernet Data Transfers</TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-&nbsp;</TD>
-<TD
+VALIGN="top"
+>&nbsp;</TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-Network Device for the eCos TCP/IP Stack</TD>
-</TR>
-</TABLE>
-</DIV>
-</BODY>
-</HTML>
+VALIGN="top"
+>Network Device for the eCos TCP/IP Stack</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
--- a/packages/io/usb/eth/slave/current/doc/usbseth-data.html
+++ b/packages/io/usb/eth/slave/current/doc/usbseth-data.html
@@ -2,20 +2,21 @@
 <!-- This material may be distributed only subject to the terms      -->
 <!-- and conditions set forth in the Open Publication License, v1.0  -->
 <!-- or later (the latest version is presently available at          -->
-<!-- http://www.opencontent.org/openpub/)                            -->
+<!-- http://www.opencontent.org/openpub/).                           -->
 <!-- Distribution of substantively modified versions of this         -->
 <!-- document is prohibited without the explicit permission of the   -->
 <!-- copyright holder.                                               -->
 <!-- Distribution of the work or derivative of the work in any       -->
 <!-- standard (paper) book form is prohibited unless prior           -->
-<!-- permission obtained from the copyright holder                   -->
-<HTML>
-<HEAD>
-<TITLE>
-USB-ethernet Data Transfers</TITLE>
-<META
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>USB-ethernet Data Transfers</TITLE
+><META
 NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.54"><LINK
+CONTENT="Modular DocBook HTML Stylesheet Version 1.64
+"><LINK
 REL="HOME"
 TITLE="eCos Support for Developing USB-ethernet Peripherals"
 HREF="io-usb-slave-eth.html"><LINK
@@ -24,251 +25,254 @@ TITLE="Initializing the USB-ethernet Pac
 HREF="usbseth-init.html"><LINK
 REL="NEXT"
 TITLE="USB-ethernet State Handling"
-HREF="usbseth-control.html"></HEAD>
-<BODY
+HREF="usbseth-control.html"></HEAD
+><BODY
 CLASS="REFENTRY"
 BGCOLOR="#FFFFFF"
 TEXT="#000000"
 LINK="#0000FF"
 VLINK="#840084"
-ALINK="#0000FF">
-<DIV
-CLASS="NAVHEADER">
-<TABLE
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TH
+CELLSPACING="0"
+><TR
+><TH
 COLSPAN="3"
-ALIGN="center">
-eCos Support for Developing USB-ethernet Peripherals</TH>
-</TR>
-<TR>
-<TD
+ALIGN="center"
+>eCos Support for Developing USB-ethernet Peripherals</TH
+></TR
+><TR
+><TD
 WIDTH="10%"
 ALIGN="left"
-VALIGN="bottom">
-<A
-HREF="usbseth-init.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="bottom"
+><A
+HREF="usbseth-init.html"
+>Prev</A
+></TD
+><TD
 WIDTH="80%"
 ALIGN="center"
-VALIGN="bottom">
-</TD>
-<TD
+VALIGN="bottom"
+></TD
+><TD
 WIDTH="10%"
 ALIGN="right"
-VALIGN="bottom">
-<A
-HREF="usbseth-control.html">
-Next</A>
-</TD>
-</TR>
-</TABLE>
-<HR
+VALIGN="bottom"
+><A
+HREF="usbseth-control.html"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
 ALIGN="LEFT"
-WIDTH="100%"></DIV>
-<H1>
-<A
-NAME="USBSETH-DATA">
-USB-ethernet Data Transfers</A>
-</H1>
-<DIV
-CLASS="REFNAMEDIV">
-<A
-NAME="AEN94">
-</A>
-<H2>
-Name</H2>
-USB-ethernet Data Transfers&nbsp;--&nbsp;Exchanging ethernet packets with the USB host</DIV>
-<DIV
-CLASS="REFSYNOPSISDIV">
-<A
-NAME="AEN97">
-</A>
-<H2>
-Synopsis</H2>
-<DIV
-CLASS="FUNCSYNOPSIS">
-<P>
-</P>
-<TABLE
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="USBSETH-DATA"
+>USB-ethernet Data Transfers</A
+></H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN94"
+></A
+><H2
+>Name</H2
+>USB-ethernet Data Transfers&nbsp;--&nbsp;Exchanging ethernet packets with the USB host</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN97"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN98"
+></A
+><P
+></P
+><TABLE
 BORDER="0"
 BGCOLOR="#E0E0E0"
-WIDTH="100%">
-<TR>
-<TD>
-<PRE
-CLASS="FUNCSYNOPSISINFO">
-#include &lt;cyg/io/usb/usbs_eth.h&gt;</PRE>
-</TD>
-</TR>
-</TABLE>
-<P>
-<CODE>
-<CODE
-CLASS="FUNCDEF">
-void usbs_eth_start_rx</CODE>
-(usbs_eth* usbseth, unsigned char* buffer, void (*)(usbs_eth*, void*, int) complete_fn, void* complete_data);</CODE>
-</P>
-<P>
-<CODE>
-<CODE
-CLASS="FUNCDEF">
-void usbs_eth_start_tx</CODE>
-(usbs_eth* usbseth, unsigned char* buffer, void (*)(usbs_eth*, void*, int) complete_fn, void* complete_data);</CODE>
-</P>
-<P>
-</P>
-</DIV>
-</DIV>
-<DIV
-CLASS="REFSECT1">
-<A
-NAME="AEN122">
-</A>
-<H2>
-Description</H2>
-<P>
-The USB-ethernet package provides two main modes of operation. In the
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &lt;cyg/io/usb/usbs_eth.h&gt;</PRE
+></TD
+></TR
+></TABLE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void usbs_eth_start_rx</CODE
+>(usbs_eth* usbseth, unsigned char* buffer, void (*)(usbs_eth*, void*, int) complete_fn, void* complete_data);</CODE
+></P
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void usbs_eth_start_tx</CODE
+>(usbs_eth* usbseth, unsigned char* buffer, void (*)(usbs_eth*, void*, int) complete_fn, void* complete_data);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN122"
+></A
+><H2
+>Description</H2
+><P
+>The USB-ethernet package provides two main modes of operation. In the
 first mode it provides a <A
-HREF="usbseth-netdev.html">
-network device
-driver</A>
- for use by a TCP/IP stack running inside the USB
+HREF="usbseth-netdev.html"
+>network device
+driver</A
+> for use by a TCP/IP stack running inside the USB
 peripheral. All incoming ethernet packages should be passed up the
 TCP/IP stack, and only the stack will generate outgoing packets. Apart
 from <A
-HREF="usbseth-init.html">
-initialization</A>
- and possibly
+HREF="usbseth-init.html"
+>initialization</A
+> and possibly
 certain <A
-HREF="usbseth-control.html">
-control operations</A>
-,
+HREF="usbseth-control.html"
+>control operations</A
+>,
 higher-level code will not interact with the USB-ethernet package
-directly.</P>
-<P>
-In the second mode there is no TCP/IP stack running inside the USB
+directly.</P
+><P
+>In the second mode there is no TCP/IP stack running inside the USB
 peripheral. For example, a simple USB-ethernet converter has an
 ethernet chip and a USB port: ethernet packets received by the
 ethernet chip need to be forwarded to the USB host, and ethernet
 packets sent by the USB host need to be sent out of the ethernet chip.
 <TT
-CLASS="FUNCTION">
-usbs_eth_start_rx</TT>
- and
+CLASS="FUNCTION"
+>usbs_eth_start_rx</TT
+> and
 <TT
-CLASS="FUNCTION">
-usbs_eth_start_tx</TT>
- allow for this lower-level
-access to the USB-ethernet package.</P>
-<P>
-The two modes of operation are mutually exclusive. If the network
+CLASS="FUNCTION"
+>usbs_eth_start_tx</TT
+> allow for this lower-level
+access to the USB-ethernet package.</P
+><P
+>The two modes of operation are mutually exclusive. If the network
 device driver mode is enabled then application code should communicate
 at the TCP/IP level, and not by using the lower-level functions.
 Instead, it is the network device driver that will make use of these
 functions, and it assumes that it has exclusive access. The package
-does not perform any locking.</P>
-<P>
-The transmit and receive functions work in much the same way. The
+does not perform any locking.</P
+><P
+>The transmit and receive functions work in much the same way. The
 first argument identifies the <SPAN
-CLASS="STRUCTNAME">
-usbs_eth</SPAN>
-
+CLASS="STRUCTNAME"
+>usbs_eth</SPAN
+>
 structure that should be used. For the majority of applications this
 will be <TT
-CLASS="LITERAL">
-usbs_eth0</TT>
-. The second argument specifies
+CLASS="LITERAL"
+>usbs_eth0</TT
+>. The second argument specifies
 the location of the ethernet packet; outgoing for
 <TT
-CLASS="FUNCTION">
-usbs_eth_start_tx</TT>
- and incoming for
+CLASS="FUNCTION"
+>usbs_eth_start_tx</TT
+> and incoming for
 <TT
-CLASS="FUNCTION">
-usbs_eth_start_rx</TT>
-. This buffer should correspond
+CLASS="FUNCTION"
+>usbs_eth_start_rx</TT
+>. This buffer should correspond
 to the <A
-HREF="usbseth-protocol.html">
-protocol</A>
-:</P>
-<P>
-</P>
-<OL
-TYPE="1">
-<LI>
-<P>
-Outgoing packets can consist of up to 1516 bytes, consisting of a
+HREF="usbseth-protocol.html"
+>protocol</A
+>:</P
+><P
+></P
+><OL
+TYPE="1"
+><LI
+><P
+>Outgoing packets can consist of up to 1516 bytes, consisting of a
 two-byte header specific to USB-ethernet followed by a standard
 ethernet frame (a header with 6-byte destination address, 6-byte
 source address and a further two bytes, followed by a payload of
 up to 1500 bytes). The two-byte USB-ethernet header consists simply of
 the size of the ethernet frame, i.e. the size of the rest of the
 packet not including the USB-ethernet header, with the least
-significant byte first.</P>
-</LI>
-<LI>
-<P>
-For incoming packets the supplied buffer should usually be at least
+significant byte first.</P
+></LI
+><LI
+><P
+>For incoming packets the supplied buffer should usually be at least
 1516 bytes. There may be special circumstances in which a smaller
 buffer might be safe; for example, if the host-side device driver is
 modified to support only smaller packets. Once the packet has been
 received the buffer will contain a two-byte header specific to
 USB-ethernet, followed by a normal ethernet frame. The header
 gives the size of the ethernet frame, excluding the header, with the
-least significant byte first.</P>
-</LI>
-</OL>
-<P>
-Both <TT
-CLASS="FUNCTION">
-usbs_eth_start_tx</TT>
- and
+least significant byte first.</P
+></LI
+></OL
+><P
+>Both <TT
+CLASS="FUNCTION"
+>usbs_eth_start_tx</TT
+> and
 <TT
-CLASS="FUNCTION">
-usbs_eth_start_rx</TT>
- are asynchronous: the transfer
+CLASS="FUNCTION"
+>usbs_eth_start_rx</TT
+> are asynchronous: the transfer
 is started and, some time later, a completion function will be invoked.
 The third and fourth arguments to both
 <TT
-CLASS="FUNCTION">
-usbs_eth_start_tx</TT>
- and
+CLASS="FUNCTION"
+>usbs_eth_start_tx</TT
+> and
 <TT
-CLASS="FUNCTION">
-usbs_eth_start_rx</TT>
- supply the completion function
+CLASS="FUNCTION"
+>usbs_eth_start_rx</TT
+> supply the completion function
 and an argument to that function respectively. The completion function
 will be invoked with three arguments: a pointer to the
 <SPAN
-CLASS="STRUCTNAME">
-usbs_eth</SPAN>
- data structure, usually
+CLASS="STRUCTNAME"
+>usbs_eth</SPAN
+> data structure, usually
 <TT
-CLASS="LITERAL">
-usbs_eth0</TT>
-; the supplied completion data ; and a
+CLASS="LITERAL"
+>usbs_eth0</TT
+>; the supplied completion data ; and a
 return code field. A negative value indicates that an error occurred,
 for example <TT
-CLASS="LITERAL">
--EPIPE</TT>
- if the connection between USB
+CLASS="LITERAL"
+>-EPIPE</TT
+> if the connection between USB
 host and peripheral has been broken, or <TT
-CLASS="LITERAL">
--EAGAIN</TT>
- if
+CLASS="LITERAL"
+>-EAGAIN</TT
+> if
 an endpoint has been halted. A positive value indicates the total size
 of the transfer, which should correspond to the size in the
 USB-ethernet header plus an additional two bytes for the header
-itself.</P>
-<P>
-If the data transfer is succesful then the completion function will
+itself.</P
+><P
+>If the data transfer is succesful then the completion function will
 typically be invoked in DSR context rather than in thread context,
 although this depends on the implementation of the underlying USB
 device driver. Therefore the completion function is restricted in what
@@ -278,92 +282,93 @@ documentation should be consulted for mo
 interrupt handling generally. Note that if the transfer finishes
 quickly then the completion function may be invoked before
 <TT
-CLASS="FUNCTION">
-usbs_eth_start_rx</TT>
- or
+CLASS="FUNCTION"
+>usbs_eth_start_rx</TT
+> or
 <TT
-CLASS="FUNCTION">
-usbs_eth_start_tx</TT>
- returns. This is especially
+CLASS="FUNCTION"
+>usbs_eth_start_tx</TT
+> returns. This is especially
 likely to happen if the current thread is descheduled after starting
-the data transfer but before returning from these functions.</P>
-<P>
-For transmit operations, it is possible for
+the data transfer but before returning from these functions.</P
+><P
+>For transmit operations, it is possible for
 <TT
-CLASS="FUNCTION">
-usbs_eth_start_tx</TT>
- to invoke the completion
+CLASS="FUNCTION"
+>usbs_eth_start_tx</TT
+> to invoke the completion
 function immediately. If there is no current connection between host
 and target then the transmit will fail immediately with
 <TT
-CLASS="LITERAL">
--EPIPE</TT>
-. In addition the USB-ethernet package will
+CLASS="LITERAL"
+>-EPIPE</TT
+>. In addition the USB-ethernet package will
 check the destination MAC address and make sure that the ethernet
 frame really is intended for the host: either it must be for the
 address specified in the initialization call <A
-HREF="usbseth-init.html">
-<TT
-CLASS="FUNCTION">
-usbs_eth_init</TT>
-</A>
-, or
+HREF="usbseth-init.html"
+><TT
+CLASS="FUNCTION"
+>usbs_eth_init</TT
+></A
+>, or
 it must be a broadcast packet, or the host must have enabled
-promiscuous mode. </P>
-</DIV>
-<DIV
-CLASS="NAVFOOTER">
-<HR
+promiscuous mode. </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
 ALIGN="LEFT"
 WIDTH="100%"><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TD
+CELLSPACING="0"
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-<A
-HREF="usbseth-init.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="usbseth-init.html"
+>Prev</A
+></TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-<A
-HREF="io-usb-slave-eth.html">
-Home</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="io-usb-slave-eth.html"
+>Home</A
+></TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-<A
-HREF="usbseth-control.html">
-Next</A>
-</TD>
-</TR>
-<TR>
-<TD
+VALIGN="top"
+><A
+HREF="usbseth-control.html"
+>Next</A
+></TD
+></TR
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-Initializing the USB-ethernet Package</TD>
-<TD
+VALIGN="top"
+>Initializing the USB-ethernet Package</TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-&nbsp;</TD>
-<TD
+VALIGN="top"
+>&nbsp;</TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-USB-ethernet State Handling</TD>
-</TR>
-</TABLE>
-</DIV>
-</BODY>
-</HTML>
+VALIGN="top"
+>USB-ethernet State Handling</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
--- a/packages/io/usb/eth/slave/current/doc/usbseth-host.html
+++ b/packages/io/usb/eth/slave/current/doc/usbseth-host.html
@@ -2,20 +2,21 @@
 <!-- This material may be distributed only subject to the terms      -->
 <!-- and conditions set forth in the Open Publication License, v1.0  -->
 <!-- or later (the latest version is presently available at          -->
-<!-- http://www.opencontent.org/openpub/)                            -->
+<!-- http://www.opencontent.org/openpub/).                           -->
 <!-- Distribution of substantively modified versions of this         -->
 <!-- document is prohibited without the explicit permission of the   -->
 <!-- copyright holder.                                               -->
 <!-- Distribution of the work or derivative of the work in any       -->
 <!-- standard (paper) book form is prohibited unless prior           -->
-<!-- permission obtained from the copyright holder                   -->
-<HTML>
-<HEAD>
-<TITLE>
-Example Host-side Device Driver</TITLE>
-<META
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>Example Host-side Device Driver</TITLE
+><META
 NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.54"><LINK
+CONTENT="Modular DocBook HTML Stylesheet Version 1.64
+"><LINK
 REL="HOME"
 TITLE="eCos Support for Developing USB-ethernet Peripherals"
 HREF="io-usb-slave-eth.html"><LINK
@@ -24,303 +25,304 @@ TITLE="Network Device for the eCos TCP/I
 HREF="usbseth-netdev.html"><LINK
 REL="NEXT"
 TITLE="Communication Protocol"
-HREF="usbseth-protocol.html"></HEAD>
-<BODY
+HREF="usbseth-protocol.html"></HEAD
+><BODY
 CLASS="REFENTRY"
 BGCOLOR="#FFFFFF"
 TEXT="#000000"
 LINK="#0000FF"
 VLINK="#840084"
-ALINK="#0000FF">
-<DIV
-CLASS="NAVHEADER">
-<TABLE
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TH
+CELLSPACING="0"
+><TR
+><TH
 COLSPAN="3"
-ALIGN="center">
-eCos Support for Developing USB-ethernet Peripherals</TH>
-</TR>
-<TR>
-<TD
+ALIGN="center"
+>eCos Support for Developing USB-ethernet Peripherals</TH
+></TR
+><TR
+><TD
 WIDTH="10%"
 ALIGN="left"
-VALIGN="bottom">
-<A
-HREF="usbseth-netdev.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="bottom"
+><A
+HREF="usbseth-netdev.html"
+>Prev</A
+></TD
+><TD
 WIDTH="80%"
 ALIGN="center"
-VALIGN="bottom">
-</TD>
-<TD
+VALIGN="bottom"
+></TD
+><TD
 WIDTH="10%"
 ALIGN="right"
-VALIGN="bottom">
-<A
-HREF="usbseth-protocol.html">
-Next</A>
-</TD>
-</TR>
-</TABLE>
-<HR
+VALIGN="bottom"
+><A
+HREF="usbseth-protocol.html"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
 ALIGN="LEFT"
-WIDTH="100%"></DIV>
-<H1>
-<A
-NAME="USBSETH-HOST">
-Example Host-side Device Driver</A>
-</H1>
-<DIV
-CLASS="REFNAMEDIV">
-<A
-NAME="AEN240">
-</A>
-<H2>
-Name</H2>
-Example Host-side Device Driver&nbsp;--&nbsp;Provide host-side support for the eCos USB-ethernet package</DIV>
-<DIV
-CLASS="REFSECT1">
-<A
-NAME="AEN243">
-</A>
-<H2>
-Description</H2>
-<P>
-The USB-ethernet package is supplied with a single host-side device
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="USBSETH-HOST"
+>Example Host-side Device Driver</A
+></H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN242"
+></A
+><H2
+>Name</H2
+>Example Host-side Device Driver&nbsp;--&nbsp;Provide host-side support for the eCos USB-ethernet package</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN245"
+></A
+><H2
+>Description</H2
+><P
+>The USB-ethernet package is supplied with a single host-side device
 driver. This driver has been developed against the Linux kernel
 2.2.16-22, as shipped with Red Hat 7. The driver is provided as is and
 should not be considered production quality: for example it only
 checks for a bogus vendor id <TT
-CLASS="LITERAL">
-0x4242</TT>
- rather than an
+CLASS="LITERAL"
+>0x4242</TT
+> rather than an
 official vendor id supplied by the <A
 HREF="http://www.usb.org/"
-TARGET="_top">
-USB Implementers Forum</A>
-. Also, if the
+TARGET="_top"
+>USB Implementers Forum</A
+>. Also, if the
 peripheral involves multiple configurations or multiple interfaces, it
 will fail to detect this. However, the driver can be used for simple
 testing and as the basis of a full device driver. Details of the
 protocol used between host and peripheral can be found in the <A
-HREF="usbseth-protocol.html">
-Communication Protocol</A>
- section.</P>
-<P>
-The host-side device driver can be found in the <TT
-CLASS="FILENAME">
-host</TT>
- subdirectory of the USB-ethernet
+HREF="usbseth-protocol.html"
+>Communication Protocol</A
+> section.</P
+><P
+>The host-side device driver can be found in the <TT
+CLASS="FILENAME"
+>host</TT
+> subdirectory of the USB-ethernet
 package, specifically the file <TT
-CLASS="FILENAME">
-ecos_usbeth.c</TT>
-, and
+CLASS="FILENAME"
+>ecos_usbeth.c</TT
+>, and
 comes with a <TT
-CLASS="FILENAME">
-Makefile</TT>
-. Both files may need
+CLASS="FILENAME"
+>Makefile</TT
+>. Both files may need
 to be modified for specific applications. For example, the vendor id
 table <TT
-CLASS="LITERAL">
-ecos_usbeth_implementations</TT>
- may need to be
+CLASS="LITERAL"
+>ecos_usbeth_implementations</TT
+> may need to be
 updated for the specific USB peripheral being built. The
 <TT
-CLASS="FILENAME">
-Makefile</TT>
- assumes that the Linux kernel sources
+CLASS="FILENAME"
+>Makefile</TT
+> assumes that the Linux kernel sources
 reside in <TT
-CLASS="FILENAME">
-/usr/src/linux</TT>
-, and
+CLASS="FILENAME"
+>/usr/src/linux</TT
+>, and
 that the kernel has already been configured and built. Assuming this
 is the case, the device driver can be built simply by invoking
 <B
-CLASS="COMMAND">
-make</B>
- with no additional arguments. This will result
+CLASS="COMMAND"
+>make</B
+> with no additional arguments. This will result
 in a dynamically loadable kernel module,
 <TT
-CLASS="FILENAME">
-ecos_usbeth.o</TT>
-, in the current directory.</P>
-<DIV
-CLASS="NOTE">
-<BLOCKQUOTE
-CLASS="NOTE">
-<P>
-<B>
-Note: </B>
-As normal for Linux kernel builds, the generated files such as
+CLASS="FILENAME"
+>ecos_usbeth.o</TT
+>, in the current directory.</P
+><DIV
+CLASS="NOTE"
+><BLOCKQUOTE
+CLASS="NOTE"
+><P
+><B
+>Note: </B
+>As normal for Linux kernel builds, the generated files such as
 <TT
-CLASS="FILENAME">
-ecos_usbeth.o</TT>
- live in the same directory as the
+CLASS="FILENAME"
+>ecos_usbeth.o</TT
+> live in the same directory as the
 source tree. This is very different from eCos where the source tree
 (or component repository) is kept separate from any builds. There may
 be problems if the component repository is kept read-only or if it is
 put under source code control. Any such problems can be avoided by
 making a copy of the <TT
-CLASS="FILENAME">
-host</TT>
-
-subdirectory and building that copy.</P>
-</BLOCKQUOTE>
-</DIV>
-<P>
-Loading the kernel module into the current system requires root
+CLASS="FILENAME"
+>host</TT
+>
+subdirectory and building that copy.</P
+></BLOCKQUOTE
+></DIV
+><P
+>Loading the kernel module into the current system requires root
 privileges. If the generic USB support is also a loadable module and
-has not been loaded already, this must happen first:</P>
-<TABLE
+has not been loaded already, this must happen first:</P
+><TABLE
 BORDER="0"
 BGCOLOR="#E0E0E0"
-WIDTH="100%">
-<TR>
-<TD>
-<PRE
-CLASS="SCREEN">
-# insmod usb-uhci
-Using /lib/modules/2.2.16-22/usb/usb-uhci.o</PRE>
-</TD>
-</TR>
-</TABLE>
-<P>
-Depending on the host hardware, the <TT
-CLASS="LITERAL">
-uhci</TT>
- or
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+># insmod usb-uhci
+Using /lib/modules/2.2.16-22/usb/usb-uhci.o</PRE
+></TD
+></TR
+></TABLE
+><P
+>Depending on the host hardware, the <TT
+CLASS="LITERAL"
+>uhci</TT
+> or
 <TT
-CLASS="LITERAL">
-usb-ohci</TT>
- modules may be more appropriate. Loading
+CLASS="LITERAL"
+>usb-ohci</TT
+> modules may be more appropriate. Loading
 the generic USB module will typically result in a number of messages
 to the logfile <TT
-CLASS="FILENAME">
-/var/log/messages</TT>
-, giving details
+CLASS="FILENAME"
+>/var/log/messages</TT
+>, giving details
 of the specific host-side hardware that has been detected plus any
-hubs. The next step is to load the USB-ethernet module:</P>
-<TABLE
+hubs. The next step is to load the USB-ethernet module:</P
+><TABLE
 BORDER="0"
 BGCOLOR="#E0E0E0"
-WIDTH="100%">
-<TR>
-<TD>
-<PRE
-CLASS="SCREEN">
-# insmod ecos_usbeth.o</PRE>
-</TD>
-</TR>
-</TABLE>
-<P>
-This should result in a number of additional diagnostics in the
-logfile:</P>
-<TABLE
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+># insmod ecos_usbeth.o</PRE
+></TD
+></TR
+></TABLE
+><P
+>This should result in a number of additional diagnostics in the
+logfile:</P
+><TABLE
 BORDER="0"
 BGCOLOR="#E0E0E0"
-WIDTH="100%">
-<TR>
-<TD>
-<PRE
-CLASS="SCREEN">
-Apr 1 18:01:08 grumpy kernel: eCos USB-ethernet device driver
-Apr 1 18:01:08 grumpy kernel: usb.c: registered new driver ecos_usbeth</PRE>
-</TD>
-</TR>
-</TABLE>
-<P>
-If a suitable USB peripheral is now connected the host will detect
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+>Apr 1 18:01:08 grumpy kernel: eCos USB-ethernet device driver
+Apr 1 18:01:08 grumpy kernel: usb.c: registered new driver ecos_usbeth</PRE
+></TD
+></TR
+></TABLE
+><P
+>If a suitable USB peripheral is now connected the host will detect
 this, assign an address in the local USB network, obtain enumeration
 data, and find a suitable device driver. Assuming the peripheral and
 device driver agree on the supported vendor ids, the
 <TT
-CLASS="FILENAME">
-ecos_usbeth.o</TT>
- module will be selected and this
-will be reported in the system log:</P>
-<TABLE
+CLASS="FILENAME"
+>ecos_usbeth.o</TT
+> module will be selected and this
+will be reported in the system log:</P
+><TABLE
 BORDER="0"
 BGCOLOR="#E0E0E0"
-WIDTH="100%">
-<TR>
-<TD>
-<PRE
-CLASS="SCREEN">
-Apr 1 18:04:12 grumpy kernel: usb.c: USB new device connect, assigned device number 3
-Apr 1 18:04:12 grumpy kernel: eCos-based USB ethernet peripheral active at eth1</PRE>
-</TD>
-</TR>
-</TABLE>
-<P>
-What can happen next depends very much on the software that is running
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+>Apr 1 18:04:12 grumpy kernel: usb.c: USB new device connect, assigned device number 3
+Apr 1 18:04:12 grumpy kernel: eCos-based USB ethernet peripheral active at eth1</PRE
+></TD
+></TR
+></TABLE
+><P
+>What can happen next depends very much on the software that is running
 on top of the USB-ethernet package inside the peripheral. For example,
 if there is a TCP/IP stack then it should be possible to bring up a
 network connection between host and peripheral using
 <B
-CLASS="COMMAND">
-ifconfig</B>
-.</P>
-</DIV>
-<DIV
-CLASS="NAVFOOTER">
-<HR
+CLASS="COMMAND"
+>ifconfig</B
+>.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
 ALIGN="LEFT"
 WIDTH="100%"><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TD
+CELLSPACING="0"
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-<A
-HREF="usbseth-netdev.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="usbseth-netdev.html"
+>Prev</A
+></TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-<A
-HREF="io-usb-slave-eth.html">
-Home</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="io-usb-slave-eth.html"
+>Home</A
+></TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-<A
-HREF="usbseth-protocol.html">
-Next</A>
-</TD>
-</TR>
-<TR>
-<TD
+VALIGN="top"
+><A
+HREF="usbseth-protocol.html"
+>Next</A
+></TD
+></TR
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-Network Device for the eCos TCP/IP Stack</TD>
-<TD
+VALIGN="top"
+>Network Device for the eCos TCP/IP Stack</TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-&nbsp;</TD>
-<TD
+VALIGN="top"
+>&nbsp;</TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-Communication Protocol</TD>
-</TR>
-</TABLE>
-</DIV>
-</BODY>
-</HTML>
+VALIGN="top"
+>Communication Protocol</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
--- a/packages/io/usb/eth/slave/current/doc/usbseth-init.html
+++ b/packages/io/usb/eth/slave/current/doc/usbseth-init.html
@@ -2,20 +2,21 @@
 <!-- This material may be distributed only subject to the terms      -->
 <!-- and conditions set forth in the Open Publication License, v1.0  -->
 <!-- or later (the latest version is presently available at          -->
-<!-- http://www.opencontent.org/openpub/)                            -->
+<!-- http://www.opencontent.org/openpub/).                           -->
 <!-- Distribution of substantively modified versions of this         -->
 <!-- document is prohibited without the explicit permission of the   -->
 <!-- copyright holder.                                               -->
 <!-- Distribution of the work or derivative of the work in any       -->
 <!-- standard (paper) book form is prohibited unless prior           -->
-<!-- permission obtained from the copyright holder                   -->
-<HTML>
-<HEAD>
-<TITLE>
-Initializing the USB-ethernet Package</TITLE>
-<META
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>Initializing the USB-ethernet Package</TITLE
+><META
 NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.54"><LINK
+CONTENT="Modular DocBook HTML Stylesheet Version 1.64
+"><LINK
 REL="HOME"
 TITLE="eCos Support for Developing USB-ethernet Peripherals"
 HREF="io-usb-slave-eth.html"><LINK
@@ -24,120 +25,123 @@ TITLE="Introduction"
 HREF="usbseth-intro.html"><LINK
 REL="NEXT"
 TITLE="USB-ethernet Data Transfers"
-HREF="usbseth-data.html"></HEAD>
-<BODY
+HREF="usbseth-data.html"></HEAD
+><BODY
 CLASS="REFENTRY"
 BGCOLOR="#FFFFFF"
 TEXT="#000000"
 LINK="#0000FF"
 VLINK="#840084"
-ALINK="#0000FF">
-<DIV
-CLASS="NAVHEADER">
-<TABLE
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TH
+CELLSPACING="0"
+><TR
+><TH
 COLSPAN="3"
-ALIGN="center">
-eCos Support for Developing USB-ethernet Peripherals</TH>
-</TR>
-<TR>
-<TD
+ALIGN="center"
+>eCos Support for Developing USB-ethernet Peripherals</TH
+></TR
+><TR
+><TD
 WIDTH="10%"
 ALIGN="left"
-VALIGN="bottom">
-<A
-HREF="usbseth-intro.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="bottom"
+><A
+HREF="usbseth-intro.html"
+>Prev</A
+></TD
+><TD
 WIDTH="80%"
 ALIGN="center"
-VALIGN="bottom">
-</TD>
-<TD
+VALIGN="bottom"
+></TD
+><TD
 WIDTH="10%"
 ALIGN="right"
-VALIGN="bottom">
-<A
-HREF="usbseth-data.html">
-Next</A>
-</TD>
-</TR>
-</TABLE>
-<HR
+VALIGN="bottom"
+><A
+HREF="usbseth-data.html"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
 ALIGN="LEFT"
-WIDTH="100%"></DIV>
-<H1>
-<A
-NAME="USBSETH-INIT">
-Initializing the USB-ethernet Package</A>
-</H1>
-<DIV
-CLASS="REFNAMEDIV">
-<A
-NAME="AEN47">
-</A>
-<H2>
-Name</H2>
-<TT
-CLASS="FUNCTION">
-usbs_eth_init</TT>
-&nbsp;--&nbsp;Initializing the USB-ethernet Package</DIV>
-<DIV
-CLASS="REFSYNOPSISDIV">
-<A
-NAME="AEN51">
-</A>
-<H2>
-Synopsis</H2>
-<DIV
-CLASS="FUNCSYNOPSIS">
-<P>
-</P>
-<TABLE
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="USBSETH-INIT"
+>Initializing the USB-ethernet Package</A
+></H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN47"
+></A
+><H2
+>Name</H2
+><TT
+CLASS="FUNCTION"
+>usbs_eth_init</TT
+>&nbsp;--&nbsp;Initializing the USB-ethernet Package</DIV
+><DIV
+CLASS="REFSYNOPSISDIV"
+><A
+NAME="AEN51"
+></A
+><H2
+>Synopsis</H2
+><DIV
+CLASS="FUNCSYNOPSIS"
+><A
+NAME="AEN52"
+></A
+><P
+></P
+><TABLE
 BORDER="0"
 BGCOLOR="#E0E0E0"
-WIDTH="100%">
-<TR>
-<TD>
-<PRE
-CLASS="FUNCSYNOPSISINFO">
-#include &lt;cyg/io/usb/usbs_eth.h&gt;</PRE>
-</TD>
-</TR>
-</TABLE>
-<P>
-<CODE>
-<CODE
-CLASS="FUNCDEF">
-void usbs_eth_init</CODE>
-(usbs_eth* usbeth, usbs_control_endpoint* ep0, usbs_rx_endpoint* ep1, usbs_tx_endpoint* ep2, unsigned char* mac_address);</CODE>
-</P>
-<P>
-</P>
-</DIV>
-</DIV>
-<DIV
-CLASS="REFSECT1">
-<A
-NAME="AEN67">
-</A>
-<H2>
-Description</H2>
-<P>
-The USB-ethernet package is not tied to any specific hardware. It
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="FUNCSYNOPSISINFO"
+>#include &lt;cyg/io/usb/usbs_eth.h&gt;</PRE
+></TD
+></TR
+></TABLE
+><P
+><CODE
+><CODE
+CLASS="FUNCDEF"
+>void usbs_eth_init</CODE
+>(usbs_eth* usbeth, usbs_control_endpoint* ep0, usbs_rx_endpoint* ep1, usbs_tx_endpoint* ep2, unsigned char* mac_address);</CODE
+></P
+><P
+></P
+></DIV
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN67"
+></A
+><H2
+>Description</H2
+><P
+>The USB-ethernet package is not tied to any specific hardware. It
 requires certain functionality: there must be USB-slave hardware
 supported by a device driver; there must also be two endpoints for
 bulk transfers between host and peripheral, one for each direction;
 there must also be a control endpoint, although of course that is
-implicit with any USB hardware.</P>
-<P>
-However, USB-slave hardware may well provide more endpoints than the
+implicit with any USB hardware.</P
+><P
+>However, USB-slave hardware may well provide more endpoints than the
 minimum required for ethernet support. Some of those endpoints might
 be used by other packages, while other endpoints might be used
 directly by the application, or might not be needed for the peripheral
@@ -147,34 +151,34 @@ only some of those configurations. The U
 knowledge about any of this, so it relies on higher-level code to tell
 it which endpoints should be used and other information. This is the
 purpose of the <TT
-CLASS="FUNCTION">
-usbs_eth_init</TT>
- function.</P>
-<P>
-The first argument identifies the specific
+CLASS="FUNCTION"
+>usbs_eth_init</TT
+> function.</P
+><P
+>The first argument identifies the specific
 <SPAN
-CLASS="STRUCTNAME">
-usbs_eth</SPAN>
- data structure that is affected. It
+CLASS="STRUCTNAME"
+>usbs_eth</SPAN
+> data structure that is affected. It
 is expected that the vast majority of affected applications will only
 provide a single USB-ethernet device to a single host, and the package
 automatically provides a suitable data structure
 <TT
-CLASS="LITERAL">
-usbs_eth0</TT>
- to support this. If multiple
+CLASS="LITERAL"
+>usbs_eth0</TT
+> to support this. If multiple
 <SPAN
-CLASS="STRUCTNAME">
-usbs_eth</SPAN>
- structures are needed for some
+CLASS="STRUCTNAME"
+>usbs_eth</SPAN
+> structures are needed for some
 reason then these need to be instantiated by other code, and each one
 needs to be initialised by a call to
 <TT
-CLASS="FUNCTION">
-usbs_eth_init()</TT>
-. </P>
-<P>
-The next three arguments identify the endpoints that should be used
+CLASS="FUNCTION"
+>usbs_eth_init()</TT
+>. </P
+><P
+>The next three arguments identify the endpoints that should be used
 for USB communications: a control endpoint, a receive endpoint for
 ethernet packets coming from the host to the peripheral, and a
 transmit endpoint for ethernet packets going in the other direction.
@@ -182,72 +186,72 @@ Obviously all three endpoints should be 
 hardware. The USB-ethernet package assumes that it has sole access to
 the receive and transmit endpoints, subject to the use of
 <TT
-CLASS="FUNCTION">
-usbs_eth_disable</TT>
- and
+CLASS="FUNCTION"
+>usbs_eth_disable</TT
+> and
 <TT
-CLASS="FUNCTION">
-usbs_eth_enable</TT>
- control functions. The package
+CLASS="FUNCTION"
+>usbs_eth_enable</TT
+> control functions. The package
 also assumes that no other code is interested in USB state changes or
 class control messages: it installs handlers
 <A
-HREF="usbseth-control.html">
-<TT
-CLASS="FUNCTION">
-usbs_eth_state_change_handler</TT>
-</A>
-
+HREF="usbseth-control.html"
+><TT
+CLASS="FUNCTION"
+>usbs_eth_state_change_handler</TT
+></A
+>
 and
 <A
-HREF="usbseth-control.html">
-<TT
-CLASS="FUNCTION">
-usbs_eth_class_control_handler</TT>
-</A>
-
+HREF="usbseth-control.html"
+><TT
+CLASS="FUNCTION"
+>usbs_eth_class_control_handler</TT
+></A
+>
 in the control endpoint. If any other code does need to handle USB
 state changes or class control messages then replacement handlers
 should be installed after the call to
 <TT
-CLASS="FUNCTION">
-usbs_eth_init</TT>
-, and those replacements should
-invoke the USB-ethernet ones when appropriate.</P>
-<P>
-The final argument to <TT
-CLASS="FUNCTION">
-usbs_eth_init</TT>
- specifies 
+CLASS="FUNCTION"
+>usbs_eth_init</TT
+>, and those replacements should
+invoke the USB-ethernet ones when appropriate.</P
+><P
+>The final argument to <TT
+CLASS="FUNCTION"
+>usbs_eth_init</TT
+> specifies 
 the MAC address (or Ethernet Station Address) that should be provided
 to the host-side device driver. Since the USB-ethernet package does not
 interact directly with a real ethernet device it cannot obtain the MAC
 address from any hardware. Instead, it must be supplied by higher-level
 code. The details depend on the <A
-HREF="usbseth-intro.html#AEN22">
-scenario</A>
- in which the
-USB-ethernet package is being used.</P>
-<P>
-The call to <TT
-CLASS="FUNCTION">
-usbs_eth_init</TT>
- should normally happen
+HREF="usbseth-intro.html#AEN22"
+>scenario</A
+> in which the
+USB-ethernet package is being used.</P
+><P
+>The call to <TT
+CLASS="FUNCTION"
+>usbs_eth_init</TT
+> should normally happen
 after the enumeration data has been provided but before the underlying
 USB device driver has been started. If the USB device were to be
 started first then a connection between host and peripheral could be
 established immediately, and the host-side device driver would attempt
 to contact the USB-ethernet package for information such as the MAC
-address. </P>
-<TABLE
+address. </P
+><TABLE
 BORDER="0"
 BGCOLOR="#E0E0E0"
-WIDTH="100%">
-<TR>
-<TD>
-<PRE
-CLASS="PROGRAMLISTING">
-int
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>int
 main(int argc, char** argv)
 {
     unsigned char host_MAC[6] = { 0x40, 0x5d, 0x90, 0xa9, 0xbc, 0x02 };
@@ -258,64 +262,65 @@ main(int argc, char** argv)
     &#8230;
     usbs_start(&amp;usbs_sa11x0_ep0);
     &#8230;
-}</PRE>
-</TD>
-</TR>
-</TABLE>
-</DIV>
-<DIV
-CLASS="NAVFOOTER">
-<HR
+}</PRE
+></TD
+></TR
+></TABLE
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
 ALIGN="LEFT"
 WIDTH="100%"><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TD
+CELLSPACING="0"
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-<A
-HREF="usbseth-intro.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="usbseth-intro.html"
+>Prev</A
+></TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-<A
-HREF="io-usb-slave-eth.html">
-Home</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="io-usb-slave-eth.html"
+>Home</A
+></TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-<A
-HREF="usbseth-data.html">
-Next</A>
-</TD>
-</TR>
-<TR>
-<TD
+VALIGN="top"
+><A
+HREF="usbseth-data.html"
+>Next</A
+></TD
+></TR
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-Introduction</TD>
-<TD
+VALIGN="top"
+>Introduction</TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-&nbsp;</TD>
-<TD
+VALIGN="top"
+>&nbsp;</TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-USB-ethernet Data Transfers</TD>
-</TR>
-</TABLE>
-</DIV>
-</BODY>
-</HTML>
+VALIGN="top"
+>USB-ethernet Data Transfers</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
--- a/packages/io/usb/eth/slave/current/doc/usbseth-intro.html
+++ b/packages/io/usb/eth/slave/current/doc/usbseth-intro.html
@@ -2,20 +2,21 @@
 <!-- This material may be distributed only subject to the terms      -->
 <!-- and conditions set forth in the Open Publication License, v1.0  -->
 <!-- or later (the latest version is presently available at          -->
-<!-- http://www.opencontent.org/openpub/)                            -->
+<!-- http://www.opencontent.org/openpub/).                           -->
 <!-- Distribution of substantively modified versions of this         -->
 <!-- document is prohibited without the explicit permission of the   -->
 <!-- copyright holder.                                               -->
 <!-- Distribution of the work or derivative of the work in any       -->
 <!-- standard (paper) book form is prohibited unless prior           -->
-<!-- permission obtained from the copyright holder                   -->
-<HTML>
-<HEAD>
-<TITLE>
-Introduction</TITLE>
-<META
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>Introduction</TITLE
+><META
 NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.54"><LINK
+CONTENT="Modular DocBook HTML Stylesheet Version 1.64
+"><LINK
 REL="HOME"
 TITLE="eCos Support for Developing USB-ethernet Peripherals"
 HREF="io-usb-slave-eth.html"><LINK
@@ -24,208 +25,214 @@ TITLE="eCos Support for Developing USB-e
 HREF="io-usb-slave-eth.html"><LINK
 REL="NEXT"
 TITLE="Initializing the USB-ethernet Package"
-HREF="usbseth-init.html"></HEAD>
-<BODY
+HREF="usbseth-init.html"></HEAD
+><BODY
 CLASS="REFENTRY"
 BGCOLOR="#FFFFFF"
 TEXT="#000000"
 LINK="#0000FF"
 VLINK="#840084"
-ALINK="#0000FF">
-<DIV
-CLASS="NAVHEADER">
-<TABLE
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TH
+CELLSPACING="0"
+><TR
+><TH
 COLSPAN="3"
-ALIGN="center">
-eCos Support for Developing USB-ethernet Peripherals</TH>
-</TR>
-<TR>
-<TD
+ALIGN="center"
+>eCos Support for Developing USB-ethernet Peripherals</TH
+></TR
+><TR
+><TD
 WIDTH="10%"
 ALIGN="left"
-VALIGN="bottom">
-<A
-HREF="io-usb-slave-eth.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="bottom"
+><A
+HREF="io-usb-slave-eth.html"
+>Prev</A
+></TD
+><TD
 WIDTH="80%"
 ALIGN="center"
-VALIGN="bottom">
-</TD>
-<TD
+VALIGN="bottom"
+></TD
+><TD
 WIDTH="10%"
 ALIGN="right"
-VALIGN="bottom">
-<A
-HREF="usbseth-init.html">
-Next</A>
-</TD>
-</TR>
-</TABLE>
-<HR
+VALIGN="bottom"
+><A
+HREF="usbseth-init.html"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
 ALIGN="LEFT"
-WIDTH="100%"></DIV>
-<H1>
-<A
-NAME="USBSETH-INTRO">
-Introduction</A>
-</H1>
-<DIV
-CLASS="REFNAMEDIV">
-<A
-NAME="AEN6">
-</A>
-<H2>
-Name</H2>
-Introduction&nbsp;--&nbsp;eCos support for developing USB ethernet peripherals</DIV>
-<DIV
-CLASS="REFSECT1">
-<A
-NAME="AEN9">
-</A>
-<H2>
-Introduction</H2>
-<P>
-The eCos USB-ethernet package provides additional support for USB
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="USBSETH-INTRO"
+>Introduction</A
+></H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN6"
+></A
+><H2
+>Name</H2
+>Introduction&nbsp;--&nbsp;eCos support for developing USB ethernet peripherals</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN9"
+></A
+><H2
+>Introduction</H2
+><P
+>The eCos USB-ethernet package provides additional support for USB
 peripherals that involve some sort of ethernet-style network. This can
 be a traditional ethernet, or it can involve some other networking
 technology that uses ethernet frames as a unit of transfer. It
 provides functions to transfer ethernet frames over the USB bus,
 handles certain control messages from the host, and optionally it can
 provide a network device driver for use by the eCos TCP/IP stack.
-The package comes with an example host-side device driver.</P>
-<P>
-The USB-ethernet package is not tied to any specific hardware. It
+The package comes with an example host-side device driver.</P
+><P
+>The USB-ethernet package is not tied to any specific hardware. It
 requires the presence of USB hardware and a suitable device driver,
 but not all USB peripherals involve ethernet communications. Hence the
 configuration system cannot load the package automatically for
 specific targets, in the way that a USB device driver or an ethernet
 driver can be loaded automatically. Instead, the package has to be
 added explicitly. When using the command line tools this will involve
-an operation like the following:</P>
-<TABLE
+an operation like the following:</P
+><TABLE
 BORDER="0"
 BGCOLOR="#E0E0E0"
-WIDTH="100%">
-<TR>
-<TD>
-<PRE
-CLASS="SCREEN">
-$ ecosconfig add usbs_eth</PRE>
-</TD>
-</TR>
-</TABLE>
-<P>
-Typically, this will automatically cause the USB device driver to
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+>$ ecosconfig add usbs_eth</PRE
+></TD
+></TR
+></TABLE
+><P
+>Typically, this will automatically cause the USB device driver to
 become active. Loading the USB-ethernet package automatically provides
 functionality for <A
-HREF="usbseth-init.html">
-initialization</A>
-,
+HREF="usbseth-init.html"
+>initialization</A
+>,
 <A
-HREF="usbseth-data.html">
-data transfer</A>
-, and the handling of
+HREF="usbseth-data.html"
+>data transfer</A
+>, and the handling of
 <A
-HREF="usbseth-control.html">
-control messages</A>
- and state
+HREF="usbseth-control.html"
+>control messages</A
+> and state
 changes. If the current configuration includes the eCos TCP/IP stack
 then the <A
-HREF="usbseth-netdev.html">
-network device driver</A>
-
+HREF="usbseth-netdev.html"
+>network device driver</A
+>
 support will be enabled as well by default, allowing the stack to
-exchange ethernet frames over the USB bus.</P>
-<P>
-There is a USB standard for a class of communication devices including
+exchange ethernet frames over the USB bus.</P
+><P
+>There is a USB standard for a class of communication devices including
 ethernet. The package does not implement this standard, due to
 limitations in the hardware for which the package was first developed.
 Instead, the package uses its own <A
-HREF="usbseth-protocol.html">
-protocol</A>
- between USB
+HREF="usbseth-protocol.html"
+>protocol</A
+> between USB
 <A
-HREF="usbseth-host.html">
-host device driver</A>
- and the
-peripheral. </P>
-</DIV>
-<DIV
-CLASS="REFSECT1">
-<A
-NAME="AEN22">
-</A>
-<H2>
-Usage Scenarios</H2>
-<P>
-The USB-ethernet package can be used several different scenarios. In
+HREF="usbseth-host.html"
+>host device driver</A
+> and the
+peripheral. </P
+></DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN22"
+></A
+><H2
+>Usage Scenarios</H2
+><P
+>The USB-ethernet package can be used several different scenarios. In
 a simple scenario, the peripheral serves only to connect the USB host
-to a suitable network:</P>
-<DIV
-CLASS="INFORMALFIGURE">
-<P>
-</P>
-<DIV
-CLASS="MEDIAOBJECT">
-<P>
-<IMG
-SRC="simple.gif">
-</IMG>
-</P>
-</DIV>
-<P>
-</P>
-</DIV>
-<P>
-After initialization, and once the USB connection between host and
+to a suitable network:</P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN25"
+></A
+><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="simple.gif"
+></IMG
+></P
+></DIV
+><P
+></P
+></DIV
+><P
+>After initialization, and once the USB connection between host and
 peripheral has been established, higher-level code needs to detect
 packets that are intended for the host, and to forward these. This can
 be achieved by the low-level <TT
-CLASS="FUNCTION">
-usbs_eth_start_tx</TT>
-
+CLASS="FUNCTION"
+>usbs_eth_start_tx</TT
+>
 function. Similarly, higher-level code needs to detect packets coming
 from the host, using <TT
-CLASS="FUNCTION">
-usbs_eth_start_rx</TT>
-, and to
+CLASS="FUNCTION"
+>usbs_eth_start_rx</TT
+>, and to
 forward these using the real network. As far as the host is concerned
 it is connected directly to the network. In this scenario there is no
 confusion about addresses: there is a single MAC address for the
 host/peripheral combination, corresponding to the connection to the
 real network, and it is this address which should be supplied during
 <A
-HREF="usbseth-init.html">
-initialization</A>
-.</P>
-<P>
-In a more complicated scenario, there is a TCP/IP stack running inside
-the peripheral.</P>
-<DIV
-CLASS="INFORMALFIGURE">
-<P>
-</P>
-<DIV
-CLASS="MEDIAOBJECT">
-<P>
-<IMG
-SRC="tcpip.gif">
-</IMG>
-</P>
-</DIV>
-<P>
-</P>
-</DIV>
-<P>
-This involves the USB-ethernet package providing a service both to the
+HREF="usbseth-init.html"
+>initialization</A
+>.</P
+><P
+>In a more complicated scenario, there is a TCP/IP stack running inside
+the peripheral.</P
+><DIV
+CLASS="INFORMALFIGURE"
+><A
+NAME="AEN36"
+></A
+><P
+></P
+><DIV
+CLASS="MEDIAOBJECT"
+><P
+><IMG
+SRC="tcpip.gif"
+></IMG
+></P
+></DIV
+><P
+></P
+></DIV
+><P
+>This involves the USB-ethernet package providing a service both to the
 host and to the eCos TCP/IP stack. It achieves the latter by acting as
 an eCos network device. Typically, the TCP/IP stack will be configured
 to act as a network bridge. The USB peripheral needs to examine the
@@ -239,68 +246,69 @@ stack inside the peripheral. Packets gen
 TCP/IP stack may need to be sent via the real network or over the USB
 bus. The network bridge software will have to take care of all these
 possibilities. Unusually for a network bridge, one of the network
-segments being bridged will only ever have one machine attached.</P>
-<P>
-There are other possible usage scenarios. For example, the peripheral
+segments being bridged will only ever have one machine attached.</P
+><P
+>There are other possible usage scenarios. For example, the peripheral
 might not be attached to a real network at all. Instead it could be
 the USB host that acts as a network bridge, allowing a TCP/IP stack
 inside the peripheral to communicate with the outside world. The
 various details will depend on the exact type of peripheral being
-developed. </P>
-</DIV>
-<DIV
-CLASS="NAVFOOTER">
-<HR
+developed. </P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
 ALIGN="LEFT"
 WIDTH="100%"><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TD
+CELLSPACING="0"
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-<A
-HREF="io-usb-slave-eth.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="io-usb-slave-eth.html"
+>Prev</A
+></TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-<A
-HREF="io-usb-slave-eth.html">
-Home</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="io-usb-slave-eth.html"
+>Home</A
+></TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-<A
-HREF="usbseth-init.html">
-Next</A>
-</TD>
-</TR>
-<TR>
-<TD
+VALIGN="top"
+><A
+HREF="usbseth-init.html"
+>Next</A
+></TD
+></TR
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-eCos Support for Developing USB-ethernet Peripherals</TD>
-<TD
+VALIGN="top"
+>eCos Support for Developing USB-ethernet Peripherals</TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-&nbsp;</TD>
-<TD
+VALIGN="top"
+>&nbsp;</TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-Initializing the USB-ethernet Package</TD>
-</TR>
-</TABLE>
-</DIV>
-</BODY>
-</HTML>
+VALIGN="top"
+>Initializing the USB-ethernet Package</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
--- a/packages/io/usb/eth/slave/current/doc/usbseth-netdev.html
+++ b/packages/io/usb/eth/slave/current/doc/usbseth-netdev.html
@@ -2,20 +2,21 @@
 <!-- This material may be distributed only subject to the terms      -->
 <!-- and conditions set forth in the Open Publication License, v1.0  -->
 <!-- or later (the latest version is presently available at          -->
-<!-- http://www.opencontent.org/openpub/)                            -->
+<!-- http://www.opencontent.org/openpub/).                           -->
 <!-- Distribution of substantively modified versions of this         -->
 <!-- document is prohibited without the explicit permission of the   -->
 <!-- copyright holder.                                               -->
 <!-- Distribution of the work or derivative of the work in any       -->
 <!-- standard (paper) book form is prohibited unless prior           -->
-<!-- permission obtained from the copyright holder                   -->
-<HTML>
-<HEAD>
-<TITLE>
-Network Device for the eCos TCP/IP Stack</TITLE>
-<META
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>Network Device for the eCos TCP/IP Stack</TITLE
+><META
 NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.54"><LINK
+CONTENT="Modular DocBook HTML Stylesheet Version 1.64
+"><LINK
 REL="HOME"
 TITLE="eCos Support for Developing USB-ethernet Peripherals"
 HREF="io-usb-slave-eth.html"><LINK
@@ -24,177 +25,195 @@ TITLE="USB-ethernet State Handling"
 HREF="usbseth-control.html"><LINK
 REL="NEXT"
 TITLE="Example Host-side Device Driver"
-HREF="usbseth-host.html"></HEAD>
-<BODY
+HREF="usbseth-host.html"></HEAD
+><BODY
 CLASS="REFENTRY"
 BGCOLOR="#FFFFFF"
 TEXT="#000000"
 LINK="#0000FF"
 VLINK="#840084"
-ALINK="#0000FF">
-<DIV
-CLASS="NAVHEADER">
-<TABLE
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TH
+CELLSPACING="0"
+><TR
+><TH
 COLSPAN="3"
-ALIGN="center">
-eCos Support for Developing USB-ethernet Peripherals</TH>
-</TR>
-<TR>
-<TD
+ALIGN="center"
+>eCos Support for Developing USB-ethernet Peripherals</TH
+></TR
+><TR
+><TD
 WIDTH="10%"
 ALIGN="left"
-VALIGN="bottom">
-<A
-HREF="usbseth-control.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="bottom"
+><A
+HREF="usbseth-control.html"
+>Prev</A
+></TD
+><TD
 WIDTH="80%"
 ALIGN="center"
-VALIGN="bottom">
-</TD>
-<TD
+VALIGN="bottom"
+></TD
+><TD
 WIDTH="10%"
 ALIGN="right"
-VALIGN="bottom">
-<A
-HREF="usbseth-host.html">
-Next</A>
-</TD>
-</TR>
-</TABLE>
-<HR
+VALIGN="bottom"
+><A
+HREF="usbseth-host.html"
+>Next</A
+></TD
+></TR
+></TABLE
+><HR
 ALIGN="LEFT"
-WIDTH="100%"></DIV>
-<H1>
-<A
-NAME="USBSETH-NETDEV">
-Network Device for the eCos TCP/IP Stack</A>
-</H1>
-<DIV
-CLASS="REFNAMEDIV">
-<A
-NAME="AEN221">
-</A>
-<H2>
-Name</H2>
-Network Device&nbsp;--&nbsp;USB-ethernet support for the eCos TCP/IP Stack</DIV>
-<DIV
-CLASS="REFSECT1">
-<A
-NAME="AEN224">
-</A>
-<H2>
-Description</H2>
-<P>
-If the USB peripheral involves running the eCos TCP/IP stack and that
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="USBSETH-NETDEV"
+>Network Device for the eCos TCP/IP Stack</A
+></H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN221"
+></A
+><H2
+>Name</H2
+>Network Device&nbsp;--&nbsp;USB-ethernet support for the eCos TCP/IP Stack</DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN224"
+></A
+><H2
+>Description</H2
+><P
+>If the USB peripheral involves running the eCos TCP/IP stack and that
 stack needs to use USB-ethernet as a transport layer (or as one of the
 transports), then the USB-ethernet package can provide a suitable
 network device driver. It is still necessary for higher-level code to
 perform appropriate initialization by calling <A
-HREF="usbseth-init.html">
-<TT
-CLASS="FUNCTION">
-usbs_eth_init</TT>
-</A>
-, but
+HREF="usbseth-init.html"
+><TT
+CLASS="FUNCTION"
+>usbs_eth_init</TT
+></A
+>, but
 after that it will be the TCP/IP stack rather than application code
-that transmits or receives ethernet frames.</P>
-<P>
-Not all peripherals involving the USB-ethernet package will require a
+that transmits or receives ethernet frames.</P
+><P
+>Not all peripherals involving the USB-ethernet package will require a
 TCP/IP stack. Hence the provision of the network device is controlled
 by a configuration option <TT
-CLASS="LITERAL">
-CYGPKG_USBS_ETHDRV</TT>
-. By
+CLASS="LITERAL"
+>CYGPKG_USBS_ETHDRV</TT
+>. By
 default this will be enabled if the TCP/IP package
 <TT
-CLASS="LITERAL">
-CYGPKG_NET</TT>
- is loaded, and disabled otherwise. </P>
-<P>
-There are a number of other configuration options related to the
+CLASS="LITERAL"
+>CYGPKG_NET</TT
+> is loaded, and disabled otherwise. </P
+><P
+>There are a number of other configuration options related to the
 network device. <TT
-CLASS="LITERAL">
-CYGFUN_USBS_ETHDRV_STATISTICS</TT>
-
+CLASS="LITERAL"
+>CYGFUN_USBS_ETHDRV_STATISTICS</TT
+>
 determines whether or not the package will maintain statistics, mainly
 intended for SNMP: by default this will be enabled if the SNMP support
 package <TT
-CLASS="LITERAL">
-CYGPKG_SNMPAGENT</TT>
- is loaded, and disabled
+CLASS="LITERAL"
+>CYGPKG_SNMPAGENT</TT
+> is loaded, and disabled
 otherwise. The name of the ethernet device is controlled by
 <TT
-CLASS="LITERAL">
-CYGDATA_USBS_ETHDRV_NAME</TT>
-, and has a default value
-of <TT
-CLASS="LITERAL">
-eth0</TT>
-. If there are other network device drivers
-present in the configuration then it is the responsibility of the
-application developer to give each device a unique name.</P>
-</DIV>
-<DIV
-CLASS="NAVFOOTER">
-<HR
+CLASS="LITERAL"
+>CYGDATA_USBS_ETHDRV_NAME</TT
+>, and has a default value
+of either <TT
+CLASS="LITERAL"
+>eth0</TT
+> or <TT
+CLASS="LITERAL"
+>eth1</TT
+>
+depending on whether or not there is another network device driver
+present in the configuration.</P
+><P
+>Usually eCos network device drivers default to using DHCP for
+obtaining necessary information such as IP addresses. This is not
+appropriate for USB-ethernet devices. On the host-side the
+USB-ethernet network device will not exist until the USB peripheral
+has been plugged in and communication has been established. Therefore
+any DHCP daemon on the host would not be listening on that network
+device at the point that eCos requests its IP and other information. A
+related issue is that the use of DHCP would imply the presence of a
+DHCP daemon on every affected host machine, as opposed to a single
+daemon (plus backups) for the network as a whole. For these reasons
+the USB-ethernet package precludes the use of DHCP as a way of setting
+the IP address, instead requiring alternatives such as manual
+configuration.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
 ALIGN="LEFT"
 WIDTH="100%"><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TD
+CELLSPACING="0"
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-<A
-HREF="usbseth-control.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="usbseth-control.html"
+>Prev</A
+></TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-<A
-HREF="io-usb-slave-eth.html">
-Home</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="io-usb-slave-eth.html"
+>Home</A
+></TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-<A
-HREF="usbseth-host.html">
-Next</A>
-</TD>
-</TR>
-<TR>
-<TD
+VALIGN="top"
+><A
+HREF="usbseth-host.html"
+>Next</A
+></TD
+></TR
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-USB-ethernet State Handling</TD>
-<TD
+VALIGN="top"
+>USB-ethernet State Handling</TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-&nbsp;</TD>
-<TD
+VALIGN="top"
+>&nbsp;</TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-Example Host-side Device Driver</TD>
-</TR>
-</TABLE>
-</DIV>
-</BODY>
-</HTML>
+VALIGN="top"
+>Example Host-side Device Driver</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
--- a/packages/io/usb/eth/slave/current/doc/usbseth-protocol.html
+++ b/packages/io/usb/eth/slave/current/doc/usbseth-protocol.html
@@ -2,100 +2,101 @@
 <!-- This material may be distributed only subject to the terms      -->
 <!-- and conditions set forth in the Open Publication License, v1.0  -->
 <!-- or later (the latest version is presently available at          -->
-<!-- http://www.opencontent.org/openpub/)                            -->
+<!-- http://www.opencontent.org/openpub/).                           -->
 <!-- Distribution of substantively modified versions of this         -->
 <!-- document is prohibited without the explicit permission of the   -->
 <!-- copyright holder.                                               -->
 <!-- Distribution of the work or derivative of the work in any       -->
 <!-- standard (paper) book form is prohibited unless prior           -->
-<!-- permission obtained from the copyright holder                   -->
-<HTML>
-<HEAD>
-<TITLE>
-Communication Protocol</TITLE>
-<META
+<!-- permission is obtained from the copyright holder.               -->
+<HTML
+><HEAD
+><TITLE
+>Communication Protocol</TITLE
+><META
 NAME="GENERATOR"
-CONTENT="Modular DocBook HTML Stylesheet Version 1.54"><LINK
+CONTENT="Modular DocBook HTML Stylesheet Version 1.64
+"><LINK
 REL="HOME"
 TITLE="eCos Support for Developing USB-ethernet Peripherals"
 HREF="io-usb-slave-eth.html"><LINK
 REL="PREVIOUS"
 TITLE="Example Host-side Device Driver"
-HREF="usbseth-host.html"></HEAD>
-<BODY
+HREF="usbseth-host.html"></HEAD
+><BODY
 CLASS="REFENTRY"
 BGCOLOR="#FFFFFF"
 TEXT="#000000"
 LINK="#0000FF"
 VLINK="#840084"
-ALINK="#0000FF">
-<DIV
-CLASS="NAVHEADER">
-<TABLE
+ALINK="#0000FF"
+><DIV
+CLASS="NAVHEADER"
+><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TH
+CELLSPACING="0"
+><TR
+><TH
 COLSPAN="3"
-ALIGN="center">
-eCos Support for Developing USB-ethernet Peripherals</TH>
-</TR>
-<TR>
-<TD
+ALIGN="center"
+>eCos Support for Developing USB-ethernet Peripherals</TH
+></TR
+><TR
+><TD
 WIDTH="10%"
 ALIGN="left"
-VALIGN="bottom">
-<A
-HREF="usbseth-host.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="bottom"
+><A
+HREF="usbseth-host.html"
+>Prev</A
+></TD
+><TD
 WIDTH="80%"
 ALIGN="center"
-VALIGN="bottom">
-</TD>
-<TD
+VALIGN="bottom"
+></TD
+><TD
 WIDTH="10%"
 ALIGN="right"
-VALIGN="bottom">
-&nbsp;</TD>
-</TR>
-</TABLE>
-<HR
+VALIGN="bottom"
+>&nbsp;</TD
+></TR
+></TABLE
+><HR
 ALIGN="LEFT"
-WIDTH="100%"></DIV>
-<H1>
-<A
-NAME="USBSETH-PROTOCOL">
-Communication Protocol</A>
-</H1>
-<DIV
-CLASS="REFNAMEDIV">
-<A
-NAME="AEN279">
-</A>
-<H2>
-Name</H2>
-Communication Protocol&nbsp;--&nbsp;Protocol used between the host-side device driver and the eCos
-USB-ethernet package </DIV>
-<DIV
-CLASS="REFSECT1">
-<A
-NAME="AEN282">
-</A>
-<H2>
-Description</H2>
-<P>
-There is a USB standard for the protocol to be used between the host
+WIDTH="100%"></DIV
+><H1
+><A
+NAME="USBSETH-PROTOCOL"
+>Communication Protocol</A
+></H1
+><DIV
+CLASS="REFNAMEDIV"
+><A
+NAME="AEN281"
+></A
+><H2
+>Name</H2
+>Communication Protocol&nbsp;--&nbsp;Protocol used between the host-side device driver and the eCos
+USB-ethernet package </DIV
+><DIV
+CLASS="REFSECT1"
+><A
+NAME="AEN284"
+></A
+><H2
+>Description</H2
+><P
+>There is a USB standard for the protocol to be used between the host
 and a class of communication devices, including ethernet. However, the
 eCos USB-ethernet package does not implement this protocol: the target
 hardware for which the package was first developed had certain
 limitations, and could not implement the standard. Instead, the package
-implements a simple new protocol.</P>
-<P>
-A USB-ethernet peripheral involves bulk transfers on two endpoints:
+implements a simple new protocol.</P
+><P
+>A USB-ethernet peripheral involves bulk transfers on two endpoints:
 one endpoint will be used for packets from host to peripheral and the
 other will be used for the opposite direction. Transfers in both
 directions are variable length, with a lower limit of 16 bytes and an
@@ -105,163 +106,164 @@ the normal header for an ethernet frame:
 source MAC address, and a protocol field. The remaining data, up to
 1500 bytes, are the payload. The first two bytes give the size of the
 ethernet frame, least significant byte first, with a value between 14
-and 1514.</P>
-<P>
-For example an ARP request from host to peripheral involves an
+and 1514.</P
+><P
+>For example an ARP request from host to peripheral involves an
 ethernet frame of 42 bytes (0x002A), with the usual 14-byte header and
 a 28-byte payload. The destination is the broadcast address
 0xFFFFFFFFFFFF. The source depends on the MAC address specified for
 the host in the call to <A
-HREF="usbseth-init.html">
-<TT
-CLASS="FUNCTION">
-usbs_eth_init</TT>
-</A>
-, e.g.
+HREF="usbseth-init.html"
+><TT
+CLASS="FUNCTION"
+>usbs_eth_init</TT
+></A
+>, e.g.
 0x405D90A9BC02. The remaining data is as specified by the appropriate
 <A
 HREF="http://www.ietf.org"
-TARGET="_top">
-IETF RFC's</A>
-. The actual bulk
-USB transfer involves the following sequence of 44 bytes:</P>
-<TABLE
+TARGET="_top"
+>IETF RFC's</A
+>. The actual bulk
+USB transfer involves the following sequence of 44 bytes:</P
+><TABLE
 BORDER="0"
 BGCOLOR="#E0E0E0"
-WIDTH="100%">
-<TR>
-<TD>
-<PRE
-CLASS="SCREEN">
-2a 00 ff ff ff ff ff ff 40 5d 90 a9 bc 02 08 06
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="SCREEN"
+>2a 00 ff ff ff ff ff ff 40 5d 90 a9 bc 02 08 06
 00 01 08 00 06 04 00 01 40 5d 90 a9 bc 02 0a 00
-00 01 00 00 00 00 00 00 0a 00 00 02</PRE>
-</TD>
-</TR>
-</TABLE>
-<P>
-In addition there are two control messages. These will be sent by the
+00 01 00 00 00 00 00 00 0a 00 00 02</PRE
+></TD
+></TR
+></TABLE
+><P
+>In addition there are two control messages. These will be sent by the
 host to endpoint 0, the control endpoint, and by default they will
 be handled by <A
-HREF="usbseth-control.html">
-<TT
-CLASS="FUNCTION">
-usbs_eth_class_control_handler</TT>
-</A>
-. If class-specific
+HREF="usbseth-control.html"
+><TT
+CLASS="FUNCTION"
+>usbs_eth_class_control_handler</TT
+></A
+>. If class-specific
 control messages are intercepted by other code then it is the
 responsibility of that code to invoke the USB-ethernet handler when
-appropriate.</P>
-<P>
-The first control message can be used by the host to obtain a MAC
-address:</P>
-<TABLE
+appropriate.</P
+><P
+>The first control message can be used by the host to obtain a MAC
+address:</P
+><TABLE
 BORDER="0"
 BGCOLOR="#E0E0E0"
-WIDTH="100%">
-<TR>
-<TD>
-<PRE
-CLASS="PROGRAMLISTING">
-#define ECOS_USBETH_CONTROL_GET_MAC_ADDRESS         0x01</PRE>
-</TD>
-</TR>
-</TABLE>
-<P>
-The control message's type field should specify IN as the direction.
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>#define ECOS_USBETH_CONTROL_GET_MAC_ADDRESS         0x01</PRE
+></TD
+></TR
+></TABLE
+><P
+>The control message's type field should specify IN as the direction.
 The request field should be <TT
-CLASS="LITERAL">
-0x01</TT>
-. The length fields
+CLASS="LITERAL"
+>0x01</TT
+>. The length fields
 should specify a size of 6 bytes. The remaining fields of the control
 message will be ignored by the USB-ethernet package. The response
 consists of the 6-byte MAC address supplied by the initialization call
 <A
-HREF="usbseth-init.html">
-<TT
-CLASS="FUNCTION">
-usbs_eth_init</TT>
-</A>
-.</P>
-<P>
-The second control message can be used by the host to enable or
-disable promiscuous mode.</P>
-<TABLE
+HREF="usbseth-init.html"
+><TT
+CLASS="FUNCTION"
+>usbs_eth_init</TT
+></A
+>.</P
+><P
+>The second control message can be used by the host to enable or
+disable promiscuous mode.</P
+><TABLE
 BORDER="0"
 BGCOLOR="#E0E0E0"
-WIDTH="100%">
-<TR>
-<TD>
-<PRE
-CLASS="PROGRAMLISTING">
-#define ECOS_USBETH_CONTROL_SET_PROMISCUOUS_MODE    0x02</PRE>
-</TD>
-</TR>
-</TABLE>
-<P>
-This control message involves no further data so the length field
+WIDTH="100%"
+><TR
+><TD
+><PRE
+CLASS="PROGRAMLISTING"
+>#define ECOS_USBETH_CONTROL_SET_PROMISCUOUS_MODE    0x02</PRE
+></TD
+></TR
+></TABLE
+><P
+>This control message involves no further data so the length field
 should be set to 0. The value field should be non-zero to enable
 promiscuous mode, zero to disable it. The request field should be
 <TT
-CLASS="LITERAL">
-0x02</TT>
-. The remaining fields in the control message
+CLASS="LITERAL"
+>0x02</TT
+>. The remaining fields in the control message
 will be ignored. It is the responsibility of the host-side device
 driver to keep track of whether or not promiscuous mode is currently
 enabled. It will be disabled when the peripheral changes to
 Configured state, typically at the point where the host-side device
-driver has been activated.</P>
-</DIV>
-<DIV
-CLASS="NAVFOOTER">
-<HR
+driver has been activated.</P
+></DIV
+><DIV
+CLASS="NAVFOOTER"
+><HR
 ALIGN="LEFT"
 WIDTH="100%"><TABLE
 WIDTH="100%"
 BORDER="0"
 CELLPADDING="0"
-CELLSPACING="0">
-<TR>
-<TD
+CELLSPACING="0"
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-<A
-HREF="usbseth-host.html">
-Prev</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="usbseth-host.html"
+>Prev</A
+></TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-<A
-HREF="io-usb-slave-eth.html">
-Home</A>
-</TD>
-<TD
+VALIGN="top"
+><A
+HREF="io-usb-slave-eth.html"
+>Home</A
+></TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-&nbsp;</TD>
-</TR>
-<TR>
-<TD
+VALIGN="top"
+>&nbsp;</TD
+></TR
+><TR
+><TD
 WIDTH="33%"
 ALIGN="left"
-VALIGN="top">
-Example Host-side Device Driver</TD>
-<TD
+VALIGN="top"
+>Example Host-side Device Driver</TD
+><TD
 WIDTH="34%"
 ALIGN="center"
-VALIGN="top">
-&nbsp;</TD>
-<TD
+VALIGN="top"
+>&nbsp;</TD
+><TD
 WIDTH="33%"
 ALIGN="right"
-VALIGN="top">
-&nbsp;</TD>
-</TR>
-</TABLE>
-</DIV>
-</BODY>
-</HTML>
+VALIGN="top"
+>&nbsp;</TD
+></TR
+></TABLE
+></DIV
+></BODY
+></HTML
+>
\ No newline at end of file
--- a/packages/io/usb/eth/slave/current/doc/usbseth.sgml
+++ b/packages/io/usb/eth/slave/current/doc/usbseth.sgml
@@ -585,9 +585,24 @@ intended for SNMP: by default this will 
 package <literal>CYGPKG_SNMPAGENT</literal> is loaded, and disabled
 otherwise. The name of the ethernet device is controlled by
 <literal>CYGDATA_USBS_ETHDRV_NAME</literal>, and has a default value
-of <literal>eth0</literal>. If there are other network device drivers
-present in the configuration then it is the responsibility of the
-application developer to give each device a unique name.
+of either <literal>eth0</literal> or <literal>eth1</literal>
+depending on whether or not there is another network device driver
+present in the configuration.
+</para>
+<para>
+Usually eCos network device drivers default to using DHCP for
+obtaining necessary information such as IP addresses. This is not
+appropriate for USB-ethernet devices. On the host-side the
+USB-ethernet network device will not exist until the USB peripheral
+has been plugged in and communication has been established. Therefore
+any DHCP daemon on the host would not be listening on that network
+device at the point that eCos requests its IP and other information. A
+related issue is that the use of DHCP would imply the presence of a
+DHCP daemon on every affected host machine, as opposed to a single
+daemon (plus backups) for the network as a whole. For these reasons
+the USB-ethernet package precludes the use of DHCP as a way of setting
+the IP address, instead requiring alternatives such as manual
+configuration.
 </para>
 </refsect1>
 
--- a/packages/kernel/current/ChangeLog
+++ b/packages/kernel/current/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-09  Jonathan Larmour  <jlarmour@redhat.com>
+
+	* include/sched.inl (unlock_reschedule): Fix commenting.
+	* src/sched/sched.cxx: Improve description of unlock_inner().
+
 2001-06-21  Jonathan Larmour  <jlarmour@redhat.com>
 
 	* src/common/thread.cxx (Cyg_Thread::Cyg_Thread): Initialize
--- a/packages/kernel/current/include/sched.inl
+++ b/packages/kernel/current/include/sched.inl
@@ -112,8 +112,8 @@ inline void Cyg_Scheduler:: unlock_resch
     // This function decrements the scheduler lock and also looks for
     // a reschedule opportunity. When the lock is being decremented
     // from 1 to zero this function is equivalent to unlock. When the
-    // lock is being decremented to a non-zero value, it is equivalent
-    // to unlock() followed by reschedule().
+    // lock is being decremented to a non-zero value, it is more or less
+    // equivalent to reschedule() followed by unlock().
     
     CYG_INSTRUMENT_SCHED(UNLOCK,sched_lock,0);
     
--- a/packages/kernel/current/src/sched/sched.cxx
+++ b/packages/kernel/current/src/sched/sched.cxx
@@ -93,17 +93,26 @@ cyg_ucount32          Cyg_Scheduler_Base
 // -------------------------------------------------------------------------
 // Scheduler unlock function.
 
-// This is only called when the lock is to be zeroed and there is the
-// potential for real work to be done. Other cases are handled in
-// Cyg_Scheduler::unlock() which is an inline.  The new_lock argument
-// contains the value that the scheduler lock should have after this
-// function has completed. If it is zero then the lock is being
-// released and some extra work (running ASRs, checking for DSRs) is
+// This is only called when there is the potential for real work to be
+// done. Other cases are handled in Cyg_Scheduler::unlock() which is
+// an inline; _or_ this function may have been called from
+// Cyg_Scheduler::reschedule(), or Cyg_Scheduler::unlock_reschedule. The
+// new_lock argument contains the value that the scheduler lock should
+// have after this function has completed. If it is zero then the lock is
+// being released and some extra work (running ASRs, checking for DSRs) is
 // done before returning. If it is non-zero then it must equal the
 // current value of the lock, and is used to indicate that we want to
 // reacquire the scheduler lock before returning. This latter option
 // only makes any sense if the current thread is no longer runnable,
-// otherwise this function will do nothing.
+// e.g. sleeping, otherwise this function will do nothing.
+// This approach of passing in the lock value at the end effectively
+// makes the scheduler lock a form of per-thread variable. Each call
+// to unlock_inner() carries with it the value the scheduler should
+// have when it reschedules this thread back, and leaves this function.
+// When it is non-zero, and the thread is rescheduled, no ASRS are run,
+// or DSRs processed. By doing this, it makes it possible for threads
+// that want to go to sleep to wake up with the scheduler lock in the
+// same state it was in before.
 
 void Cyg_Scheduler::unlock_inner( cyg_ucount32 new_lock )
 {
--- a/packages/language/c/libc/stdio/current/ChangeLog
+++ b/packages/language/c/libc/stdio/current/ChangeLog
@@ -1,3 +1,10 @@
+2001-07-12  Jonathan Larmour  <jlarmour@redhat.com>
+
+	* src/common/fflush.cxx (cyg_libc_stdio_flush_all_but): Don't
+	flush a stream that was last used for reading - it doesn't need it.
+	* include/stream.hxx: cyg_libc_stdio_flush_all_but needs to be a
+	friend of class Cyg_StdioStream to do the above.
+
 2001-06-18  Jonathan Larmour  <jlarmour@redhat.com>
 
 	* src/input/fread.cxx (fread): Fix compilation problem with below
--- a/packages/language/c/libc/stdio/current/include/stream.hxx
+++ b/packages/language/c/libc/stdio/current/include/stream.hxx
@@ -64,9 +64,15 @@
 
 // TYPE DEFINITIONS
 
+class Cyg_StdioStream;
+__externC Cyg_ErrNo
+cyg_libc_stdio_flush_all_but( Cyg_StdioStream * );
+
 class Cyg_StdioStream
 {
     friend int setvbuf( FILE *, char *, int, size_t );
+    friend Cyg_ErrNo
+    cyg_libc_stdio_flush_all_but( Cyg_StdioStream * );
 
 private:
 
--- a/packages/language/c/libc/stdio/current/src/common/fflush.cxx
+++ b/packages/language/c/libc/stdio/current/src/common/fflush.cxx
@@ -86,14 +86,16 @@ cyg_libc_stdio_flush_all_but( Cyg_StdioS
                 } // if
                 else {
                     // valid stream
-                    
-                    if ( stream->trylock_me() ) {
-                        err = stream->flush_output_unlocked();
-                        stream->unlock_me();
-                        files_flushed[i] = true;
-                    } // if
-                    else
-                        loop_again = true;
+                    // only buffers which we've written to need flushing
+                    if ( !stream->flags.last_buffer_op_was_read) {
+                        if ( stream->trylock_me() ) {
+                            err = stream->flush_output_unlocked();
+                            stream->unlock_me();
+                            files_flushed[i] = true;
+                        } // if
+                        else
+                            loop_again = true;
+                    }
                 } // else
             } // if
         } // for
--- a/packages/pkgconf/fixhtml.tcl
+++ b/packages/pkgconf/fixhtml.tcl
@@ -68,11 +68,6 @@ set copyright_banner \
 <!-- standard (paper) book form is prohibited unless prior           -->
 <!-- permission is obtained from the copyright holder.               -->"
 
-# The generated files all have a .htm suffix rather than a .html
-# suffix. For now this is preserved, to avoid having to change all the
-# anchors. It might be better to rename all the files to .html in
-# future, and perhaps also to change book1.htm to index.htm
-
 set files [glob *.html]
 foreach file $files {
     set status [catch {
@@ -84,7 +79,6 @@ foreach file $files {
 	# If there is already a (C) message on the first line, skip this file.
 	if {[regexp {[^\n]*Copyright (C) [0-9]* Red Hat.*} $data] == 0} {
 
-
 	    # The DSSSL has the annoying habit of splitting tags over several lines.
 	    # This should sort things out.
             # REMOVED by jifl: doing this can add newlines in tags like
@@ -94,6 +88,13 @@ foreach file $files {
 	    # Add a copyright banner
 	    set data "[set copyright_banner]\n[set data]"
 
+	    # Look for a smarttags meta. If absent, insert one. There should
+	    # already be one meta present identifying the stylesheet, so
+	    # that identifies a sensible location for inserting another meta.
+	    if {[regexp {MSSmartTagsPreventParsing} $data] == 0} {
+		regsub -nocase {<META} $data "<meta name=\"MSSmartTagsPreventParsing\" content=\"TRUE\">\n<META" data
+	    }
+	    
 	    # Take care of some character entities that Netscape does not understand
 	    regsub -all "&mgr;"    $data "\\&#03BC;" data
 	    regsub -all "&mdash;"  $data "\\&#8212;" data
--- a/packages/pkgconf/rules.mak
+++ b/packages/pkgconf/rules.mak
@@ -47,23 +47,36 @@ ifneq ($(wildcard *.deps),)
 include $(wildcard *.deps)
 endif
 
+
 # pattern matching rules to generate a library object from source code
 # object filenames are prefixed to avoid name clashes
 # a single dependency rule is generated (file extension = ".o.d")
 %.o.d : %.c
+ifeq ($(HOST),CYGWIN)
+	@mkdir -p `cygpath -w "$(dir $@)" | sed "s/\\\\\/\\//g"`
+else
 	@mkdir -p $(dir $@)
+endif
 	$(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(CFLAGS) -Wp,-MD,$(@:.o.d=.tmp) -o $(dir $@)$(OBJECT_PREFIX)_$(notdir $(@:.o.d=.o)) $<
 	@sed -e '/^ *\\/d' -e "s#.*: #$@: #" $(@:.o.d=.tmp) > $@
 	@rm $(@:.o.d=.tmp)
 
 %.o.d : %.cxx
+ifeq ($(HOST),CYGWIN)
+	@mkdir -p `cygpath -w "$(dir $@)" | sed "s/\\\\\/\\//g"`
+else
 	@mkdir -p $(dir $@)
+endif
 	$(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(CFLAGS) -Wp,-MD,$(@:.o.d=.tmp) -o $(dir $@)$(OBJECT_PREFIX)_$(notdir $(@:.o.d=.o)) $<
 	@sed -e '/^ *\\/d' -e "s#.*: #$@: #" $(@:.o.d=.tmp) > $@
 	@rm $(@:.o.d=.tmp)
 
 %.o.d : %.S
+ifeq ($(HOST),CYGWIN)
+	@mkdir -p `cygpath -w "$(dir $@)" | sed "s/\\\\\/\\//g"`
+else
 	@mkdir -p $(dir $@)
+endif	
 	$(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(CFLAGS) -Wp,-MD,$(@:.o.d=.tmp) -o $(dir $@)$(OBJECT_PREFIX)_$(notdir $(@:.o.d=.o)) $<
 	@sed -e '/^ *\\/d' -e "s#.*: #$@: #" $(@:.o.d=.tmp) > $@
 	@rm $(@:.o.d=.tmp)
@@ -72,26 +85,42 @@ endif
 # object filenames are not prefixed
 # a single dependency rule is generated (file extension = ".d")
 %.d : %.c
+ifeq ($(HOST),CYGWIN)
+	@mkdir -p `cygpath -w "$(dir $@)" | sed "s/\\\\\/\\//g"`
+else
 	@mkdir -p $(dir $@)
+endif
 	$(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(CFLAGS) -Wp,-MD,$(@:.d=.tmp) -o $(@:.d=.o) $<
 	@sed -e '/^ *\\/d' -e "s#.*: #$@: #" $(@:.o.d=.tmp) > $@
 	@rm $(@:.d=.tmp)
 
 %.d : %.cxx
+ifeq ($(HOST),CYGWIN)
+	@mkdir -p `cygpath -w "$(dir $@)" | sed "s/\\\\\/\\//g"`
+else
 	@mkdir -p $(dir $@)
+endif
 	$(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(CFLAGS) -Wp,-MD,$(@:.d=.tmp) -o $(@:.d=.o) $<
 	@sed -e '/^ *\\/d' -e "s#.*: #$@: #" $(@:.o.d=.tmp) > $@
 	@rm $(@:.d=.tmp)
 
 %.d : %.S
+ifeq ($(HOST),CYGWIN)
+	@mkdir -p `cygpath -w "$(dir $@)" | sed "s/\\\\\/\\//g"`
+else
 	@mkdir -p $(dir $@)
+endif	
 	$(CC) -c $(INCLUDE_PATH) -I$(dir $<) $(CFLAGS) -Wp,-MD,$(@:.d=.tmp) -o $(@:.d=.o) $<
 	@sed -e '/^ *\\/d' -e "s#.*: #$@: #" $(@:.o.d=.tmp) > $@
 	@rm $(@:.d=.tmp)
 
 # rule to generate a test executable from object code
 $(PREFIX)/tests/$(PACKAGE)/%$(EXEEXT): %.d $(wildcard $(PREFIX)/lib/target.ld) $(wildcard $(PREFIX)/lib/*.[ao])
+ifeq ($(HOST),CYGWIN)
+	@mkdir -p `cygpath -w "$(dir $@)" | sed "s/\\\\\/\\//g"`
+else
 	@mkdir -p $(dir $@)
+endif	
 ifneq ($(IGNORE_LINK_ERRORS),)
 	-$(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ $(<:.d=.o)
 else
--- a/packages/redboot/current/ChangeLog
+++ b/packages/redboot/current/ChangeLog
@@ -1,3 +1,18 @@
+2001-07-16  Gary Thomas  <gthomas@redhat.com>
+
+	* src/main.c (do_version): Use external function _flash_info() to 
+	display information about installed FLASH.
+
+	* src/load.c (load_srec_image): Remove extra '\n' on out of range msg.
+
+	* src/flash.c (_flash_info): New function - displays information
+	about FLASH found in system.  Used by 'version' command.
+
+2001-07-12  Gary Thomas  <gthomas@redhat.com>
+2001-07-12  Fabrice Gautier <gautier@email.enst.fr>
+	
+	* cdl/redboot.cdl: Improve some descriptions of options.
+
 2001-07-02  Jesper Skov  <jskov@redhat.com>
 
 	* src/io.c (do_channel): Fox build for !CYGPKG_REDBOOT_ANY_CONSOLE
--- a/packages/redboot/current/cdl/redboot.cdl
+++ b/packages/redboot/current/cdl/redboot.cdl
@@ -69,7 +69,13 @@ cdl_package CYGPKG_REDBOOT {
         requires CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
 
         cdl_option CYGBLD_BUILD_REDBOOT_WITH_THREADS {
+            display "Threads debugging support"
             no_define
+            description "
+              Enabling this option will include special code in the GDB stubs to
+              support debugging of threaded programs.  In the case of eCos programs,
+              this support allows GDB to have complete access to the eCos threads
+              in the program."
             active_if { CYG_HAL_STARTUP != "RAM" }
             requires  CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
         }
@@ -94,7 +100,7 @@ cdl_package CYGPKG_REDBOOT {
     }
 
     cdl_component CYGPKG_REDBOOT_NETWORKING {
-        display       "Build Redboot ROM binary image"
+        display       "Redboot Networking"
         flavor        bool
         active_if     CYGPKG_IO_ETH_DRIVERS
         default_value 1
@@ -441,10 +447,14 @@ cdl_package CYGPKG_REDBOOT {
     }
 
     cdl_option CYGPRI_REDBOOT_ROM_MONITOR {
+	display      "Behave like a ROM monitor"
         active_if    { CYG_HAL_STARTUP == "ROM" }
         requires     CYGSEM_HAL_ROM_MONITOR
         calculated   1
         no_define
+	description  "
+          Enabling this option will allow RedBoot to provide ROM monitor-style
+          services to programs which it executes."
     }
 
     cdl_option CYGSEM_REDBOOT_BSP_SYSCALLS {
--- a/packages/redboot/current/src/flash.c
+++ b/packages/redboot/current/src/flash.c
@@ -1004,14 +1004,23 @@ fis_unlock(int argc, char *argv[])
 }
 #endif
 
+static int __flash_init = 0;
+
+void
+_flash_info(void)
+{
+    if (!__flash_init) return;
+    printf("FLASH: %p - %p, %d blocks of %p bytes each.\n", 
+           flash_start, flash_end, blocks, (void *)block_size);
+}
+
 static bool
 do_flash_init(void)
 {
     int stat;
-    static int init = 0;
 
-    if (!init) {
-        init = 1;
+    if (!__flash_init) {
+        __flash_init = 1;
         if ((stat = flash_init((void *)(workspace_end-FLASH_MIN_WORKSPACE), 
                                FLASH_MIN_WORKSPACE, printf)) != 0) {
             printf("FLASH: driver init failed!, status: 0x%x\n", stat);
@@ -1019,10 +1028,9 @@ do_flash_init(void)
         }
         flash_get_limits((void *)0, (void **)&flash_start, (void **)&flash_end);
         flash_get_block_info(&block_size, &blocks);
-        printf("FLASH: %p - %p, %d blocks of %p bytes each.\n", 
-               flash_start, flash_end, blocks, (void *)block_size);
         fis_work_block = (unsigned char *)(workspace_end-FLASH_MIN_WORKSPACE-block_size);
         workspace_end = fis_work_block;
+        _flash_info();
     }
     return true;
 }
--- a/packages/redboot/current/src/load.c
+++ b/packages/redboot/current/src/load.c
@@ -160,7 +160,7 @@ load_srec_image(int (*getc)(void), unsig
             }
             if ((addr < user_ram_start) || (addr > user_ram_end)) {
                 if (!verify_action("Attempt to load S-record data to address: %p\n"
-                                   "RedBoot does not believe this is in RAM\n", (void*)addr))
+                                   "RedBoot does not believe this is in RAM", (void*)addr))
                     return 0;
             }
             count -= ((type-'1'+2)+1);
--- a/packages/redboot/current/src/main.c
+++ b/packages/redboot/current/src/main.c
@@ -140,6 +140,10 @@ void
 do_version(int argc, char *argv[])
 {
     extern char RedBoot_version[];
+#ifdef CYGPKG_IO_FLASH
+    externC void _flash_info(void);
+#endif
+
     printf(RedBoot_version);
 #ifdef HAL_PLATFORM_CPU
     printf("Platform: %s (%s) %s\n", HAL_PLATFORM_BOARD, HAL_PLATFORM_CPU, HAL_PLATFORM_EXTRA);
@@ -148,6 +152,9 @@ do_version(int argc, char *argv[])
     printf("RAM: %p-%p, %p-%p available\n", 
            (void*)ram_start, (void*)ram_end,
            (void*)user_ram_start, (void *)user_ram_end);
+#ifdef CYGPKG_IO_FLASH
+    _flash_info();
+#endif
 }
 
 void
--- a/packages/services/memalloc/common/current/ChangeLog
+++ b/packages/services/memalloc/common/current/ChangeLog
@@ -1,3 +1,10 @@
+2001-07-12  Jonathan Larmour  <jlarmour@redhat.com>
+
+	* tests/malloc1.c (main): Accoutn for allocators that do allocate
+	space for allocs of 0.
+	Test that allocating all space works.
+	* src/dlmalloc.cxx (get_status): Correct again calculation of maxfree
+
 2001-06-28  Jonathan Larmour  <jlarmour@redhat.com>
 
 	* include/memjoin.inl (~Cyg_Mempool_Joined): free even when asserts
--- a/packages/services/memalloc/common/current/src/dlmalloc.cxx
+++ b/packages/services/memalloc/common/current/src/dlmalloc.cxx
@@ -206,6 +206,7 @@
 #include <cyg/infra/cyg_ass.h>         // assertions
 #include <stddef.h>                    // for size_t
 #include <cyg/memalloc/dlmalloc.hxx>
+//#include <cyg/infra/diag.h>
 
 /*
     Debugging:
@@ -1255,6 +1256,8 @@ Cyg_Mempool_dlmalloc_Implementation::try
   remainder_size = long_sub_size_t(chunksize(top), nb);
   if (chunksize(top) < nb || remainder_size < (long)MINSIZE)
   {
+      //diag_printf("chunksize(top)=%ld, nb=%d, remainder=%ld\n", chunksize(top),
+      //            nb, remainder_size);
       MALLOC_UNLOCK;
       return NULL; /* propagate failure */
   }
@@ -1619,9 +1622,15 @@ Cyg_Mempool_dlmalloc_Implementation::get
             status.totalallocated = arenasize - avail;
         // as quick or quicker to just set most of these, rather than
         // test flag first
-        status.totalfree = avail  - (2*SIZE_SZ) - MINSIZE;
+        status.totalfree = (avail & ~(MALLOC_ALIGN_MASK)) - SIZE_SZ - MINSIZE;
+        CYG_ASSERT( ((avail + SIZE_SZ + MALLOC_ALIGN_MASK) & ~MALLOC_ALIGN_MASK)
+                    >= MINSIZE, "free mem negative!" );
         status.freeblocks = navail;
-        status.maxfree = maxfree  - (2*SIZE_SZ) - MINSIZE;
+        status.maxfree = (maxfree & ~(MALLOC_ALIGN_MASK)) - SIZE_SZ - MINSIZE;
+        //diag_printf("raw mf: %d, ret mf: %d\n", maxfree, status.maxfree);
+        CYG_ASSERT( ((maxfree + SIZE_SZ + MALLOC_ALIGN_MASK) & 
+                    ~MALLOC_ALIGN_MASK) >= MINSIZE, 
+                    "max free block size negative!" );
     } // if
 
     // as quick or quicker to just set most of these, rather than
--- a/packages/services/memalloc/common/current/tests/malloc1.c
+++ b/packages/services/memalloc/common/current/tests/malloc1.c
@@ -193,10 +193,12 @@ main( int argc, char *argv[] )
         free(str);
     } // else       
 
-
     // Test 4
+#if defined(CYGIMP_MEMALLOC_MALLOC_VARIABLE_SIMPLE) && \
+      defined(CYGSEM_MEMALLOC_ALLOCATOR_VARIABLE_COALESCE)
+    poolmax = mallinfo().maxfree; // recalculate for non-coalescing allocator
+#endif
     str=(char *)malloc( poolmax+1 );
-
     CYG_TEST_PASS_FAIL( str==NULL, "malloc too much data returns NULL" );
 
     // Test 5
@@ -204,10 +206,10 @@ main( int argc, char *argv[] )
     CYG_TEST_PASS_FAIL( str==NULL, "calloc too much data returns NULL" );
 
     // Test 6
-    str=(char *)malloc(0);
-    str=(char *)calloc(0, 1);
-    str=(char *)calloc(1, 0);
-    str=(char *)calloc(0, 0);
+    str=(char *)malloc(0); if (str != NULL) free(str);
+    str=(char *)calloc(0, 1); if (str != NULL) free(str);
+    str=(char *)calloc(1, 0); if (str != NULL) free(str);
+    str=(char *)calloc(0, 0); if (str != NULL) free(str);
     // simply shouldn't barf by this point
 
     CYG_TEST_PASS_FAIL( 1, "malloc and calloc of 0 bytes doesn't crash" );
@@ -239,6 +241,16 @@ main( int argc, char *argv[] )
     free(str);
     free(str2);
 
+    // Test 9
+
+#if defined(CYGIMP_MEMALLOC_MALLOC_VARIABLE_SIMPLE) && \
+      defined(CYGSEM_MEMALLOC_ALLOCATOR_VARIABLE_COALESCE)
+    poolmax = mallinfo().maxfree; // recalculate for non-coalescing allocator
+#endif
+    str = (char *)malloc( poolmax );
+    CYG_TEST_PASS_FAIL( str != NULL, "malloc of maximum free block size works");
+    free(str);
+
     CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library "
                     "malloc(), calloc() and free() functions");