changeset 147:d397fc472bcf

Merge from eCos master repository on 2001-01-05-06:43:02-GMT
author jlarmour
date Fri, 05 Jan 2001 17:12:36 +0000
parents bd918119cf0b
children 8f2f7615e727
files host/tools/configtool/standalone/common/ecosconfig.cxx host/tools/configtool/standalone/win32/CTres.h host/tools/configtool/standalone/win32/Configtool.rc host/tools/configtool/standalone/win32/res/Splsh16.bmp host/tools/pkgadmin/ChangeLog host/tools/pkgadmin/win32/PkgAdminDlg.cpp packages/compat/posix/current/ChangeLog packages/compat/posix/current/cdl/pthread.cdl packages/compat/posix/current/include/pthread.h packages/compat/posix/current/src/pthread.cxx packages/devs/eth/arm/ebsa285/current/ChangeLog packages/devs/eth/arm/ebsa285/current/src/if_ebsa285.c packages/devs/eth/arm/edb7xxx/current/ChangeLog packages/devs/eth/arm/edb7xxx/current/src/if_edb7xxx.c packages/devs/eth/powerpc/quicc/current/ChangeLog packages/devs/eth/powerpc/quicc/current/src/if_quicc.c packages/devs/serial/powerpc/quicc/current/ChangeLog packages/devs/serial/powerpc/quicc/current/src/quicc_smc_serial.c packages/ecos.db packages/hal/arm/ebsa285/current/ChangeLog packages/hal/arm/ebsa285/current/src/ebsa285_misc.c packages/hal/powerpc/arch/current/ChangeLog packages/hal/powerpc/arch/current/src/hal_intr.c packages/hal/powerpc/mbx/current/ChangeLog packages/hal/powerpc/mbx/current/cdl/hal_powerpc_mbx.cdl packages/hal/powerpc/quicc/current/ChangeLog packages/hal/powerpc/quicc/current/include/ppc8xx.h packages/hal/sh/arch/current/ChangeLog packages/hal/sh/arch/current/src/sh.ld packages/io/eth/current/ChangeLog packages/io/eth/current/src/net/eth_drv.c packages/io/pci/current/ChangeLog packages/io/pci/current/include/pci.h packages/io/pci/current/include/pci_hw.h packages/io/pci/current/src/pci.c packages/kernel/current/ChangeLog packages/kernel/current/cdl/thread.cdl packages/kernel/current/include/kapi.h packages/kernel/current/include/thread.hxx packages/kernel/current/include/thread.inl packages/kernel/current/src/common/kapi.cxx packages/kernel/current/src/common/thread.cxx packages/language/c/libc/startup/current/ChangeLog packages/language/c/libc/startup/current/cdl/startup.cdl packages/net/tcpip/current/ChangeLog packages/net/tcpip/current/include/dhcp.h packages/net/tcpip/current/src/lib/dhcp_prot.c packages/net/tcpip/current/src/lib/dhcp_support.c packages/net/tcpip/current/tests/linux_echo.c packages/net/tcpip/current/tests/make.linux packages/redboot/current/ChangeLog packages/redboot/current/cdl/redboot.cdl packages/redboot/current/src/flash.c packages/redboot/current/src/io.c packages/redboot/current/src/main.c
diffstat 55 files changed, 979 insertions(+), 97 deletions(-) [+]
line wrap: on
line diff
--- a/host/tools/configtool/standalone/common/ecosconfig.cxx
+++ b/host/tools/configtool/standalone/common/ecosconfig.cxx
@@ -50,7 +50,7 @@
 #include "ecosconfig.hxx"
 
 #define TOOL_VERSION "1.3.net"
-#define TOOL_COPYRIGHT "Copyright (c) 2000 Red Hat, Inc."
+#define TOOL_COPYRIGHT "Copyright (c) 2001 Red Hat, Inc."
 #define DEFAULT_SAVE_FILE "ecos.ecc"
 static char* tool = "ecosconfig";
 
--- a/host/tools/configtool/standalone/win32/CTres.h
+++ b/host/tools/configtool/standalone/win32/CTres.h
@@ -26,6 +26,7 @@
 #define IDC_RADIO_CUSTOM_BROWSER        22028
 #define IDC_STATIC_ABOUT                22031
 #define IDC_RADIO_INTERNAL_BROWSER      22032
+#define IDC_STATIC_ABOUT2               22032
 #define IDC_HEADERSTATIC                22033
 #define IDC_STATIC_DATETIME             22034
 #define IDC_PANECOMBO                   22035
--- a/host/tools/configtool/standalone/win32/Configtool.rc
+++ b/host/tools/configtool/standalone/win32/Configtool.rc
@@ -158,7 +158,7 @@ BEGIN
         POPUP "Red Hat on the &Web"
         BEGIN
             MENUITEM "&Red Hat Home Page",          ID_HELP_RED_HATONTHEWEB
-            MENUITEM "&eCos Product Page",         ID_HELP_ECOSHOME
+            MENUITEM "&eCos Product Page",          ID_HELP_ECOSHOME
             MENUITEM "eCos &Net Release Page",      ID_HELP_ECOS
             MENUITEM SEPARATOR
             MENUITEM "µ&ITRON Specification",       ID_HELP_UITRON
@@ -186,7 +186,7 @@ END
 // Dialog
 //
 
-IDD_ABOUTBOX DIALOGEX 0, 0, 217, 190
+IDD_ABOUTBOX DIALOGEX 0, 0, 217, 198
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "About Configuration Tool"
 FONT 8, "MS Sans Serif"
@@ -194,13 +194,17 @@ BEGIN
     DEFPUSHBUTTON   "OK",IDOK,178,7,32,14,WS_GROUP
     LTEXT           "eCos Configuration Tool 1.3.net",IDC_STATIC,40,10,119,8,
                     SS_NOPREFIX
-    ICON            IDR_MAINFRAME,IDC_STATIC,11,17,20,20
+    ICON            IDR_MAINFRAME,IDC_STATIC,11,17,21,20
     LTEXT           "Date/Time info",IDC_STATIC_DATETIME,40,23,119,8
-    LTEXT           "Copyright © 1998-2000 Red Hat, Inc.",IDC_STATIC,40,36,
+    LTEXT           "Copyright © 1998-2001 Red Hat, Inc.",IDC_STATIC,40,36,
                     170,8
-    LTEXT           "The eCos engineering team is:",IDC_STATIC,7,50,109,8
-    CTEXT           "\r\nPaul Beskeen\r\nJohn Dallaway\r\nRobert Erskine\r\nNick Garnett\r\nEugene Kulesha\r\nJonathan Larmour\r\nAlex Schuilenburg\r\nJesper Skov\r\nJulian Smart\r\nGary Thomas\r\nHugo Tyson\r\nBart Veer",
-                    IDC_STATIC_ABOUT,7,69,203,114,SS_SUNKEN,WS_EX_CLIENTEDGE
+    CONTROL         "",IDC_STATIC,"Static",SS_GRAYFRAME,8,57,201,133,
+                    WS_EX_DLGMODALFRAME | WS_EX_TRANSPARENT
+    CTEXT           "Paul Beskeen\r\nJohn Dallaway\r\nRobert Erksine\r\nSimon FitzMaurice\r\nMark Galassi\r\nNick Garnett\r\nTim Goodwin\r\nStu Grossman\r\nEugene Kulesha\r\nJonathan Larmour\r\nDavid Moore\r\nDrew Moseley",
+                    IDC_STATIC_ABOUT,17,82,84,102
+    CTEXT           "Daniel Neades\r\nGary Oliverio\r\nChris Provenzano\r\nMark Salter\r\nRob Savoye\r\nAlex Schuilenburg\r\nJesper Skov\r\nJulian Smart\r\nChris Tarpy\r\nGary Thomas\r\nHugo Tyson\r\nBart Veer",
+                    IDC_STATIC_ABOUT2,115,82,84,101
+    LTEXT           "The eCos engineering team is:",IDC_STATIC,60,64,109,8
 END
 
 IDD_VIEW_SETTINGS_DIALOG DIALOG DISCARDABLE  0, 0, 234, 302
@@ -377,6 +381,11 @@ END
 #ifdef APSTUDIO_INVOKED
 GUIDELINES DESIGNINFO DISCARDABLE 
 BEGIN
+    IDD_ABOUTBOX, DIALOG
+    BEGIN
+        BOTTOMMARGIN, 193
+    END
+
     IDD_VIEW_SETTINGS_DIALOG, DIALOG
     BEGIN
         LEFTMARGIN, 7
