This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
PowerPC - lots of platform improvements
- From: Gary Thomas <gary at mlbassoc dot com>
- To: eCos patches <ecos-patches at sources dot redhat dot com>
- Date: 20 Jan 2003 04:16:35 -0700
- Subject: PowerPC - lots of platform improvements
Some to get some older platforms to build again [Thanks, Bart]
Some are just improvements. All are pretty minor.
Index: devs/eth/powerpc/csb281/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/eth/powerpc/csb281/current/ChangeLog,v
retrieving revision 1.2
diff -u -5 -p -r1.2 ChangeLog
--- devs/eth/powerpc/csb281/current/ChangeLog 4 Jan 2003 03:31:43 -0000 1.2
+++ devs/eth/powerpc/csb281/current/ChangeLog 20 Jan 2003 11:04:16 -0000
@@ -1,5 +1,9 @@
+2003-01-20 Gary Thomas <gary@mlbassoc.com>
+
+ * include/devs_eth_csb281.inl: Add RedBoot management of ESA.
+
2003-01-03 Gary Thomas <gary@mlbassoc.com>
* include/devs_eth_csb281.inl: PCI window is now in specially
mapped, uncacheable space.
Index: devs/eth/powerpc/csb281/current/include/devs_eth_csb281.inl
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/eth/powerpc/csb281/current/include/devs_eth_csb281.inl,v
retrieving revision 1.2
diff -u -5 -p -r1.2 devs_eth_csb281.inl
--- devs/eth/powerpc/csb281/current/include/devs_eth_csb281.inl 4 Jan 2003 03:31:43 -0000 1.2
+++ devs/eth/powerpc/csb281/current/include/devs_eth_csb281.inl 10 Jan 2003 22:25:32 -0000
@@ -111,6 +111,51 @@ i82559_sc_array[CYGNUM_DEVS_ETH_INTEL_I8
&i82559_sc0,
#endif
};
#endif // CYGDBG_USE_ASSERTS
+// --------------------------------------------------------------
+// RedBoot configuration options for managing ESAs for us
+
+// tell the driver there is no EEPROM on this board
+#define CYGHWR_DEVS_ETH_INTEL_I82559_HAS_NO_EEPROM
+
+// Decide whether to have redboot config vars for it...
+#ifdef CYGPKG_REDBOOT
+#include <pkgconf/redboot.h>
+#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#ifdef CYGPKG_REDBOOT_NETWORKING
+#include <redboot.h>
+#include <flash_config.h>
+
+#ifdef CYGVAR_DEVS_ETH_I82559_ETH_REDBOOT_HOLDS_ESA_ETH0
+RedBoot_config_option("Network hardware address [MAC] for eth0",
+ eth0_esa,
+ ALWAYS_ENABLED, true,
+ CONFIG_ESA, 0
+ );
+#endif
+
+#endif
+#endif
+#endif
+
+// and initialization code to read them
+// - independent of whether we are building RedBoot right now:
+#ifdef CYGPKG_DEVS_ETH_I82559_ETH_REDBOOT_HOLDS_ESA
+
+#include <cyg/hal/hal_if.h>
+
+#ifndef CONFIG_ESA
+#define CONFIG_ESA (6)
+#endif
+
+#define CYGHWR_DEVS_ETH_INTEL_I82559_GET_ESA( p_i82559, mac_address, ok ) \
+CYG_MACRO_START \
+ ok = false; \
+ ok = CYGACC_CALL_IF_FLASH_CFG_OP( CYGNUM_CALL_IF_FLASH_CFG_GET, \
+ "eth0_esa", mac_address, CONFIG_ESA); \
+CYG_MACRO_END
+
+#endif // CYGPKG_DEVS_ETH_I82559_ETH_REDBOOT_HOLDS_ESA
+
// EOF devs_eth_csb281.inl
Index: devs/eth/powerpc/fec/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/eth/powerpc/fec/current/ChangeLog,v
retrieving revision 1.14
diff -u -5 -p -r1.14 ChangeLog
--- devs/eth/powerpc/fec/current/ChangeLog 14 Nov 2002 23:33:36 -0000 1.14
+++ devs/eth/powerpc/fec/current/ChangeLog 20 Jan 2003 11:04:54 -0000
@@ -1,5 +1,9 @@
+2003-01-20 Gary Thomas <gary@mlbassoc.com>
+
+ * cdl/fec_eth_drivers.cdl: Increase number of allowed buffers.
+
2002-11-14 Gary Thomas <gthomas@ecoscentric.com>
* cdl/fec_eth_drivers.cdl: Increase default number of buffers (to a
more reasonable amount).
Index: devs/eth/powerpc/fec/current/cdl/fec_eth_drivers.cdl
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/eth/powerpc/fec/current/cdl/fec_eth_drivers.cdl,v
retrieving revision 1.6
diff -u -5 -p -r1.6 fec_eth_drivers.cdl
--- devs/eth/powerpc/fec/current/cdl/fec_eth_drivers.cdl 14 Nov 2002 23:33:37 -0000 1.6
+++ devs/eth/powerpc/fec/current/cdl/fec_eth_drivers.cdl 20 Jan 2003 11:04:57 -0000
@@ -7,11 +7,11 @@
# ====================================================================
#####ECOSGPLCOPYRIGHTBEGIN####
## -------------------------------------------
## This file is part of eCos, the Embedded Configurable Operating System.
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
-## Copyright (C) 2002 Gary Thomas
+## Copyright (C) 2002, 2003 Gary Thomas
##
## eCos is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation; either version 2 or (at your option) any later version.
##
@@ -86,21 +86,21 @@ cdl_package CYGPKG_DEVS_ETH_POWERPC_FEC
}
cdl_option CYGNUM_DEVS_ETH_POWERPC_FEC_TxNUM {
display "Number of output buffers"
flavor data
- legal_values 2 to 16
+ legal_values 2 to 64
default_value 16
description "
This option specifies the number of output buffer packets
to be used for the PowerPC FEC/ethernet device."
}
cdl_option CYGNUM_DEVS_ETH_POWERPC_FEC_RxNUM {
display "Number of input buffers"
flavor data
- legal_values 2 to 16
+ legal_values 2 to 64
default_value 16
description "
This option specifies the number of input buffer packets
to be used for the PowerPC FEC/ethernet device."
}
Index: hal/powerpc/csb281/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/powerpc/csb281/current/ChangeLog,v
retrieving revision 1.2
diff -u -5 -p -r1.2 ChangeLog
--- hal/powerpc/csb281/current/ChangeLog 4 Jan 2003 03:38:40 -0000 1.2
+++ hal/powerpc/csb281/current/ChangeLog 20 Jan 2003 11:06:47 -0000
@@ -1,5 +1,14 @@
+2003-01-20 Gary Thomas <gary@mlbassoc.com>
+
+ * misc/redboot_ROMRAM.ecm:
+ * misc/redboot_ROM.ecm:
+ * misc/redboot_RAM.ecm: New config - with ESA in RedBoot/fconfig.
+
+ * cdl/hal_powerpc_csb281.cdl: Deprecate "tests" since there are none
+ at the moment, but leave the code as comments in case they return.
+
2003-01-03 Gary Thomas <gary@mlbassoc.com>
* src/hal_diag.c (cyg_hal_plf_serial_error): New function - fixed
some random [timing?] problems with getc().
Index: hal/powerpc/csb281/current/cdl/hal_powerpc_csb281.cdl
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/powerpc/csb281/current/cdl/hal_powerpc_csb281.cdl,v
retrieving revision 1.1
diff -u -5 -p -r1.1 hal_powerpc_csb281.cdl
--- hal/powerpc/csb281/current/cdl/hal_powerpc_csb281.cdl 24 Dec 2002 16:00:49 -0000 1.1
+++ hal/powerpc/csb281/current/cdl/hal_powerpc_csb281.cdl 20 Jan 2003 11:06:09 -0000
@@ -7,11 +7,11 @@
# ====================================================================
#####ECOSGPLCOPYRIGHTBEGIN####
## -------------------------------------------
## This file is part of eCos, the Embedded Configurable Operating System.
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
-## Copyright (C) 2002 Gary Thomas
+## Copyright (C) 2002, 2003 Gary Thomas
##
## eCos is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation; either version 2 or (at your option) any later version.
##
@@ -295,18 +295,18 @@ cdl_package CYGPKG_HAL_POWERPC_CSB281 {
This option modifies the set of compiler flags for
building the CSB281 HAL. These flags are removed from
the set of global flags if present."
}
- cdl_option CYGPKG_HAL_POWERPC_CSB281_TESTS {
- display "CSB281 tests"
- flavor data
- no_define
- calculated { "tests/csb281time" }
- description "
- This option specifies the set of tests for the CSB281 HAL."
- }
+## cdl_option CYGPKG_HAL_POWERPC_CSB281_TESTS {
+## display "CSB281 tests"
+## flavor data
+## no_define
+## calculated { "tests/csb281time" }
+## description "
+## This option specifies the set of tests for the CSB281 HAL."
+## }
}
cdl_component CYGHWR_MEMORY_LAYOUT {
display "Memory layout"
flavor data
Index: hal/powerpc/csb281/current/misc/redboot_RAM.ecm
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/powerpc/csb281/current/misc/redboot_RAM.ecm,v
retrieving revision 1.2
diff -u -5 -p -r1.2 redboot_RAM.ecm
--- hal/powerpc/csb281/current/misc/redboot_RAM.ecm 4 Jan 2003 03:38:40 -0000 1.2
+++ hal/powerpc/csb281/current/misc/redboot_RAM.ecm 10 Jan 2003 22:40:18 -0000
@@ -32,14 +32,10 @@ cdl_configuration eCos {
cdl_option CYGFUN_LIBC_STRING_BSD_FUNCS {
inferred_value 0
};
-cdl_component CYGSEM_DEVS_ETH_CSB281_ETH0_SET_ESA {
- user_value 1
-};
-
cdl_option CYGDBG_DEVS_ETH_INTEL_I82559_CHATTER {
user_value 0 0
};
cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE {
Index: hal/powerpc/csb281/current/misc/redboot_ROM.ecm
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/powerpc/csb281/current/misc/redboot_ROM.ecm,v
retrieving revision 1.2
diff -u -5 -p -r1.2 redboot_ROM.ecm
--- hal/powerpc/csb281/current/misc/redboot_ROM.ecm 4 Jan 2003 03:38:40 -0000 1.2
+++ hal/powerpc/csb281/current/misc/redboot_ROM.ecm 10 Jan 2003 22:40:38 -0000
@@ -32,14 +32,10 @@ cdl_configuration eCos {
cdl_option CYGFUN_LIBC_STRING_BSD_FUNCS {
inferred_value 0
};
-cdl_component CYGSEM_DEVS_ETH_CSB281_ETH0_SET_ESA {
- user_value 1
-};
-
cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE {
user_value 4096
};
cdl_option CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT {
Index: hal/powerpc/csb281/current/misc/redboot_ROMRAM.ecm
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/powerpc/csb281/current/misc/redboot_ROMRAM.ecm,v
retrieving revision 1.1
diff -u -5 -p -r1.1 redboot_ROMRAM.ecm
--- hal/powerpc/csb281/current/misc/redboot_ROMRAM.ecm 4 Jan 2003 03:38:40 -0000 1.1
+++ hal/powerpc/csb281/current/misc/redboot_ROMRAM.ecm 10 Jan 2003 22:40:38 -0000
@@ -32,14 +32,10 @@ cdl_configuration eCos {
cdl_option CYGFUN_LIBC_STRING_BSD_FUNCS {
inferred_value 0
};
-cdl_component CYGSEM_DEVS_ETH_CSB281_ETH0_SET_ESA {
- user_value 1
-};
-
cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE {
user_value 4096
};
cdl_option CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT {
Index: hal/powerpc/mpc8xx/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/powerpc/mpc8xx/current/ChangeLog,v
retrieving revision 1.22
diff -u -5 -p -r1.22 ChangeLog
--- hal/powerpc/mpc8xx/current/ChangeLog 19 Jan 2003 12:05:10 -0000 1.22
+++ hal/powerpc/mpc8xx/current/ChangeLog 20 Jan 2003 11:07:48 -0000
@@ -1,5 +1,10 @@
+2003-01-20 Gary Thomas <gary@mlbassoc.com>
+
+ * src/variant.S: Be careful about using QUICC functions unless that
+ package is present (some MPC8xx platforms don't use it).
+
2003-01-18 Bart Veer <bartv@ecoscentric.com>
* src/variant.S: _mpc8xx_reset caused build failures with current
tools.
Index: hal/powerpc/mpc8xx/current/src/variant.S
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/powerpc/mpc8xx/current/src/variant.S,v
retrieving revision 1.6
diff -u -5 -p -r1.6 variant.S
--- hal/powerpc/mpc8xx/current/src/variant.S 19 Jan 2003 12:05:13 -0000 1.6
+++ hal/powerpc/mpc8xx/current/src/variant.S 20 Jan 2003 11:07:49 -0000
@@ -8,11 +8,11 @@
#####ECOSGPLCOPYRIGHTBEGIN####
## -------------------------------------------
## This file is part of eCos, the Embedded Configurable Operating System.
## Copyright (C) 2003 Bart Veer
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
-## Copyright (C) 2002 Gary Thomas
+## Copyright (C) 2002, 2003 Gary Thomas
##
## eCos is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free
## Software Foundation; either version 2 or (at your option) any later version.
##
@@ -53,11 +53,14 @@
##=============================================================================
#include <cyg/hal/arch.inc>
#include <cyg/hal/ppc_regs.h> /* on-chip resource layout, special */
/* registers, IMM layout... */
+
+#ifdef CYGPKG_HAL_QUICC
#include <cyg/hal/quicc/ppc8xx.h> /* more of the same */
+#endif
#---------------------------------------------------------------------------
# Interrupt vector tables.
# These tables contain the isr, data and object pointers used to deliver
# interrupts to user code.
@@ -91,11 +94,12 @@ hal_interrupt_objects:
# Hard reset support
#
.text
.globl _mpc8xx_reset
-_mpc8xx_reset:
+_mpc8xx_reset:
+#ifdef CYGPKG_HAL_QUICC
lwi r4,CYGARC_REG_IMM_BASE # base address of control registers
// Enable checkstop reset
lwz r3,PLPRCR(r4)
ori r3,r3,0x0080 // Bit 24
@@ -110,10 +114,13 @@ _mpc8xx_reset:
stw r0,BR0(r4)
stw r0,BR1(r4)
lwi r3,_end
10: nop
lwzu r3,4(r2) // Force a memory access
- b 10b
-
+ b 10b
+#else
+10: nop
+ b 10b
+#endif
##-----------------------------------------------------------------------------
## end of variant.S
Index: hal/powerpc/sim/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/powerpc/sim/current/ChangeLog,v
retrieving revision 1.17
diff -u -5 -p -r1.17 ChangeLog
--- hal/powerpc/sim/current/ChangeLog 23 May 2002 23:04:33 -0000 1.17
+++ hal/powerpc/sim/current/ChangeLog 20 Jan 2003 11:09:01 -0000
@@ -1,5 +1,11 @@
+2003-01-20 Gary Thomas <gary@mlbassoc.com>
+
+ * include/plf_regs.h:
+ * include/plf_intr.h:
+ * include/platform.inc: New file(s) - empty, but used by latest HAL.
+
2002-04-11 Gary Thomas <gthomas@redhat.com>
* include/plf_cache.h: Cache control is in hal/common CDL.
2000-10-20 Jonathan Larmour <jlarmour@redhat.com>
Index: hal/powerpc/sim/current/include/platform.inc
===================================================================
RCS file: hal/powerpc/sim/current/include/platform.inc
diff -N hal/powerpc/sim/current/include/platform.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ hal/powerpc/sim/current/include/platform.inc 20 Jan 2003 10:58:10 -0000
@@ -0,0 +1,62 @@
+#ifndef CYGONCE_HAL_PLATFORM_INC
+#define CYGONCE_HAL_PLATFORM_INC
+##=============================================================================
+##
+## platform.inc
+##
+## Platform specific assembler header file
+##
+##=============================================================================
+#####ECOSGPLCOPYRIGHTBEGIN####
+## -------------------------------------------
+## This file is part of eCos, the Embedded Configurable Operating System.
+## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+## Copyright (C) 2002, 2003 Gary Thomas
+##
+## eCos is free software; you can redistribute it and/or modify it under
+## the terms of the GNU General Public License as published by the Free
+## Software Foundation; either version 2 or (at your option) any later version.
+##
+## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+## WARRANTY; without even the implied warranty of MERCHANTABILITY or
+## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+## for more details.
+##
+## You should have received a copy of the GNU General Public License along
+## with eCos; if not, write to the Free Software Foundation, Inc.,
+## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+##
+## As a special exception, if other files instantiate templates or use macros
+## or inline functions from this file, or you compile this file and link it
+## with other works to produce a work based on this file, this file does not
+## by itself cause the resulting work to be covered by the GNU General Public
+## License. However the source code for this file must still be made available
+## in accordance with section (3) of the GNU General Public License.
+##
+## This exception does not invalidate any other reasons why a work based on
+## this file might be covered by the GNU General Public License.
+##
+## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
+## at http://sources.redhat.com/ecos/ecos-license/
+## -------------------------------------------
+#####ECOSGPLCOPYRIGHTEND####
+##=============================================================================
+#######DESCRIPTIONBEGIN####
+##
+## Author(s): gthomas
+## Contributors:
+## Date: 2002-07-31
+## Purpose: Platform specific assembly code
+## Description: This file contains various definitions and macros that are
+## useful for writing assembly code for the platform.
+## Usage: included from <cyg/hal/variant.inc>
+##
+##
+######DESCRIPTIONEND####
+##
+##=============================================================================
+##-----------------------------------------------------------------------------
+
+#------------------------------------------------------------------------------
+#endif // ifndef CYGONCE_HAL_PLATFORM_INC
+# end of platform.inc
Index: hal/powerpc/sim/current/include/plf_intr.h
===================================================================
RCS file: hal/powerpc/sim/current/include/plf_intr.h
diff -N hal/powerpc/sim/current/include/plf_intr.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ hal/powerpc/sim/current/include/plf_intr.h 20 Jan 2003 11:08:47 -0000
@@ -0,0 +1,63 @@
+#ifndef CYGONCE_HAL_PLF_INTR_H
+#define CYGONCE_HAL_PLF_INTR_H
+
+//==========================================================================
+//
+// plf_intr.h
+//
+// Platform specific interrupt definitions
+//
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2002, 2003 Gary Thomas
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+//
+// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s): jskov
+// Contributors: jskov, gthomas
+// Date: 2000-06-13
+// Purpose: Define platform specific interrupt support
+//
+// Usage:
+// #include <cyg/hal/plf_intr.h>
+// ...
+//
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+//--------------------------------------------------------------------------
+#endif // ifndef CYGONCE_HAL_PLF_INTR_H
+// End of plf_intr.h
Index: hal/powerpc/sim/current/include/plf_regs.h
===================================================================
RCS file: hal/powerpc/sim/current/include/plf_regs.h
diff -N hal/powerpc/sim/current/include/plf_regs.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ hal/powerpc/sim/current/include/plf_regs.h 20 Jan 2003 11:09:01 -0000
@@ -0,0 +1,60 @@
+#ifndef CYGONCE_HAL_PLF_REGS_H
+#define CYGONCE_HAL_PLF_REGS_H
+
+//==========================================================================
+//
+// plf_regs.h
+//
+// PowerPC 8xx platform CPU definitions
+//
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2002, 2003 Gary Thomas
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+//
+// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s): gthomas
+// Contributors: gthomas
+// Date: 2002-06-27
+// Purpose:
+// Description: Possibly override any platform assumptions
+//
+// Usage: Included via the variant+architecture register headers:
+// ...
+//
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#endif // CYGONCE_HAL_PLF_REGS_H
Index: net/common/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos-opt/net/net/common/current/ChangeLog,v
retrieving revision 1.17
diff -u -5 -p -r1.17 ChangeLog
--- net/common/current/ChangeLog 18 Jan 2003 04:19:25 -0000 1.17
+++ net/common/current/ChangeLog 20 Jan 2003 11:10:19 -0000
@@ -1,5 +1,11 @@
+2003-01-20 Gary Thomas <gary@mlbassoc.com>
+
+ * tests/nc_test_slave.c: Improve handling of UDP buffer space - try
+ to minimize amount of "idle" time when this occurs. Since this test
+ is just for show, these changes just make the numbers "look" better.
+
2003-01-18 Jonathan Larmour <jifl@eCosCentric.com>
* src/network_support.c (init_all_network_interfaces): Define buf
as const.
Index: net/common/current/tests/nc_test_slave.c
===================================================================
RCS file: /misc/cvsfiles/ecos-opt/net/net/common/current/tests/nc_test_slave.c,v
retrieving revision 1.1
diff -u -5 -p -r1.1 nc_test_slave.c
--- net/common/current/tests/nc_test_slave.c 20 May 2002 22:25:05 -0000 1.1
+++ net/common/current/tests/nc_test_slave.c 10 Jan 2003 12:07:57 -0000
@@ -208,29 +208,40 @@ do_udp_test(int s1, struct nc_request *r
ntohl(tdp->seq));
}
}
}
if (need_send) {
+ int retries = 10;
+ bool sent = false;
+ int res;
+
tdp = (struct nc_test_data *)out_buf;
tdp->key1 = htonl(NC_TEST_DATA_KEY1);
tdp->key2 = htonl(NC_TEST_DATA_KEY2);
tdp->seq = htonl(seq);
td_len = ntohl(req->buflen) + sizeof(struct nc_test_data);
tdp->len = htonl(td_len);
- if (sendto(s, tdp, td_len, 0,
- (struct sockaddr *)&test_chan_master, sizeof(test_chan_master)) < 0) {
- perror("sendto");
+ while (!sent && (--retries >= 0)) {
+ res = sendto(s, tdp, td_len, 0,
+ (struct sockaddr *)&test_chan_master, sizeof(test_chan_master));
+ if (res > 0) {
+ sent = true;
+ break;
+ }
if (errno == ENOBUFS) {
// Saturated the system
- test_delay(10); // Time for 200 500 byte 10-baseT packets
+ test_delay(1); // Time for 200 500 byte 10-baseT packets
} else {
// What else to do?
close(s);
return;
}
- } else {
+ }
+ if (sent) {
nsent++;
+ } else {
+ perror("sendto");
}
}
seq++;
}
results.key1 = htonl(NC_TEST_RESULT_KEY1);
@@ -238,11 +249,11 @@ do_udp_test(int s1, struct nc_request *r
results.seq = req->seq;
results.nsent = htonl(nsent);
results.nrecvd = htonl(nrecvd);
if (sendto(s, &results, sizeof(results), 0,
(struct sockaddr *)&test_chan_master, sizeof(test_chan_master)) < 0) {
- perror("sendto");
+ perror("sendto results");
}
close(s);
}
//
--
------------------------------------------------------------
Gary Thomas |
MLB Associates | Consulting for the
+1 (970) 229-1963 | Embedded world
http://www.mlbassoc.com/ |
email: <gary@mlbassoc.com> |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------