index 678443fdd50ee2cdaac5f32030bbfb8969b9028d..b19abe7a371af445f54e8fdf3df6d493136e8017
GIT binary patch
literal 166438
zc%1E>TWB0dy2op^Baf7*HDir6wlucp;-1ymmMzQiYF61uiAP8|6GxKmSay6AYu6-9
zvhjo2<A;67!#<cp;281{2;?CU2;^ZQ5LgHV41utRKp+@GAP@p!F&K;?_$-95uq=J*
zt6NuBSC8gq%bxju-j$~7)^+*US5;s4D3z68{ZAhOW@Chu=<fk~x$p}@enAFU`2YQP
zANk*5!v0SK+5bJyV{zxE>5s9y<g?E{BmcN}kC5UW;@!DNHcp)+H^2OX{N=rO$lt&J
zp1l3%Kaqd```_fFk3J#`3k&4NUq2>)+Bii{ojOIXUAsm;c<VOVD36ip>1lHLWSLw!
zw?r;26v@v&{Y3utuYZwKCvTA(AKW4L=shl7x<vl@&wrAeH*b>n-g}SKmZr(r*ciEb
z^(y(`?KjEQjg#d1_3PyJS2xIeZ@o#1#oOf0?c3yw&u$R!r@QnXx5$rQ-z7i&;~!*<
zR{xDl=g8-uenPJQ=?eMc;}6K)J9o&HQw!wVuWyoDKYUOAT-zXj{qTMA^Upt%cdorb
z-g@IU`R3+Vw4L9Odq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;*bv13HkG;UqzO5KN@yr#~0FOb6bgzgXMtfp8M_r_Q=1?vynjFEmd}
z@2Re+$<7Ae4eOxYzsDQ22lZ19ciB5>`d35j^IUEIWU`Pyv1wX(|3LQ@!oa(sQzUIl
zy9<`G2mQHh-N|mTCyzS*TV4_8g`)P#F-z9?CO?W5_AI+uk6dgb!ne#r(-ZBw_<VaX
zT-a)uyG#Yj?$=rOOF<!Qn?u#j=Xvi3Bp_u#W81z%cHVLN3+B$CM^NYaNdG~x=Br?0
z8^5~&uO6@ux+M@gaPuo|kDNP_kEMjapyy=ZjSNeo-K53X$^;>~@?dFOU8z(E{Qm5)
z=xS%ibUxpKn)Rq9c=Sl;?H<FTv=m5h;1)<MbSg;1wr|sdY!h_QV_E%4a5iswB?9Sw
zs1iu5P=vpmmtx;*YunF_Jes&!`G@mjg)D9i5ClOG1VIo4K@bE%5ClOG1VIo4K@bG7
F^Z&lFDv1C9
--- a/host/tools/pkgadmin/ChangeLog
+++ b/host/tools/pkgadmin/ChangeLog
@@ -1,3 +1,10 @@
+2000-12-15  Julian Smart  <julians@redhat.com>
+
+	* win32/PkgAdminDlg.cpp:
+
+	Provide dummy error and warning handlers for
+    CdlPackagesDatabaseBody::make or it asserts in debug mode.
+
 2000-06-15  John Dallaway  <jld@redhat.com>
 
 	* win32/PkgAdmin.dsp:
--- a/host/tools/pkgadmin/win32/PkgAdminDlg.cpp
+++ b/host/tools/pkgadmin/win32/PkgAdminDlg.cpp
@@ -259,6 +259,16 @@ HCURSOR CPkgAdminDlg::OnQueryDragIcon()
 	return (HCURSOR) m_hIcon;
 }
 
+// Trivial handlers; otherwise CdlPackagesDatabaseBody::make asserts.
+void CdlErrorHandler (std::string message)
+{
+};
+
+void CdlWarningHandler (std::string message)
+{
+};
+
+
 bool CPkgAdminDlg::PopulatePackageTree(LPCTSTR pszPackagesPath)
 {
 	// delete any existing CDL database
@@ -273,7 +283,12 @@ bool CPkgAdminDlg::PopulatePackageTree(L
 
 	try
 	{
+        // Cdl asserts unless the handlers are present.
+#if 1
+        m_CdlPkgData = CdlPackagesDatabaseBody::make (UnicodeToStdStr (pszPackagesPath), &CdlErrorHandler, &CdlWarningHandler);
+#else
         m_CdlPkgData = CdlPackagesDatabaseBody::make (UnicodeToStdStr (pszPackagesPath));
+#endif
 	}
 	catch (CdlStringException exception)
 	{
--- a/packages/compat/posix/current/ChangeLog
+++ b/packages/compat/posix/current/ChangeLog
@@ -1,3 +1,17 @@
+2000-12-22  Jonathan Larmour  <jlarmour@redhat.com>
+
+	* src/pthread.cxx (pthread_measure_stack_usage): New function
+	to measure stack usage.
+
+	* include/pthread.h: Prototype it.
+
+	* cdl/pthread.cdl: remove CYGNUM_POSIX_MAIN_DEFAULT_STACK_SIZE and
+	instead implement CYGINT_LIBC_STARTUP_EXTERNAL_INVOKE_MAIN_POSSIBLE
+
+	* src/pthread.cxx: Use stack size for main from libc_startup package
+	to prevent confusion
+	(cyg_posix_pthread_start): Likewise
+
 2000-12-06  Jonathan Larmour  <jlarmour@redhat.com>
 
 	* src/signal.cxx: include unistd.h for _exit
--- a/packages/compat/posix/current/cdl/pthread.cdl
+++ b/packages/compat/posix/current/cdl/pthread.cdl
@@ -180,25 +180,10 @@ cdl_component CYGPKG_POSIX_MAIN_THREAD {
 	calculated 	1
 	requires        { 0 != CYGPKG_LIBC_STARTUP }
 	requires        CYGSEM_LIBC_STARTUP_MAIN_OTHER
+        implements      CYGINT_LIBC_STARTUP_EXTERNAL_INVOKE_MAIN_POSSIBLE
 	description	"These options control the thread used to
                          run the main() application entry routine."
 			 
-	cdl_option CYGNUM_POSIX_MAIN_DEFAULT_STACK_SIZE {
-	    display        "main()'s default thread stack size"
-	    flavor         data
-	    legal_values   16 to 0x7fffffff
-	    default_value  8192
-	    description    "
-                POSIX compatibility requires that the application's
-                main() function be invoked in a thread.
-                This option controls the size of that thread's
-                stack, which is allocated in the BSS. It
-                must be a multiple of 8. Note, a low number
-                here may be overriden by the HAL if there is
-                a minimum requirement to process interrupts
-                etc."
-	}
-
 	cdl_option CYGNUM_POSIX_MAIN_DEFAULT_PRIORITY {
 	     display        "main()'s default thread priority"
 	     flavor         data
--- a/packages/compat/posix/current/include/pthread.h
+++ b/packages/compat/posix/current/include/pthread.h
@@ -408,6 +408,13 @@ externC void pthread_cleanup_pop_inner (
                                         int execute);
 
 
+// -------------------------------------------------------------------------
+// eCos-specific function to measure stack usage of the supplied thread
+
+#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
+externC size_t pthread_measure_stack_usage (pthread_t thread);
+#endif
+
 //-----------------------------------------------------------------------------
 #endif // ifndef CYGONCE_PTHREAD_H
 // End of pthread.h
--- a/packages/compat/posix/current/src/pthread.cxx
+++ b/packages/compat/posix/current/src/pthread.cxx
@@ -48,6 +48,7 @@
 #include <pkgconf/kernel.h>
 #include <pkgconf/posix.h>
 #include <pkgconf/isoinfra.h>
+#include <pkgconf/libc_startup.h>
 
 #include <cyg/kernel/ktypes.h>         // base kernel types
 #include <cyg/infra/cyg_trac.h>        // tracing macros
@@ -155,7 +156,7 @@ static pthread_t thread_id_cookie = THRE
 //-----------------------------------------------------------------------------
 // Main thread.
 
-static char main_stack[CYGNUM_POSIX_MAIN_DEFAULT_STACK_SIZE];
+static char main_stack[CYGNUM_LIBC_MAIN_DEFAULT_STACK_SIZE];
 
 // Thread ID of main thread.
 static pthread_t main_thread;
@@ -390,8 +391,8 @@ externC void cyg_posix_pthread_start( vo
 
     pthread_attr_init( &attr );
     pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
-    pthread_attr_setstackaddr( &attr, &main_stack[CYGNUM_POSIX_MAIN_DEFAULT_STACK_SIZE] );
-    pthread_attr_setstacksize( &attr, CYGNUM_POSIX_MAIN_DEFAULT_STACK_SIZE );
+    pthread_attr_setstackaddr( &attr, &main_stack[CYGNUM_LIBC_MAIN_DEFAULT_STACK_SIZE] );
+    pthread_attr_setstacksize( &attr, CYGNUM_LIBC_MAIN_DEFAULT_STACK_SIZE );
     pthread_attr_setschedpolicy( &attr, SCHED_RR );
     pthread_attr_setschedparam( &attr, &schedparam );
     
@@ -2019,4 +2020,19 @@ externC void pthread_cleanup_pop_inner (
 
 
 // -------------------------------------------------------------------------
+// eCos-specific function to measure stack usage of the supplied thread
+
+#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
+externC size_t pthread_measure_stack_usage (pthread_t thread)
+{
+    pthread_info *th = pthread_info_id(thread);
+
+    if ( NULL == th )
+      return (size_t)-1;
+
+    return (size_t)th->thread->measure_stack_usage();
+}
+#endif
+
+// -------------------------------------------------------------------------
 // EOF pthread.cxx
--- a/packages/devs/eth/arm/ebsa285/current/ChangeLog
+++ b/packages/devs/eth/arm/ebsa285/current/ChangeLog
@@ -1,3 +1,16 @@
+2001-01-02  Hugo Tyson  <hmt@redhat.com>
+
+	* src/if_ebsa285.c (find_82559s_match_func): New func to match
+	complex PCI device requirements.
+	(pci_init_find_82559s): Use it, and the new PCI API to correctly
+	match a disparate bunch of devices on the one board.
+
+2000-12-21  Hugo Tyson  <hmt@redhat.com>
+
+	* src/if_ebsa285.c (pci_init_find_82559s): Also check for the PCI
+	device whose name is ... 0x1209; "82559ER".  Thanks to Martin Buck
+	<martin.buck@ascom.ch> for the ID for that.
+
 2000-11-19  Gary Thomas  <gthomas@redhat.com>
 
 	* src/if_ebsa285.c (pci_init_find_82559s): Intel has at least
--- a/packages/devs/eth/arm/ebsa285/current/src/if_ebsa285.c
+++ b/packages/devs/eth/arm/ebsa285/current/src/if_ebsa285.c
@@ -1889,6 +1889,20 @@ i82559_int_op( struct eth_drv_sc *sc, in
 //  o instantiate interrupts for them
 //  o attach those interrupts appropriately
 // ------------------------------------------------------------------------
+static cyg_pci_match_func find_82559s_match_func;
+
+// Intel 82559 and 82557 are virtually identical, with different
+// dev codes; also 82559ER (cutdown) = 0x1209.
+static cyg_bool
+find_82559s_match_func( cyg_uint16 v, cyg_uint16 d, cyg_uint32 c, void *p )
+{
+    return
+        (0x8086 == v) &&
+        ((0x1030 == d) ||
+         (0x1229 == d) ||
+         (0x1209 == d));
+}
+
 static int
 pci_init_find_82559s( void )
 {
@@ -1951,9 +1965,10 @@ pci_init_find_82559s( void )
 
         p_i82559->index = device_index;
 
-        // Intel 82559 and 82557 are virtually identical, with different dev codes
-        if (cyg_pci_find_device(0x8086, 0x1030, &devid) ||
-            cyg_pci_find_device(0x8086, 0x1229, &devid) ) {
+        // See above for find_82559s_match_func - it selects any of several
+        // variants.  This is necessary in case we have multiple mixed-type
+        // devices on one board in arbitrary orders.
+        if (cyg_pci_find_matching( &find_82559s_match_func, NULL, &devid )) {
 #ifdef DEBUG
             db_printf("eth%d = 82559\n", device_index);
 #endif
--- a/packages/devs/eth/arm/edb7xxx/current/ChangeLog
+++ b/packages/devs/eth/arm/edb7xxx/current/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-01  David Geng <deli.geng@ncl.ac.uk> 
+
+	* src/if_edb7xxx.c (cs8900_start): Set 'txbusy' false after reset
+	to prevent erroneous 'missed interrupt' error.
+
 2000-09-17  Gary Thomas  <gthomas@redhat.com>
 
 	* src/if_edb7xxx.c (cs8900_can_send): Add simple timeout on Tx.
--- a/packages/devs/eth/arm/edb7xxx/current/src/if_edb7xxx.c
+++ b/packages/devs/eth/arm/edb7xxx/current/src/if_edb7xxx.c
@@ -251,6 +251,8 @@ static void
 cs8900_start(struct eth_drv_sc *sc, unsigned char *enaddr, int flags)
 {
     unsigned short stat;
+    struct cs8900_priv_data *cpd = (struct cs8900_priv_data *)sc->driver_private;
+
     put_reg(PP_BusCtl, PP_BusCtl_MemoryE);  // Disable interrupts, memory mode
     put_reg(PP_IntReg, PP_IntReg_IRQ0);  // Only possibility
     put_reg(PP_RxCFG, PP_RxCFG_RxOK | PP_RxCFG_CRC | 
@@ -266,6 +268,7 @@ cs8900_start(struct eth_drv_sc *sc, unsi
     put_reg(PP_LineCTL, PP_LineCTL_Rx | PP_LineCTL_Tx);
     // Clear Interrupt Status Queue before enabling interrupts
     while ((stat = CS8900_ISQ) != 0) ;
+    cpd->txbusy = 0;
     put_reg(PP_BusCtl, PP_BusCtl_EnableIRQ);
 }
 
@@ -295,6 +298,7 @@ cs8900_can_send(struct eth_drv_sc *sc)
 {
     struct cs8900_priv_data *cpd = (struct cs8900_priv_data *)sc->driver_private;
     unsigned short stat;
+
     stat = get_reg(PP_LineStat);
     if ((stat & PP_LineStat_LinkOK) == 0) {
         return false;  // Link not connected
@@ -431,6 +435,7 @@ static void
 cs8900_TxEvent(struct eth_drv_sc *sc, int stat)
 {
     struct cs8900_priv_data *cpd = (struct cs8900_priv_data *)sc->driver_private;
+
     stat = get_reg(PP_TER);
     if (net_debug) {
         diag_printf("Tx event: %x\n", stat);
@@ -452,6 +457,7 @@ static void
 cs8900_int(struct eth_drv_sc *sc)
 {
     unsigned short event;
+
     while ((event = CS8900_ISQ) != 0) {
         switch (event & ISQ_EventMask) {
         case ISQ_RxEvent:
@@ -481,6 +487,7 @@ void
 cs8900_fake_int(cyg_addrword_t param)
 {
     int s;
+
     while (true) {
         cyg_thread_delay(5);
         s = splnet();
--- a/packages/devs/eth/powerpc/quicc/current/ChangeLog
+++ b/packages/devs/eth/powerpc/quicc/current/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-03  Gary Thomas  <gthomas@redhat.com>
+
+	* src/if_quicc.c: Add support in RedBoot to keep ESA (since
+	the I2C interface is really broken).
+
 2000-10-20  Gary Thomas  <gthomas@redhat.com>
 
 	* src/if_quicc.c: Changes to compile in stand-alone mode.
--- a/packages/devs/eth/powerpc/quicc/current/src/if_quicc.c
+++ b/packages/devs/eth/powerpc/quicc/current/src/if_quicc.c
@@ -81,6 +81,18 @@ static unsigned char quicc_eth_txbufs[CY
 
 static struct quicc_eth_info quicc_eth0_info;
 static unsigned char enaddr[] = { 0x08, 0x00, 0x3E, 0x28, 0x79, 0xB8};
+#ifdef CYGPKG_REDBOOT
+#include <pkgconf/redboot.h>
+#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#include <redboot.h>
+#include <flash_config.h>
+RedBoot_config_option("Network hardware address [MAC]",
+                      quicc_esa,
+                      ALWAYS_ENABLED, true,
+                      CONFIG_ESA
+    );
+#endif
+#endif
 
 ETH_DRV_SC(quicc_eth0_sc,
            &quicc_eth0_info,   // Driver specific data
@@ -136,7 +148,7 @@ quicc_eth_init(struct cyg_netdevtab_entr
     struct quicc_eth_info *qi = (struct quicc_eth_info *)sc->driver_private;
     volatile EPPC *eppc = (volatile EPPC *)eppc_base();
     struct cp_bufdesc *rxbd, *txbd;
-    unsigned char *RxBUF, *TxBUF, *ep, *ap;
+    unsigned char *RxBUF, *TxBUF, *ep, *ap; 
     volatile struct ethernet_pram *enet_pram;
     volatile struct scc_regs *scc;
     int TxBD, RxBD;
@@ -145,7 +157,19 @@ quicc_eth_init(struct cyg_netdevtab_entr
 
     // Fetch the board address from the VPD
 #define VPD_ETHERNET_ADDRESS 0x08
-    _mbx_fetch_VPD(VPD_ETHERNET_ADDRESS, enaddr, sizeof(enaddr));
+    if (_mbx_fetch_VPD(VPD_ETHERNET_ADDRESS, enaddr, sizeof(enaddr)) == 0) {
+#if defined(CYGPKG_REDBOOT) && \
+    defined(CYGSEM_REDBOOT_FLASH_CONFIG)
+        flash_get_config("quicc_esa", enaddr, CONFIG_ESA);
+#else
+        enet_pram = &eppc->pram[0].enet_scc;
+        ap = &enaddr[sizeof(enaddr)];
+        ep = (unsigned char *)&enet_pram->paddr_h;
+        for (i = 0;  i < sizeof(enaddr);  i++) {
+            *ap++ = *--ep;
+        }
+#endif
+    }
 
     // Ensure consistent state between cache and what the QUICC sees
     HAL_DCACHE_IS_ENABLED(cache_state);
--- a/packages/devs/serial/powerpc/quicc/current/ChangeLog
+++ b/packages/devs/serial/powerpc/quicc/current/ChangeLog
@@ -1,3 +1,10 @@
+2000-12-22  Björn Stenberg <bjorn@haxx.se>
+
+	* src/quicc_smc_serial.c (quicc_smc_serial_init_info): 
+	Set quicc going only after most of the other initialization is
+	complete - otherwise initializing too early causes some of the
+	parameters not to be initialized properly.
+
 2000-12-13  Daniel Lind <daniel.lind@sth.frontec.se>
 
 	* src/quicc_smc_serial.c (quicc_smc_serial_flush): 
--- a/packages/devs/serial/powerpc/quicc/current/src/quicc_smc_serial.c
+++ b/packages/devs/serial/powerpc/quicc/current/src/quicc_smc_serial.c
@@ -303,10 +303,6 @@ quicc_smc_serial_init_info(quicc_smc_ser
     eppc->pip_pbpar |= portBmask;
     eppc->pip_pbdir &= ~portBmask;
     /*
-     *  Reset Rx & Tx params
-     */
-    eppc->cp_cr = smc_chan->channel | QUICC_SMC_CMD_Go | QUICC_SMC_CMD_InitTxRx;
-    /*
      *  SDMA & LCD bus request level 5
      *  (Section 16.10.2.1)
      */
@@ -361,6 +357,10 @@ quicc_smc_serial_init_info(quicc_smc_ser
         txbd++;
     }
     /*
+     *  Reset Rx & Tx params
+     */
+    eppc->cp_cr = smc_chan->channel | QUICC_SMC_CMD_Go | QUICC_SMC_CMD_InitTxRx;
+    /*
      *  Clear any previous events. Enable interrupts.
      *  (Section 16.15.7.14 and 16.15.7.15)
      */
--- a/packages/ecos.db
+++ b/packages/ecos.db
@@ -176,6 +176,7 @@ package CYGPKG_DEVS_FLASH_MBX {
 	   on the Motorola PowerPC/860 MBX platform."
 }
 
+
 package CYGPKG_IO_SERIAL_ARM_EBSA285 {
     alias 	      { "Intel EBSA285 serial driver"
                         devs_serial_arm_ebsa285 ebsa285_serial_driver }
@@ -448,6 +449,7 @@ package CYGPKG_DEVS_ETH_POWERPC_QUICC {
 }
 
 
+
 # Not sure whether this should be "hardware"; if so, it should be mentioned
 # in all targets that can use it.
 package CYGPKG_DEVS_ETH_CF {
--- a/packages/hal/arm/ebsa285/current/ChangeLog
+++ b/packages/hal/arm/ebsa285/current/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-03  Gary Thomas  <gthomas@redhat.com>
+
+	* src/ebsa285_misc.c (hal_delay_us): Slight rearrangement to
+	ensure this works properly on all speeds of platform.
+
 2000-12-11  Gary Thomas  <gthomas@redhat.com>
 
 	* cdl/hal_arm_ebsa285.cdl: 
--- a/packages/hal/arm/ebsa285/current/src/ebsa285_misc.c
+++ b/packages/hal/arm/ebsa285/current/src/ebsa285_misc.c
@@ -377,10 +377,11 @@ void hal_delay_us(cyg_int32 usecs)
 {
     int diff, diff2;
     cyg_uint32 val1, val2;
+
     while (usecs-- > 0) {
         diff = 0;
+        val1 = *SA110_TIMER3_VALUE;
         while (diff < 3) {
-            val1 = *SA110_TIMER3_VALUE;
             while ((val2 = *SA110_TIMER3_VALUE) == val1) ;
             if (*SA110_TIMER3_LOAD) {
                 // A kernel is running, the counter may get reset as we watch
--- a/packages/hal/powerpc/arch/current/ChangeLog
+++ b/packages/hal/powerpc/arch/current/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-03  Gary Thomas  <gthomas@redhat.com>
+
+	* src/hal_intr.c (hal_delay_us): Fix some problems - didn't
+	always work properly, especially on fast processors.
+
 2000-11-21  Gary Thomas  <gthomas@redhat.com>
 
 	* src/vectors.S (rom_vectors): Special handling when vectors
--- a/packages/hal/powerpc/arch/current/src/hal_intr.c
+++ b/packages/hal/powerpc/arch/current/src/hal_intr.c
@@ -61,21 +61,30 @@ hal_IRQ_init(void)
 externC void 
 hal_delay_us(int us)
 {
-    cyg_uint32 old_dec, new_dec;
+    cyg_int32 old_dec, new_dec;
     long ticks;
+    int diff;
+
     // Note: the system constant CYGNUM_HAL_RTC_PERIOD corresponds to 10,000us
     // Scale the desired number of microseconds to be a number of decrementer ticks
+    // Note: this test says "if there is more than one decrementer tick / us"
     if (CYGNUM_HAL_RTC_PERIOD > 10000) {
-        ticks = us * (CYGNUM_HAL_RTC_PERIOD * 100) / 1000000;
+        ticks = ((long long)us * (CYGNUM_HAL_RTC_PERIOD * 100)) / 1000000;
     } else {
         ticks = us / (CYGNUM_HAL_RTC_PERIOD * 100) / 1000000;
     }
     asm volatile("mfdec  %0;" : "=r"(old_dec) : );
-    while (ticks-- > 0) {
+    while (ticks > 0) {
         do {
             asm volatile("mfdec  %0;" : "=r"(new_dec) : );        
         } while (old_dec == new_dec);
+        if (new_dec < 0) {
+            HAL_CLOCK_RESET(0, CYGNUM_HAL_RTC_PERIOD);
+        }
+        diff = (old_dec - new_dec);
+        if (diff < 1) diff = 1;
         old_dec = new_dec;
+        ticks -= diff;
     }
 }
 
--- a/packages/hal/powerpc/mbx/current/ChangeLog
+++ b/packages/hal/powerpc/mbx/current/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-03  Gary Thomas  <gthomas@redhat.com>
+
+	* cdl/hal_powerpc_mbx.cdl: Let RTC [heartbeat] rate be user
+	specified.
+
 2000-10-20  Gary Thomas  <gthomas@redhat.com>
 
 	* include/pkgconf/mlt_powerpc_mbx_ram.mlt: 
--- a/packages/hal/powerpc/mbx/current/cdl/hal_powerpc_mbx.cdl
+++ b/packages/hal/powerpc/mbx/current/cdl/hal_powerpc_mbx.cdl
@@ -154,6 +154,7 @@ cdl_package CYGPKG_HAL_POWERPC_MBX {
         description   "
             Period is busclock/16/100."
         flavor        none
+        no_define
     
         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
             display       "Real-time clock numerator"
@@ -163,12 +164,15 @@ cdl_package CYGPKG_HAL_POWERPC_MBX {
         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
             display       "Real-time clock denominator"
             flavor        data
-            calculated    100
+            default_value 100
+            description   "
+              This option selects the number of system clock 'ticks'
+              per second.  This rate is sometimes known as the heartbeat rate."
         }
         cdl_option CYGNUM_HAL_RTC_PERIOD {
             display       "Real-time clock period"
             flavor        data
-            calculated    { (((CYGHWR_HAL_POWERPC_BOARD_SPEED*1000000)/16)/100) }
+            calculated    { (((CYGHWR_HAL_POWERPC_BOARD_SPEED*1000000)/16)/CYGNUM_HAL_RTC_DENOMINATOR) }
         }
     }
     
@@ -346,6 +350,7 @@ cdl_package CYGPKG_HAL_POWERPC_MBX {
                 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
                 $(OBJCOPY) --strip-debug $< $(@:.bin=.img) 
                 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
+                $(OBJCOPY) -O srec --change-address=0x02040000 $< $(@:.bin=.ppcbug)
                 $(OBJCOPY) -O binary $< $@
             }
         }
--- a/packages/hal/powerpc/quicc/current/ChangeLog
+++ b/packages/hal/powerpc/quicc/current/ChangeLog
@@ -1,3 +1,7 @@
+2001-01-03  Gary Thomas  <gthomas@redhat.com>
+
+	* include/ppc8xx.h: Layout of I2C and IDMA was [slightly] wrong.
+
 2000-08-30  Jesper Skov  <jskov@redhat.com>
 
 	* src/quicc_smc1.c (cyg_hal_plf_serial_init_channel): Move all
--- a/packages/hal/powerpc/quicc/current/include/ppc8xx.h
+++ b/packages/hal/powerpc/quicc/current/include/ppc8xx.h
@@ -880,7 +880,7 @@ typedef struct eppc {
 	    union {
 		struct {
 		    struct i2c_pram	i2c;
-		    unsigned char	RSRVD56[0x18];
+		    unsigned char	RSRVD56[0x10];
 		    struct idma_pram	idma1;
 		} i2c_idma;
 		struct {
--- a/packages/hal/sh/arch/current/ChangeLog
+++ b/packages/hal/sh/arch/current/ChangeLog
@@ -1,3 +1,7 @@
+2001-01-04  Jesper Skov  <jskov@redhat.com>
+
+	* src/sh.ld: Make sure .data and .bss section sizes are aligned.
+
 2000-12-13  Jesper Skov  <jskov@redhat.com>
 2000-12-13  Jonathan Larmour  <jlarmour@redhat.com>
 
--- a/packages/hal/sh/arch/current/src/sh.ld
+++ b/packages/hal/sh/arch/current/src/sh.ld
@@ -82,6 +82,7 @@ GROUP(libtarget.a libgcc.a)
     . = ALIGN(8);							 \
       KEEP(*( SORT (.ecos.table.*))) ;					 \
       *(.got*) *(.rela.got)						 \
+    . = ALIGN(4);                                                        \
     } > _region_							 \
     CYG_LABEL_DEFN(_rom_data_start) = LOADADDR(.data);			 \
     CYG_LABEL_DEFN(_ram_data_end) = .; PROVIDE(_ram_data_end = .);	 \
@@ -119,6 +120,7 @@ GROUP(libtarget.a libgcc.a)
     .bss _vma_ : _lma_					\
     { CYG_LABEL_DEFN(_bss_start) = ABSOLUTE (.);	\
       FORCE_OUTPUT; *(.dynbss) *(.bss) *(COMMON)	\
+      . = ALIGN(4);                                     \
       CYG_LABEL_DEFN(_bss_end) = ABSOLUTE (.); }	\
     > _region_
 
--- a/packages/io/eth/current/ChangeLog
+++ b/packages/io/eth/current/ChangeLog
@@ -1,3 +1,7 @@
+2001-01-04  Gary Thomas  <gthomas@redhat.com>
+
+	* src/net/eth_drv.c (eth_drv_tx_done): Update count of Tx packets.
+
 2000-12-11  Gary Thomas  <gthomas@redhat.com>
 
 	* src/net/eth_drv.c (eth_drv_run_deliveries): Support ^C when
--- a/packages/io/eth/current/src/net/eth_drv.c
+++ b/packages/io/eth/current/src/net/eth_drv.c
@@ -556,7 +556,9 @@ eth_drv_tx_done(struct eth_drv_sc *sc, C
 {
     struct ifnet *ifp = &sc->sc_arpcom.ac_if;
     struct mbuf *m0 = (struct mbuf *)key;
+
     // Check for errors here (via 'status')
+    ifp->if_opackets++;
     // Done with packet
     mbuf_key = m0;
     m_freem(m0);
--- a/packages/io/pci/current/ChangeLog
+++ b/packages/io/pci/current/ChangeLog
@@ -1,3 +1,20 @@
+2001-01-02  Hugo Tyson  <hmt@redhat.com>
+
+	* include/pci.h: Define new API to perform more generalized matching
+	on device properties.
+
+	* src/pci.c (cyg_pci_find_matching): New API implementation.
+
+2000-12-21  Mark Salter  <msalter@redhat.com>
+
+	* include/pci_hw.h: Add platform hook so certain devices
+	can be skipped by generic PCI io code. This is a workaround
+	for a hw problem where configuration space cycles on some
+	devices cause a bus lockup.
+	
+	* src/pci.c (cyg_pci_find_next): Use platform hook to ignore
+	certain devices during device search.
+
 2000-12-02  Gary Thomas  <gthomas@redhat.com>
 
 	* src/pci.c: 
--- a/packages/io/pci/current/include/pci.h
+++ b/packages/io/pci/current/include/pci.h
@@ -205,6 +205,26 @@ externC cyg_bool cyg_pci_find_device( cy
 externC cyg_bool cyg_pci_find_class( cyg_uint32 dev_class,
                                      cyg_pci_device_id *devid );
 
+
+
+// Searches the PCI bus configuration space for a device whose properties
+// match those required by the match_func, which the user supplies.  The
+// match_func's arguments are vendor, device, class exactly as they might
+// be in the two APIs above.  The additional parameter is for any state
+// which a caller might wish available to its callback routine.
+// The search starts at the device pointed to by
+// devid, or at the first slot if it contains CYG_PCI_NULL_DEVID.  *devid
+// will be updated with the ID of the next device found.  Returns true if
+// one is found and false if not.
+typedef cyg_bool (cyg_pci_match_func)( cyg_uint16,/* vendor */
+                                       cyg_uint16,/* device */
+                                       cyg_uint32,/* class  */
+                                       void * /* arbitrary user data */ );
+externC cyg_bool cyg_pci_find_matching( cyg_pci_match_func *matchp,
+                                        void * match_callback_data,
+                                        cyg_pci_device_id *devid );
+
+
 // Searches the PCI configuration space for the next valid device
 // after cur_devid. If cur_devid is given the value
 // CYG_PCI_NULL_DEVID, then the search starts at the first slot. It
--- a/packages/io/pci/current/include/pci_hw.h
+++ b/packages/io/pci/current/include/pci_hw.h
@@ -69,6 +69,16 @@
 #define CYG_PCI_DEV_GET_DEV(__devfn) ((__devfn>>3)&0x1f)
 #define CYG_PCI_DEV_GET_FN(__devfn) (__devfn&0x7)
 
+// Some buggy PCI chips force us to ignore certain devices so that
+// they may be handled specially.
+#ifdef HAL_PCI_IGNORE_DEVICE
+#define CYG_PCI_IGNORE_DEVICE(__bus, __dev, __fn) \
+            HAL_PCI_IGNORE_DEVICE((__bus), (__dev), (__fn))
+#else
+#define CYG_PCI_IGNORE_DEVICE(__bus, __dev, __fn) 0
+#endif
+
+
 // Init
 externC void cyg_pcihw_init(void);
 
@@ -97,3 +107,4 @@ externC cyg_bool cyg_pcihw_translate_int
 //-----------------------------------------------------------------------------
 #endif // ifndef CYGONCE_PCI_HW_H
 // End of pci_hw.h
+
--- a/packages/io/pci/current/src/pci.c
+++ b/packages/io/pci/current/src/pci.c
@@ -448,6 +448,10 @@ cyg_pci_find_next( cyg_pci_device_id cur
         for (;dev < CYG_PCI_MAX_DEV; dev++, fn=0) {
             for (;fn < CYG_PCI_MAX_FN; fn++) {
                 cyg_uint16 vendor;
+
+		if (CYG_PCI_IGNORE_DEVICE(bus, dev, fn))
+		    continue;
+
                 devfn = CYG_PCI_DEV_MAKE_DEVFN(dev, fn);
                 cyg_pcihw_read_config_uint16(bus, devfn,
                                              CYG_PCI_CFG_VENDOR, &vendor);
@@ -528,6 +532,44 @@ cyg_pci_find_class( cyg_uint32 dev_class
     return false;
 }
 
+cyg_bool
+cyg_pci_find_matching( cyg_pci_match_func *matchp, 
+                       void * match_callback_data,
+                       cyg_pci_device_id *devid )
+{
+    cyg_pci_device_id new_devid = *devid;
+
+#ifdef CYGPKG_IO_PCI_DEBUG
+    printf("cyg_pci_find_matching - func is at %x\n", (unsigned int)matchp);
+#endif
+    // Scan entire bus, check for matches on valid devices.
+    while (cyg_pci_find_next(new_devid, &new_devid)) {
+        cyg_uint8 bus = CYG_PCI_DEV_GET_BUS(new_devid);
+        cyg_uint8 devfn = CYG_PCI_DEV_GET_DEVFN(new_devid);
+        cyg_uint16 v, d;
+        cyg_uint32 c;
+
+        // Check that vendor, device and class match.
+        cyg_pcihw_read_config_uint16(bus, devfn,
+                                     CYG_PCI_CFG_VENDOR, &v);
+        cyg_pcihw_read_config_uint16(bus, devfn,
+                                     CYG_PCI_CFG_DEVICE, &d);
+        cyg_pcihw_read_config_uint32(bus, devfn,
+                                     CYG_PCI_CFG_CLASS_REV, &c);
+        c >>= 8;
+#ifdef CYGPKG_IO_PCI_DEBUG
+        printf("... PCI vendor = %x, device = %x, class %x\n", v, d, c);
+#endif
+        // Check that device matches as the caller desires:
+        if ( (*matchp)(v, d, c, match_callback_data) ) {
+            *devid = new_devid;
+            return true;
+        }
+    }
+
+    return false;
+}
+
 //------------------------------------------------------------------------
 // Resource Allocation
 
--- a/packages/kernel/current/ChangeLog
+++ b/packages/kernel/current/ChangeLog
@@ -1,3 +1,30 @@
+2000-12-22  Jonathan Larmour  <jlarmour@redhat.com>
+
+	* include/thread.inl (check_stack): check word alignment with CYG_WORD
+	not cyg_uint32
+	Add extra stack checking for when stack limits are used.
+	(measure_stack_usage): New function to measure stack usage of the thread
+	(attach_stack): check word alignment with CYG_WORD not cyg_uint32
+	Initialize stack to preset value when measuring stack usage
+	(increment_stack_limit): Conditionalize here wrt 
+	CYGFUN_KERNEL_THREADS_STACK_CHECKING and use the version in thread.cxx
+	instead if CYGFUN_KERNEL_THREADS_STACK_CHECKING is defined.
+
+	* src/common/thread.cxx (exit): If verbose stack measurement enabled,
+	output stack usage
+	(increment_stack_limit): Add version of this method when
+	CYGFUN_KERNEL_THREADS_STACK_CHECKING *is* defined. This will add
+	padding above the stack limit as necessary.
+
+	* include/thread.hxx (class Cyg_HardwareThread): Add
+	measure_stack_usage() member
+
+	* cdl/thread.cdl (CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT):
+	Add to implement stack usage measurement.
+
+	* include/kapi.h (cyg_thread_measure_stack_usage): New function
+	* src/common/kapi.cxx (cyg_thread_measure_stack_usage): New function
+
 2000-12-08  Jonathan Larmour  <jlarmour@redhat.com>
 
 	* cdl/thread.cdl (CYGFUN_KERNEL_ALL_THREADS_STACK_CHECKING): 
--- a/packages/kernel/current/cdl/thread.cdl
+++ b/packages/kernel/current/cdl/thread.cdl
@@ -120,6 +120,28 @@ cdl_component CYGFUN_KERNEL_THREADS_STAC
     }
 }
 
+cdl_component CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT {
+    display            "Measure stack usage"
+    default_value      { 0 != CYGPKG_INFRA_DEBUG }
+    description "
+        This option allows measurement of each thread's stack by initializing
+        it to a predefined value at thread creation time. Later use of the
+	cyg_thread_measure_stack_usage() function allows the maximum stack
+	usage of the thread so far to be obtained. Note that this is not
+	necessarily the true maximum stack usage that the thread will ever
+	use since all that has been measured is the stack usage corresponding
+	to the code path followed this time, and not the code path that may
+	be followed in future."
+
+    cdl_option CYGDBG_KERNEL_THREADS_STACK_MEASUREMENT_VERBOSE_EXIT {
+	display        "Output stack usage on thread exit"
+        default_value  0
+        description    "
+            This will output the measured stack usage on the diagnostic
+            output when a thread exits."
+    }
+}
+
 cdl_component CYGVAR_KERNEL_THREADS_DATA {
     display            "Support for per-thread data"
     requires           CYGFUN_KERNEL_THREADS_STACK_LIMIT
--- a/packages/kernel/current/include/kapi.h
+++ b/packages/kernel/current/include/kapi.h
@@ -186,6 +186,9 @@ cyg_addrword_t cyg_thread_get_stack_base
 
 cyg_uint32 cyg_thread_get_stack_size(cyg_handle_t thread);
 
+#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
+cyg_uint32 cyg_thread_measure_stack_usage(cyg_handle_t thread);
+#endif
 
 /*---------------------------------------------------------------------------*/
 /* Per-thread Data                                                           */
--- a/packages/kernel/current/include/thread.hxx
+++ b/packages/kernel/current/include/thread.hxx
@@ -162,6 +162,11 @@ public:
     inline void check_stack(void);
 
 #endif
+#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
+
+    inline cyg_uint32 measure_stack_usage(void);
+
+#endif
 };
 
 // -------------------------------------------------------------------------
--- a/packages/kernel/current/include/thread.inl
+++ b/packages/kernel/current/include/thread.inl
@@ -86,10 +86,10 @@ inline void Cyg_HardwareThread::check_st
     cyg_uint32 sig = (cyg_uint32)this;
     cyg_uint32 *base = (cyg_uint32 *)get_stack_base();
     cyg_uint32 *top =  (cyg_uint32 *)(stack_base + stack_size);
-    unsigned int i;
+    cyg_ucount32 i;
 
-    CYG_ASSERT( 0 == (3 & (cyg_uint32)base), "stack base not word aligned" );
-    CYG_ASSERT( 0 == (3 & (cyg_uint32)top),  "stack  top not word aligned" );
+    CYG_ASSERT( 0 == ((sizeof(CYG_WORD)-1) & (cyg_uint32)base), "stack base not word aligned" );
+    CYG_ASSERT( 0 == ((sizeof(CYG_WORD)-1) & (cyg_uint32)top),  "stack  top not word aligned" );
 
     CYG_ASSERT( (cyg_uint32)stack_ptr > (cyg_uint32)stack_base,
                 "Stack_ptr below base" );
@@ -102,6 +102,47 @@ inline void Cyg_HardwareThread::check_st
         CYG_ASSERT( (sig ^ (i * 0x01010101)) == base[i], "Stack base corrupt" );
         CYG_ASSERT( (sig ^ (i * 0x10101010)) ==  top[i], "Stack top corrupt"  );
     }            
+
+#ifdef CYGFUN_KERNEL_THREADS_STACK_LIMIT
+    // we won't have added check data above the stack limit if it hasn't
+    // been incremented
+    if (stack_limit != stack_base) {
+        CYG_ADDRESS limit = stack_limit;
+        // the limit will be off by the check data size, so lets correct it
+        limit -= CYGNUM_KERNEL_THREADS_STACK_CHECK_DATA_SIZE;
+        
+        // determine base of check data by rounding up to nearest word aligned
+        // address if not already aligned
+        cyg_uint32 *p = (cyg_uint32 *)((limit + 3) & ~3);
+        // i.e. + sizeof(cyg_uint32)-1) & ~(sizeof(cyg_uint32)-1);
+        
+        for ( i = 0;
+              i < CYGNUM_KERNEL_THREADS_STACK_CHECK_DATA_SIZE/sizeof(cyg_uint32);
+              i++ ) {
+            CYG_ASSERT( (sig ^ (i * 0x01010101)) == p[i],
+                        "Gap between stack limit and base corrupt" );
+        }
+    }
+#endif
+}
+#endif
+
+// -------------------------------------------------------------------------
+// Measure the stack usage of the thread
+#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
+inline cyg_uint32 Cyg_HardwareThread::measure_stack_usage(void)
+{
+    CYG_WORD *base = (CYG_WORD *)stack_base;
+    cyg_uint32 size = stack_size/sizeof(CYG_WORD);
+    cyg_ucount32 i;
+
+    // Work up the stack comparing with the preset value
+    // We assume the stack grows downwards, hmm...
+    for (i=0; i<size; i++) {
+	if (base[i] != 0xDEADBEEF)
+	  break;
+    }
+    return (size - i)*sizeof(CYG_WORD);
 }
 #endif
 
@@ -124,8 +165,8 @@ inline void Cyg_HardwareThread::attach_s
 
         unsigned int i;
 
-        CYG_ASSERT( 0 == (3 & (cyg_uint32)base), "stack base alignment" );
-        CYG_ASSERT( 0 == (3 & (cyg_uint32)top),  "stack  top alignment" );
+        CYG_ASSERT( 0 == ((sizeof(CYG_WORD)-1) & (cyg_uint32)base), "stack base alignment" );
+        CYG_ASSERT( 0 == ((sizeof(CYG_WORD)-1) & (cyg_uint32)top),  "stack  top alignment" );
 
         for ( i = 0;
               i < CYGNUM_KERNEL_THREADS_STACK_CHECK_DATA_SIZE/sizeof(cyg_uint32);
@@ -145,7 +186,24 @@ inline void Cyg_HardwareThread::attach_s
                     "Stack size too small after allocating checking buffer");
     }
 #endif
+#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
+    {
+	CYG_WORD *base = (CYG_WORD *)s_base;
+	cyg_uint32 size = s_size/sizeof(CYG_WORD);
+	cyg_ucount32 i;
 
+	// initialize all of stack with known value - don't choose 0
+	// could do with pseudo value as above, but this way, checking
+	// is faster
+	for (i=0; i<size; i++) {
+		base[i] = 0xDEADBEEF;
+	}
+	// Don't bother about the case when the stack isn't a multiple of
+	// CYG_WORD in size. Since it's at the top of the stack, it will
+	// almost certainly be overwritten the instant the thread starts
+	// anyway.
+    }
+#endif
     stack_base = s_base;
     stack_size = s_size;
 #ifdef CYGFUN_KERNEL_THREADS_STACK_LIMIT
@@ -269,12 +327,15 @@ inline CYG_ADDRWORD Cyg_HardwareThread::
 
 #ifdef CYGFUN_KERNEL_THREADS_STACK_LIMIT
 
-inline void *Cyg_HardwareThread::increment_stack_limit( cyg_ucount32 size)
+#ifndef CYGFUN_KERNEL_THREADS_STACK_CHECKING
+// if stack checking, implementation is in thread.cxx
+inline void *Cyg_HardwareThread::increment_stack_limit( cyg_ucount32 size )
 {
+    void *ret = (void *)stack_limit;
     stack_limit += size;
-    return (void *)(stack_limit - size);
+    return ret;
 }
-
+#endif
     
 inline CYG_ADDRESS
 Cyg_HardwareThread::get_stack_limit()
--- a/packages/kernel/current/src/common/kapi.cxx
+++ b/packages/kernel/current/src/common/kapi.cxx
@@ -277,6 +277,12 @@ externC cyg_uint32 cyg_thread_get_stack_
     return ((Cyg_Thread *)thread)->get_stack_size();
 }
 
+#ifdef CYGFUN_KERNEL_THREADS_STACK_MEASUREMENT
+externC cyg_uint32 cyg_thread_measure_stack_usage(cyg_handle_t thread)
+{
+    return ((Cyg_Thread *)thread)->measure_stack_usage();
+}
+#endif
 
 /*---------------------------------------------------------------------------*/
 /* Per-thread data                                                           */
--- a/packages/kernel/current/src/common/thread.cxx
+++ b/packages/kernel/current/src/common/thread.cxx
@@ -60,6 +60,10 @@
 #include <cyg/kernel/sched.inl>         // scheduler inlines
 #include <cyg/kernel/clock.inl>         // clock inlines
 
+#ifdef CYGDBG_KERNEL_THREADS_STACK_MEASUREMENT_VERBOSE_EXIT
+#include <cyg/infra/diag.h>
+#endif
+
 // =========================================================================
 // Cyg_HardwareThread members
 
@@ -302,6 +306,9 @@ Cyg_Thread::check_this( cyg_assert_class
         // of the executing thread.
         if( (stack_ptr > (stack_base + stack_size)) ||
             (stack_ptr < stack_base) ) return false;
+#ifdef CYGFUN_KERNEL_THREADS_STACK_LIMIT
+        if( stack_ptr < stack_limit ) return false;
+#endif
     case cyg_trivial:
     case cyg_none:
     default:
@@ -718,6 +725,11 @@ Cyg_Thread::exit()
 
     Cyg_Thread *self = Cyg_Thread::self();
 
+#ifdef CYGDBG_KERNEL_THREADS_STACK_MEASUREMENT_VERBOSE_EXIT
+    diag_printf( "Stack usage for thread %08x: %d\n", self,
+		 self->measure_stack_usage() );
+#endif
+
     Cyg_Scheduler::lock();
 
     // clear the timer; if there was none, no worries.
@@ -1031,6 +1043,56 @@ void Cyg_Thread::free_data_index( cyg_uc
 
 #endif
 
+// -------------------------------------------------------------------------
+// Allocate some memory at the lower end of the stack
+// by moving the stack limit pointer.
+
+#if defined(CYGFUN_KERNEL_THREADS_STACK_LIMIT) && \
+    defined(CYGFUN_KERNEL_THREADS_STACK_CHECKING)
+// if not doing stack checking, implementation can be found in thread.inl
+// This implementation puts the magic buffer area (to watch for overruns
+// *above* the stack limit, i.e. there is no official demarcation between
+// the stack and the buffer. But that's okay if you think about it... having
+// a demarcation would not accomplish anything more.
+void *Cyg_HardwareThread::increment_stack_limit( cyg_ucount32 size )
+{
+    void *ret = (void *)stack_limit;
+
+    // First lock the scheduler because we're going to be tinkering with
+    // the check data
+    Cyg_Scheduler::lock();
+
+    // if we've inc'd the limit before, it will be off by the check data
+    // size, so lets correct it
+    if (stack_limit != stack_base)
+        stack_limit -= CYGNUM_KERNEL_THREADS_STACK_CHECK_DATA_SIZE;
+    stack_limit += size;
+
+    // determine base of check data by rounding up to nearest word aligned
+    // address if not already aligned
+    cyg_uint32 *p = (cyg_uint32 *)((stack_limit + 3) & ~3);
+    // i.e. + sizeof(cyg_uint32)-1) & ~(sizeof(cyg_uint32)-1);
+    cyg_ucount32 i;
+    cyg_uint32 sig = (cyg_uint32)this;
+    
+    for ( i = 0;
+          i < CYGNUM_KERNEL_THREADS_STACK_CHECK_DATA_SIZE/sizeof(cyg_uint32);
+          i++ ) {
+        p[i] = (sig ^ (i * 0x01010101));
+    }
+
+    // increment limit by the check size. Note this will not necessarily
+    // reach the end of the check data. But that doesn't really matter.
+    // Doing this allows better checking of the saved stack pointer in
+    // Cyg_Thread::check_this()
+    stack_limit += CYGNUM_KERNEL_THREADS_STACK_CHECK_DATA_SIZE;
+
+    Cyg_Scheduler::unlock();
+    
+    return ret;
+}
+#endif
+    
 // =========================================================================
 // Cyg_ThreadTimer member functions
 
--- a/packages/language/c/libc/startup/current/ChangeLog
+++ b/packages/language/c/libc/startup/current/ChangeLog
@@ -1,3 +1,15 @@
+2000-12-22  Jonathan Larmour  <jlarmour@redhat.com>
+
+	* cdl/startup.cdl: Allow others to say whether main() can be invoked
+	elsewhere.
+	Use defaults for startup context implementor using above interface
+	rather than POSIX pthread package.
+	Allow main() stack to be visible for other implementors, except
+	when called from the init context since the stack size isn't used
+	there, or when the implementation says it doesn't use it.
+	Define an interface to express that the stack size option
+	isn't used in such cases.
+	
 2000-10-12  Jonathan Larmour  <jlarmour@redhat.com>
 
 	* cdl/startup.cdl (CYGSEM_LIBC_INVOKE_DEFAULT_STATIC_CONSTRUCTORS):
--- a/packages/language/c/libc/startup/current/cdl/startup.cdl
+++ b/packages/language/c/libc/startup/current/cdl/startup.cdl
@@ -68,6 +68,13 @@ cdl_package CYGPKG_LIBC_STARTUP {
 
 # ====================================================================
 
+    cdl_interface CYGINT_LIBC_STARTUP_EXTERNAL_INVOKE_MAIN_POSSIBLE {
+        display       "main() can be invoked elsewhere"
+        description   "Implementors of this interface show that they
+                       allow main() to be invoked elsewhere."
+        flavor        bool
+        no_define
+    }
 
     cdl_option CYGDAT_LIBC_ARGUMENTS {
         display       "Arguments to main()"
@@ -97,6 +104,7 @@ cdl_package CYGPKG_LIBC_STARTUP {
 
         cdl_interface CYGINT_LIBC_STARTUP_CONTEXT {
             display       "Startup context implementors"
+            no_define
         }
 
 
@@ -116,21 +124,24 @@ cdl_package CYGPKG_LIBC_STARTUP {
                            re-entrant functions from within main() in
                            this case."
             flavor        bool
-            default_value { 0 == CYGPKG_KERNEL && 0 == CYGPKG_POSIX_PTHREAD }
+            default_value { 0 == CYGPKG_KERNEL && 0 == 
+                            CYGINT_LIBC_STARTUP_EXTERNAL_INVOKE_MAIN_POSSIBLE }
             implements    CYGINT_LIBC_STARTUP_CONTEXT
+            implements    CYGINT_LIBC_STARTUP_MAIN_NO_STACK_SIZE
         }
 
         cdl_component CYGSEM_LIBC_STARTUP_MAIN_THREAD {
             display       "Invoked as eCos thread"
             requires      CYGPKG_KERNEL
             flavor        bool
-            default_value { 0 != CYGPKG_KERNEL && 0 == CYGPKG_POSIX_PTHREAD }
+            default_value { 0 != CYGPKG_KERNEL && 0 == \
+                            CYGINT_LIBC_STARTUP_EXTERNAL_INVOKE_MAIN_POSSIBLE }
             implements    CYGINT_LIBC_STARTUP_CONTEXT
             description   "
                 With this option selected, main() is invoked from an eCos
                 thread."
         
-            cdl_component CYGSEM_LIBC_MAIN_STACK_FROM_SYSTEM {
+            cdl_option CYGSEM_LIBC_MAIN_STACK_FROM_SYSTEM {
                 display        "System provides stack for main()'s thread"
                 description    "
                     This option controls whether the stack of
@@ -145,24 +156,6 @@ cdl_package CYGPKG_LIBC_STARTUP {
                     This must be a multiple of 8."
                 flavor         bool
                 default_value  1
-        
-                cdl_option CYGNUM_LIBC_MAIN_DEFAULT_STACK_SIZE {
-                    display        "main()'s default thread stack size"
-                    flavor         data
-                    legal_values   16 to 0x7fffffff
-                    default_value  8192
-                    description    "
-                        With an eCos kernel, when the cyg_iso_c_start()
-                        function is used to invoke the user-supplied
-                        main() function in an ISO C compatible fashion,
-                        a separate thread is created to call main().
-                        This option controls the size of that thread's
-                        stack, which is allocated in the BSS. It
-                        must be a multiple of 8. Note, a low number
-                        here may be overriden by the HAL if there is
-                        a minimum requirement to process interrupts
-                        etc."
-                }
             }
 
             cdl_option CYGNUM_LIBC_MAIN_THREAD_PRIORITY {
@@ -185,11 +178,45 @@ cdl_package CYGPKG_LIBC_STARTUP {
             description   "With this option selected, main() must be
                            invoked by a separate package, or by the user."
             flavor        bool
-            default_value { 0 != CYGPKG_POSIX_PTHREAD }
+            default_value { 0 != \
+                            CYGINT_LIBC_STARTUP_EXTERNAL_INVOKE_MAIN_POSSIBLE }
+            requires      CYGINT_LIBC_STARTUP_EXTERNAL_INVOKE_MAIN_POSSIBLE
             implements    CYGINT_LIBC_STARTUP_CONTEXT
         }
     }
     
+    cdl_interface CYGINT_LIBC_STARTUP_MAIN_NO_STACK_SIZE {
+        display        "Don't allow main()'s stack size to be set"
+        description    "This interface describes whether the stack size
+                        value set in this package is supported by the
+                        implementation that invokes main. If not, that
+                        option is disabled."
+        flavor         bool
+        no_define
+    }
+        
+    cdl_option CYGNUM_LIBC_MAIN_DEFAULT_STACK_SIZE {
+        display        "main()'s default thread stack size"
+        flavor         data
+        legal_values   16 to 0x7fffffff
+        default_value  8192
+        active_if      !CYGINT_LIBC_STARTUP_MAIN_NO_STACK_SIZE
+        description    "
+            This option sets the size of the stack used
+            in the context that invokes main(). For example,
+            with an eCos kernel, when the cyg_iso_c_start()
+            function is used to invoke the user-supplied
+            main() function in an ISO C compatible fashion,
+            a separate thread is created to call main().
+            This option controls the size of that thread's
+            stack, which is allocated in the BSS. It
+            must be a multiple of 8. Note, a low number
+            here may be overriden by the HAL if there is
+            a minimum requirement to process interrupts
+            etc. This option cannot be set if the implementation
+            that invokes main() does not use it."
+    }
+
     cdl_component CYGFUN_LIBC_ATEXIT {
         display        "Include atexit() function"
         flavor         bool
--- a/packages/net/tcpip/current/ChangeLog
+++ b/packages/net/tcpip/current/ChangeLog
@@ -1,3 +1,24 @@
+2001-01-03  Hugo Tyson  <hmt@redhat.com>
+
+	* tests/linux_echo.c: New file to test for network bandwidth
+	limitations in host side.  Builds to a linux version of the
+	tcp_echo middleman.
+
+	* tests/make.linux (all): Build linux_echo.
+
+2001-01-03  Hugo Tyson  <hmt@redhat.com>
+
+	* include/dhcp.h (struct dhcp_lease): Define the semaphore pointer
+	field in each lease structure.
+
+	* src/lib/dhcp_support.c: Initialize the dhcp_lease structs to
+	point to the semaphore "dhcp_needs_attention".
+
+	* src/lib/dhcp_prot.c (alarm_function): Post to the semaphore
+	pointed to in the lease structure, rather than one hard-coded.
+	This is much cleaner, in that dhcp_prot.c now uses no external
+	variables, all state goes through the API.
+
 2000-11-15  Hugo Tyson  <hmt@redhat.com>
 
 	* src/lib/bootp_support.c (init_net): Do a SIOCSIFADDR a 2nd time
@@ -1163,7 +1184,7 @@ 2000-02-08  John Dallaway  <jld@cygnus.c
 //                                                                          
 // 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/net/tcpip/current/include/dhcp.h
+++ b/packages/net/tcpip/current/include/dhcp.h
@@ -113,9 +113,11 @@ extern cyg_uint8   eth0_dhcpstate;
 extern cyg_uint8   eth1_dhcpstate;
 #endif
 
-// This is public so the app wait on it or poll it when managing DHCP
+// This is public so the app can wait on it or poll it when managing DHCP
 // itself.  It will be zero while the app should wait, and posted when a
-// call to do_dhcp() is needed.
+// call to do_dhcp() is needed.  If, instead, the app wishes to manage DHCP
+// with a thread per interface somehow, then separate semaphores may be used.
+// See the dhcp_lease structure definition below.
 extern cyg_sem_t dhcp_needs_attention;
 
 // This routine is used at startup time, and after relinquishing leases or
@@ -220,13 +222,20 @@ extern void dhcp_mgt_entry( cyg_addrword
 #define DHCP_LEASE_EX 4
 
 struct dhcp_lease {
+    // Client settable: Semaphore to signal when attention is needed:
+    cyg_sem_t          *needs_attention;
+    // Initialize all the rest to zero:
     cyg_tick_count_t    t1, t2, expiry;
     volatile cyg_uint8  next;
     volatile cyg_uint8  which;
     cyg_handle_t        alarm;
+    // except this one, which is just some space:
     cyg_alarm           alarm_obj;
 };
 
+// These dhcp_lease objects are initialized to use
+//         extern cyg_sem_t dhcp_needs_attention;
+// for the semaphore.
 #ifdef CYGHWR_NET_DRIVER_ETH0
 extern struct dhcp_lease eth0_lease;
 #endif
--- a/packages/net/tcpip/current/src/lib/dhcp_prot.c
+++ b/packages/net/tcpip/current/src/lib/dhcp_prot.c
@@ -271,7 +271,8 @@ static void alarm_function(cyg_handle_t 
 {
     struct dhcp_lease *lease = (struct dhcp_lease *)data;
     lease->which |= lease->next;
-    cyg_semaphore_post( &dhcp_needs_attention );
+    if ( lease->needs_attention )
+        cyg_semaphore_post( lease->needs_attention );
 
     // Step the lease on into its next state of being alarmed ;-)
     if ( lease->next & DHCP_LEASE_EX ) {
--- a/packages/net/tcpip/current/src/lib/dhcp_support.c
+++ b/packages/net/tcpip/current/src/lib/dhcp_support.c
@@ -60,10 +60,10 @@ cyg_uint8   eth1_dhcpstate = 0;
 cyg_sem_t dhcp_needs_attention;
 
 #ifdef CYGHWR_NET_DRIVER_ETH0
-struct dhcp_lease eth0_lease = { 0,0,0,0 };
+struct dhcp_lease eth0_lease = { &dhcp_needs_attention, 0,0,0,0,0,0 };
 #endif
 #ifdef CYGHWR_NET_DRIVER_ETH1
-struct dhcp_lease eth1_lease = { 0,0,0,0 };
+struct dhcp_lease eth1_lease = { &dhcp_needs_attention, 0,0,0,0,0,0 };
 #endif
 
 // ---------------------------------------------------------------------------
new file mode 100644
--- /dev/null
+++ b/packages/net/tcpip/current/tests/linux_echo.c
@@ -0,0 +1,304 @@
+//==========================================================================
+//
+//      tests/linux_echo.c
+//
+//      Simple TCP throughput test - echo component FOR LINUX HOST
+//      * CAUTION: host, i.e. non eCos, only *
+//
+//==========================================================================
+//####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####
+//####BSDCOPYRIGHTBEGIN####
+//
+// -------------------------------------------
+//
+// Portions of this software may have been derived from OpenBSD or other sources,
+// and are covered by the appropriate copyright disclaimers included herein.
+//
+// -------------------------------------------
+//
+//####BSDCOPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):    gthomas
+// Contributors: gthomas
+// Date:         2000-01-10
+// Purpose:      
+// Description:  This is the middle part of a three part test.  The idea is
+//   to test the throughput of box in a configuration like this:
+//
+//      +------+   port   +----+     port    +----+
+//      |SOURCE|=========>|ECHO|============>|SINK|
+//      +------+   9990   +----+     9991    +----+
+// 
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#undef _KERNEL
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <sys/errno.h>
+#include <sys/time.h>
+
+#include <net/if.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
+#include <net/route.h>
+
+#include <netdb.h>
+
+#define true 1
+#define false 1
+
+#define TNR_ON()
+#define TNR_OFF()
+
+#define diag_printf printf
+
+void
+pexit(char *s)
+{
+    perror(s);
+    exit(1);
+}
+
+
+#define SOURCE_PORT 9990
+#define SINK_PORT   9991
+
+#define MAX_BUF 8192
+static unsigned char data_buf[MAX_BUF];
+
+struct test_params {
+    long nbufs;
+    long bufsize;
+    long load;
+};
+
+struct test_status {
+    long ok;
+};
+
+int max( int a, int b ) { return (a>b)?a:b; }
+int min( int a, int b ) { return (a<b)?a:b; }
+
+
+int
+do_read(int s, void *_buf, int len)
+{
+    int total, slen, rlen;
+    unsigned char *buf = (unsigned char *)_buf;
+    total = 0;
+    rlen = len;
+    while (total < len) {
+        slen = read(s, buf, rlen);
+        if (slen != rlen) {
+            if (slen < 0) {
+                diag_printf("Error after reading %d bytes\n", total);
+                return -1;
+            }
+            rlen -= slen;
+            buf += slen;
+        }
+        total += slen;
+    }
+    return total;
+}
+
+int
+do_write(int s, void *_buf, int len)
+{
+    int total, slen, rlen;
+    unsigned char *buf = (unsigned char *)_buf;
+    total = 0;
+    rlen = len;
+    while (total < len) {
+        slen = write(s, buf, rlen);
+        if (slen != rlen) {
+            if (slen < 0) {
+                diag_printf("Error after writing %d bytes\n", total);
+                return -1;
+            }
+            rlen -= slen;
+            buf += slen;
+        }
+        total += slen;
+    }
+    return total;
+}
+
+static void
+echo_test(void * p)
+{
+    int s_source, s_sink, e_source, e_sink;
+    struct sockaddr_in e_source_addr, e_sink_addr, local;
+    int one = 1;
+    fd_set in_fds;
+    int i, num, len;
+    struct test_params params,nparams;
+    struct test_status status,nstatus;
+
+    s_source = socket(AF_INET, SOCK_STREAM, 0);
+    if (s_source < 0) {
+        pexit("stream socket");
+    }
+    memset(&local, 0, sizeof(local));
+    local.sin_family = AF_INET;
+//    local.sin_len = sizeof(local);
+    local.sin_port = ntohs(SOURCE_PORT);
+    local.sin_addr.s_addr = INADDR_ANY;
+    if(bind(s_source, (struct sockaddr *) &local, sizeof(local)) < 0) {
+        pexit("bind /source/ error");
+    }
+    if (setsockopt(s_source, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one))) {
+        pexit("setsockopt /source/ SO_REUSEADDR");
+    }
+    listen(s_source, SOMAXCONN);
+
+    s_sink = socket(AF_INET, SOCK_STREAM, 0);
+    if (s_sink < 0) {
+        pexit("stream socket");
+    }
+    memset(&local, 0, sizeof(local));
+    local.sin_family = AF_INET;
+//    local.sin_len = sizeof(local);
+    local.sin_port = ntohs(SINK_PORT);
+    local.sin_addr.s_addr = INADDR_ANY;
+    if(bind(s_sink, (struct sockaddr *) &local, sizeof(local)) < 0) {
+        pexit("bind /sink/ error");
+    }
+    if (setsockopt(s_sink, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one))) {
+        pexit("setsockopt /sink/ SO_REUSEADDR");
+    }
+    listen(s_sink, SOMAXCONN);
+
+    e_source = 0;  e_sink = 0;
+    while (true) {
+        // Wait for a connection on either of the ports
+        FD_ZERO(&in_fds);
+        FD_SET(s_source, &in_fds);
+        FD_SET(s_sink, &in_fds);
+        num = select(max(s_sink,s_source)+1, &in_fds, 0, 0, 0);
+        if (FD_ISSET(s_source, &in_fds)) {
+            len = sizeof(e_source_addr);
+            if ((e_source = accept(s_source, (struct sockaddr *)&e_source_addr, &len)) < 0) {
+                pexit("accept /source/");
+            }
+            diag_printf("SOURCE connection from %s:%d\n", 
+                        inet_ntoa(e_source_addr.sin_addr), ntohs(e_source_addr.sin_port));
+        }
+        if (FD_ISSET(s_sink, &in_fds)) {
+            len = sizeof(e_sink_addr);
+            if ((e_sink = accept(s_sink, (struct sockaddr *)&e_sink_addr, &len)) < 0) {
+                pexit("accept /sink/");
+            }
+            diag_printf("SINK connection from %s:%d\n", 
+                        inet_ntoa(e_sink_addr.sin_addr), ntohs(e_sink_addr.sin_port));
+        }
+        // Continue with test once a connection is established in both directions
+        if ((e_source != 0) && (e_sink != 0)) {
+            break;
+        }
+    }
+
+    // Wait for "source" to tell us the testing paramters
+    if (do_read(e_source, &nparams, sizeof(nparams)) != sizeof(nparams)) {
+        pexit("Can't read initialization parameters");
+    }
+  
+    params.nbufs = ntohl(nparams.nbufs);
+    params.bufsize = ntohl(nparams.bufsize);
+    params.load = ntohl(nparams.load);
+  
+    diag_printf("Using %d buffers of %d bytes each, %d%% background load\n", 
+                params.nbufs, params.bufsize, params.load);
+
+    // Tell the sink what the parameters are
+    if (do_write(e_sink, &nparams, sizeof(nparams)) != sizeof(nparams)) {
+        pexit("Can't write initialization parameters");
+    }
+
+    status.ok = 1;
+    nstatus.ok = htonl(status.ok);
+  
+    // Tell the "source" to start - we're all connected and ready to go!
+    if (do_write(e_source, &nstatus, sizeof(nstatus)) != sizeof(nstatus)) {
+        pexit("Can't send ACK to 'source' host");
+    }
+
+    TNR_ON();
+
+    // Echo the data from the source to the sink hosts
+    for (i = 0;  i < params.nbufs;  i++) {
+        if ((len = do_read(e_source, data_buf, params.bufsize)) != params.bufsize) {
+            TNR_OFF();
+            diag_printf("Can't read buf #%d: ", i+1);
+            if (len < 0) {
+                perror("I/O error");
+            } else {
+                diag_printf("short read - only %d bytes\n", len);
+            }
+            TNR_ON();
+        }
+        if ((len = do_write(e_sink, data_buf, params.bufsize)) != params.bufsize) {
+            TNR_OFF();
+            diag_printf("Can't write buf #%d: ", i+1);
+            if (len < 0) {
+                perror("I/O error");
+            } else {
+                diag_printf("short write - only %d bytes\n", len);
+            }
+            TNR_ON();
+        }
+    }
+
+    TNR_OFF();
+
+    // Wait for the data to drain and the "sink" to tell us all is OK.
+    if (do_read(e_sink, &status, sizeof(status)) != sizeof(status)) {
+        pexit("Can't receive ACK from 'sink' host");
+    }
+
+}
+
+
+int
+main(int argc, char *argv[])
+{
+    echo_test(argv[1]);
+    return 0;
+}
+
+
+// EOF
+
--- a/packages/net/tcpip/current/tests/make.linux
+++ b/packages/net/tcpip/current/tests/make.linux
@@ -5,7 +5,7 @@
 CC = cc
 CFLAGS = -O2 -g
 
-all: nc_test_master nc_test_slave tcp_source tcp_sink
+all: nc_test_master nc_test_slave tcp_source tcp_sink linux_echo
 
 nc_test_master: nc_test_framework.h nc_test_master.c
 	$(CC) -o $@ ${CFLAGS} nc_test_master.c
@@ -19,3 +19,6 @@ tcp_source: tcp_source.c
 tcp_sink: tcp_sink.c
 	$(CC) -o $@ ${CFLAGS} tcp_sink.c
 
+linux_echo: linux_echo.c
+	$(CC) -o $@ ${CFLAGS} linux_echo.c
+
--- a/packages/redboot/current/ChangeLog
+++ b/packages/redboot/current/ChangeLog
@@ -1,3 +1,17 @@
+2001-01-03  Gary Thomas  <gthomas@redhat.com>
+
+	* src/main.c (do_version): Update copyright for 2001.
+
+	* src/io.c (gets): Use timeout provided [was hardcoded to 50ms!]
+
+2000-12-21  Mark Salter  <msalter@redhat.com>
+
+	* src/flash.c (fis_init): Use CYGBLD_REDBOOT_FLASH_BOOT_OFFSET to
+	decide where to create default images.
+
+	* cdl/redboot.cdl (CYGBLD_REDBOOT_FLASH_BOOT_OFFSET): Use this
+	to define offset from start of FLASH to start of boot image.
+
 2000-12-15  Gary Thomas  <gthomas@redhat.com>
 
 	* src/version.c: Define GDB stubs version here as well.  Also
--- a/packages/redboot/current/cdl/redboot.cdl
+++ b/packages/redboot/current/cdl/redboot.cdl
@@ -170,6 +170,15 @@ cdl_package CYGPKG_REDBOOT {
               multiple of the FLASH erase block size."
         }
 
+        cdl_option CYGBLD_REDBOOT_FLASH_BOOT_OFFSET {
+            display       "Offset from start of FLASH to RedBoot boot image"
+            flavor        data
+            default_value 0
+            description "
+              This option controls where the RedBoot boot image is located
+              relative to the start of FLASH."
+        }
+
         cdl_option CYGSEM_REDBOOT_FLASH_CONFIG {
             display       "Keep RedBoot configuration data in FLASH"
             flavor        bool
--- a/packages/redboot/current/src/flash.c
+++ b/packages/redboot/current/src/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.                                                     
 // -------------------------------------------                              
 //                                                                          
@@ -181,7 +181,7 @@ fis_init(int argc, char *argv[])
 #endif
     bool full_init = false;
     struct option_info opts[1];
-    unsigned long redboot_image_size;
+    unsigned long redboot_image_size, redboot_flash_start;
 
     init_opts(&opts[0], 'f', false, OPTION_ARG_TYPE_FLG, 
               (void **)&full_init, (bool *)0, "full initialization, erases all of flash");
@@ -195,29 +195,57 @@ fis_init(int argc, char *argv[])
         return;
     }
     printf("*** Initialize FLASH Image System\n");
+
+    redboot_flash_start = (unsigned long)flash_start + CYGBLD_REDBOOT_FLASH_BOOT_OFFSET;
+#define MIN_REDBOOT_IMAGE_SIZE CYGBLD_REDBOOT_MIN_IMAGE_SIZE
+    redboot_image_size = block_size > MIN_REDBOOT_IMAGE_SIZE ? block_size : MIN_REDBOOT_IMAGE_SIZE;
+
     if (full_init) {
-        if ((stat = flash_erase((void *)((unsigned long)flash_start+(2*block_size)), 
-                                (blocks-4)*block_size, (void **)&err_addr)) != 0) {
-            printf("   initialization failed %p: 0x%x(%s)\n", err_addr, stat, flash_errmsg(stat));
-        }
+	// Erase everything except default RedBoot images, fis block, and config block.
+	// FIXME! This still assumes that fis and config blocks can use top of FLASH.
+	if (CYGBLD_REDBOOT_FLASH_BOOT_OFFSET == 0) {
+	    if ((stat = flash_erase((void *)((unsigned long)flash_start+(2*redboot_image_size)), 
+				    ((blocks-2)*block_size) - (2*redboot_image_size),
+				    (void **)&err_addr)) != 0) {
+		printf("   initialization failed %p: 0x%x(%s)\n",
+		       err_addr, stat, flash_errmsg(stat));
+	    }
+	} else {
+	    if ((stat = flash_erase(flash_start, CYGBLD_REDBOOT_FLASH_BOOT_OFFSET, 
+				    (void **)&err_addr)) != 0) {
+		printf("   initialization failed %p: 0x%x(%s)\n",
+		       err_addr, stat, flash_errmsg(stat));
+	    } else {
+		unsigned long erase_start, erase_size;
+
+		erase_start = redboot_flash_start+(2*redboot_image_size);
+		erase_size = (blocks-2)*block_size;
+		erase_size -= erase_start - (unsigned long)flash_start;
+
+		if (erase_size && (stat = flash_erase((void *)erase_start, erase_size,
+						      (void **)&err_addr)) != 0) {
+		    printf("   initialization failed %p: 0x%x(%s)\n",
+			   err_addr, stat, flash_errmsg(stat));
+		}
+	    }
+	}
+
     } else {
         printf("    Warning: device contents not erased, some blocks may not be usable\n");
     }
     // Create a pseudo image for RedBoot
-#define MIN_REDBOOT_IMAGE_SIZE CYGBLD_REDBOOT_MIN_IMAGE_SIZE
-    redboot_image_size = block_size > MIN_REDBOOT_IMAGE_SIZE ? block_size : MIN_REDBOOT_IMAGE_SIZE;
     img = (struct fis_image_desc *)fis_work_block;
     memset(img, 0, sizeof(*img));
     strcpy(img->name, "RedBoot");
-    img->flash_base = (unsigned long)flash_start;
-    img->mem_base = (unsigned long)flash_start;
+    img->flash_base = redboot_flash_start;
+    img->mem_base = redboot_flash_start;
     img->size = redboot_image_size;
     img++;  img_count++;
     // And a backup image
     memset(img, 0, sizeof(*img));
     strcpy(img->name, "RedBoot[backup]");
-    img->flash_base = (unsigned long)flash_start+redboot_image_size;
-    img->mem_base = (unsigned long)flash_start+redboot_image_size;
+    img->flash_base = redboot_flash_start+redboot_image_size;
+    img->mem_base = redboot_flash_start+redboot_image_size;
     img->size = redboot_image_size;
     img++;  img_count++;
 #ifdef CYGSEM_REDBOOT_FLASH_CONFIG
@@ -557,7 +585,7 @@ fis_erase(int argc, char *argv[])
     }
     // Safety check - make sure the address range is not within the code we're running
     if (flash_code_overlaps((void *)flash_addr, (void *)(flash_addr+length-1))) {
-        printf("Can't program this region - contains code in use!\n");
+        printf("Can't erase this region - contains code in use!\n");
         return;
     }
     if ((stat = flash_erase((void *)flash_addr, length, (void **)&err_addr)) != 0) {
--- a/packages/redboot/current/src/io.c
+++ b/packages/redboot/current/src/io.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.                                                     
 // -------------------------------------------                              
 //                                                                          
@@ -181,7 +181,7 @@ gets(char *buf, int buflen, int timeout)
         } else
 #endif
         if ((timeout > 0) && (ptr == buf)) {
-            mon_set_read_char_timeout(50);
+            mon_set_read_char_timeout(timeout);
             while (timeout > 0) {
                 res = mon_read_char_with_timeout(&c);
                 if (res) {
--- a/packages/redboot/current/src/main.c
+++ b/packages/redboot/current/src/main.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.                                                     
 // -------------------------------------------                              
 //                                                                          
@@ -117,7 +117,7 @@ do_version(int argc, char *argv[])
 #ifdef HAL_PLATFORM_CPU
     printf("Platform: %s (%s) %s\n", HAL_PLATFORM_BOARD, HAL_PLATFORM_CPU, HAL_PLATFORM_EXTRA);
 #endif
-    printf("Copyright (C) 2000, Red Hat, Inc.\n\n");
+    printf("Copyright (C) 2000, 2001, Red Hat, Inc.\n\n");
     printf("RAM: %p-%p\n", (void*)ram_start, (void*)ram_end);
 }