Mercurial > ecos
changeset 197:51b34619b677
Merge from eCos master repository on 2001-11-30-11:22:06-GMT
line wrap: on
line diff
--- a/packages/devs/eth/cl/cs8900a/current/ChangeLog +++ b/packages/devs/eth/cl/cs8900a/current/ChangeLog @@ -1,3 +1,8 @@ +2001-11-29 Jesper Skov <jskov@redhat.com> + + * src/if_cs8900a.c (cs8900a_init): Changed order of ESA source + checking so user can always override at RedBoot runtime. + 2001-11-20 Jesper Skov <jskov@redhat.com> * src/if_cs8900a.c: Added some more debug output. Set all 4 LAF
--- a/packages/devs/eth/cl/cs8900a/current/src/if_cs8900a.c +++ b/packages/devs/eth/cl/cs8900a/current/src/if_cs8900a.c @@ -161,6 +161,7 @@ cs8900a_init(struct cyg_netdevtab_entry cyg_uint16 chip_type, chip_rev, chip_status; int i; long timeout = 500000; + cyg_bool esa_configured = false; cpd->tab = tab; @@ -229,33 +230,40 @@ cs8900a_init(struct cyg_netdevtab_entry // Disable reception whilst finding the ESA put_reg(base, PP_LineCTL, 0 ); - // Find ESA - if (!cpd->hardwired_esa) { - cyg_bool esa_configured = false; - if (NULL != cpd->provide_esa) { - esa_configured = cpd->provide_esa(cpd); + // Find ESA - check possible sources in sequence and stop when + // one provides the ESA: + // RedBoot option (via provide_esa) + // Compile-time configuration + // EEPROM + // <fail configuration of device> + if (NULL != cpd->provide_esa) { + esa_configured = cpd->provide_esa(cpd); # if DEBUG & 8 - if (esa_configured) - diag_printf("Got ESA from RedBoot option\n"); + if (esa_configured) + diag_printf("Got ESA from RedBoot option\n"); # endif + } + if (!esa_configured && cpd->hardwired_esa) { + // ESA is already set in cpd->esa[] + esa_configured = true; + } + if (!esa_configured && (chip_status & PP_SelfStat_EEPROM)) { + // Get ESA from EEPROM - via the PP_IA registers + cyg_uint16 esa_word; + for (i = 0; i < sizeof(cpd->esa); i += 2) { + esa_word = get_reg(base, PP_IA+i); + cpd->esa[i] = (esa_word & 0xFF); + cpd->esa[i+1] = (esa_word >> 8) & 0xFF; } - if (!esa_configured && (chip_status & PP_SelfStat_EEPROM)) { - // Get ESA from EEPROM - via the PP_IA registers - cyg_uint16 esa_word; - for (i = 0; i < sizeof(cpd->esa); i += 2) { - esa_word = get_reg(base, PP_IA+i); - cpd->esa[i] = (esa_word & 0xFF); - cpd->esa[i+1] = (esa_word >> 8) & 0xFF; - } - esa_configured = true; - } - if (!esa_configured) { + esa_configured = true; + } + if (!esa_configured) { # if DEBUG & 8 - diag_printf("CS8900 - no EEPROM, static ESA or RedBoot config option.\n"); + diag_printf("CS8900 - no EEPROM, static ESA or RedBoot config option.\n"); # endif - return false; - } + return false; } + // Tell the chip what ESA to use for (i = 0; i < sizeof(cpd->esa); i += 2) { put_reg(base, PP_IA+i, cpd->esa[i] | (cpd->esa[i+1] << 8));
--- a/packages/error/current/ChangeLog +++ b/packages/error/current/ChangeLog @@ -1,3 +1,9 @@ +2001-11-29 Jonathan Larmour <jlarmour@redhat.com> + + * include/errno.h: Don't use 'const' type qualifier any more. It + gives warnings in new compilers now. + * src/errno.cxx (cyg_error_get_errno_p): Ditto. + 2000-06-19 Nick Garnett <nickg@cygnus.co.uk> * include/errno.h (errno): Added extern modifier to non-per-thread
--- a/packages/error/current/include/errno.h +++ b/packages/error/current/include/errno.h @@ -64,7 +64,7 @@ extern "C" { #ifdef CYGSEM_ERROR_PER_THREAD_ERRNO -extern Cyg_ErrNo * const +extern Cyg_ErrNo * cyg_error_get_errno_p( void ) __attribute__((const)); #endif /* ifdef CYGSEM_ERROR_PER_THREAD_ERRNO */
--- a/packages/error/current/src/errno.cxx +++ b/packages/error/current/src/errno.cxx @@ -82,7 +82,7 @@ static int errno_trace = CYGNUM_ERROR_ER // FUNCTIONS -Cyg_ErrNo * const +Cyg_ErrNo * cyg_error_get_errno_p( void ) { Cyg_ErrNo *errno_p;
--- a/packages/hal/common/current/ChangeLog +++ b/packages/hal/common/current/ChangeLog @@ -1,3 +1,15 @@ +2001-11-29 Hugo Tyson <hmt@redhat.com> + + * src/hal_stub.c: Enable HAL_STUB_HW_SEND_STOP_REASON_TEXT for + XScale architectures per Mark's request; XScale GDB needs to know + what's happening with watchpoints (= work around previous change) + +2001-11-29 Hugo Tyson <hmt@redhat.com> + + * src/hal_stub.c: Condition out sending the reason for hardware + watchpoint stop in the stop packet as $T05watch:01234568;... most + GDBs do not understand it and in fact object to it. + 2001-11-23 Nick Garnett <nickg@redhat.com> * src/generic-stub.c (__process_packet): Fixed bogosity in
--- a/packages/hal/common/current/src/hal_stub.c +++ b/packages/hal/common/current/src/hal_stub.c @@ -93,7 +93,15 @@ target_register_t orig_registers[HAL_STU #if defined(HAL_STUB_HW_WATCHPOINT) || defined(HAL_STUB_HW_BREAKPOINT) static int _hw_stop_reason; // Reason we were stopped by hw. +//#define HAL_STUB_HW_SEND_STOP_REASON_TEXT +#ifdef CYGINT_HAL_ARM_ARCH_XSCALE +#define HAL_STUB_HW_SEND_STOP_REASON_TEXT +#endif + +#ifdef HAL_STUB_HW_SEND_STOP_REASON_TEXT // strings indexed by hw stop reasons defined in hal_stub.h + +// Not all GDBs understand this. static const char * const _hw_stop_str[] = { "", "hbreak", @@ -101,9 +109,10 @@ static const char * const _hw_stop_str[] "rwatch", "awatch" }; +#endif // HAL_STUB_HW_SEND_STOP_REASON_TEXT static void *_watch_data_addr; // The data address if stopped by watchpoint -#endif +#endif // defined(HAL_STUB_HW_WATCHPOINT) || defined(HAL_STUB_HW_BREAKPOINT) // Register validity checking #ifdef CYGHWR_REGISTER_VALIDITY_CHECKING @@ -586,8 +595,11 @@ void case HAL_STUB_HW_STOP_WATCH: case HAL_STUB_HW_STOP_RWATCH: case HAL_STUB_HW_STOP_AWATCH: +#ifdef HAL_STUB_HW_SEND_STOP_REASON_TEXT + // Not all GDBs understand this. strcpy(ptr, _hw_stop_str[_hw_stop_reason]); ptr += strlen(_hw_stop_str[_hw_stop_reason]); +#endif *ptr++ = ':'; // Send address MSB first ptr += __intToHex(ptr, (target_register_t)_watch_data_addr,
--- a/packages/hal/i386/pcmb/current/ChangeLog +++ b/packages/hal/i386/pcmb/current/ChangeLog @@ -1,3 +1,14 @@ +2001-11-29 Jonathan Larmour <jlarmour@redhat.com> + + * src/pcmb_screen.c: Restore sensible num lock behaviour after the + last change. + (KBScanTable): Fix scan table size. + +2001-11-29 Trenton D. Adams <tadams@theone.dnsalias.com> + + * src/pcmb_screen.c: Support numeric keypad and ctrl-alt-del for + rebooting. + 2001-11-23 Nick Garnett <nickg@redhat.com> * include/pcmb_io.h (PC_WRITE_SCREEN): Wrap positions beyond end
--- a/packages/hal/i386/pcmb/current/src/pcmb_screen.c +++ b/packages/hal/i386/pcmb/current/src/pcmb_screen.c @@ -245,7 +245,7 @@ void DisplayChar #define LSHIFT 0x2a #define RSHIFT 0x36 #define CTRL 0x1d -#define ALT 0x38 +#define ALT 0x38 #define CAPS 0x3a #define NUMS 0x45 @@ -340,7 +340,7 @@ static CYG_BYTE KBScanTable[128][4] = { '.', '>', 0xFF, 0xFF, }, { '/', '?', 0xFF, 0xFF, }, { 0xFF, 0xFF, 0xFF, 0xFF, }, -{ 0xFF, 0xFF, 0xFF, 0xFF, }, +{ '*', 0xFF, 0xFF, 0xFF, }, { 0xFF, 0xFF, 0xFF, 0xFF, }, { ' ', ' ', ' ', ' ', }, { 0xFF, 0xFF, 0xFF, 0xFF, }, @@ -357,21 +357,21 @@ static CYG_BYTE KBScanTable[128][4] = { 0xFF, 0xFF, 0xFF, 0xFF, }, { 0xFF, 0xFF, 0xFF, 0xFF, }, { 0xFF, 0xFF, 0xFF, 0xFF, }, -{ 0xFF, 0xFF, 0xFF, 0xFF, }, +{ '7', 0xFF, 0xFF, 0xFF, }, -{ 0x15, 0x15, 0x15, 0x15, }, -{ 0x10, 0x10, 0x10, 0x10, }, -{ 0xFF, 0xFF, 0xFF, 0xFF, }, -{ 0xFF, 0xFF, 0xFF, 0xFF, }, -{ 0xFF, 0xFF, 0xFF, 0xFF, }, -{ 0xFF, 0xFF, 0xFF, 0xFF, }, -{ 0xFF, 0xFF, 0xFF, 0xFF, }, -{ 0xFF, 0xFF, 0xFF, 0xFF, }, +{ '8', 0x15, 0x15, 0x15, }, +{ '9', 0x10, 0x10, 0x10, }, +{ '-', 0xFF, 0xFF, 0xFF, }, +{ '4', 0xFF, 0xFF, 0xFF, }, +{ '5', 0xFF, 0xFF, 0xFF, }, +{ '6', 0xFF, 0xFF, 0xFF, }, +{ '+', 0xFF, 0xFF, 0xFF, }, +{ '1', 0xFF, 0xFF, 0xFF, }, // 0x50 -{ 0x04, 0x04, 0x04, 0x04, }, -{ 0x0e, 0x0e, 0x0e, 0x0e, }, -{ 0xFF, 0xFF, 0xFF, 0xFF, }, -{ 0xFF, 0xFF, 0xFF, 0xFF, }, +{ '2', 0x04, 0x04, 0x04, }, +{ '3', 0x0e, 0x0e, 0x0e, }, +{ '0', 0xFF, 0xFF, 0xFF, }, +{ '.', 0xFF, 0xFF, 0xFF, }, { 0xFF, 0xFF, 0xFF, 0xFF, }, { 0xFF, 0xFF, 0xFF, 0xFF, }, { 0xFF, 0xFF, 0xFF, 0xFF, }, @@ -447,6 +447,13 @@ static CYG_BYTE KeyboardAscii switch( scancode ) { + case 0x53: // delete + if (KBFlags & KBCtrl && KBFlags & KBAlt) + { + CYGACC_CALL_IF_RESET(); + } + break; + case 0xe0: KBFlags |= KBExtend; return 0xFF; @@ -521,7 +528,6 @@ static CYG_BYTE KeyboardAscii KBFlags ^= KBNumLock; case NUMS | BREAK: return 0xFF; - } // Clear Extend flag if set
--- a/packages/hal/v85x/arch/current/ChangeLog +++ b/packages/hal/v85x/arch/current/ChangeLog @@ -1,3 +1,7 @@ +2001-11-26 Jesper Skov <jskov@redhat.com> + + * src/hal_misc.c (hal_msbit_index): Fixed. + 2001-04-24 Jonathan Larmour <jlarmour@redhat.com> * src/vectors.S: Support daft platforms like the CEB which have
--- a/packages/hal/v85x/arch/current/src/hal_misc.c +++ b/packages/hal/v85x/arch/current/src/hal_misc.c @@ -196,7 +196,7 @@ cyg_uint32 hal_msbit_index(cyg_uint32 mask) { int i; - for (i = 32; i >= 0; i++) { + for (i = 31; i >= 0; i--) { if (mask & (1<<i)) return ((cyg_uint32)i); } return ((cyg_uint32)-1);
--- a/packages/io/eth/current/ChangeLog +++ b/packages/io/eth/current/ChangeLog @@ -1,3 +1,7 @@ +2001-11-28 Jonathan Larmour <jlarmour@redhat.com> + + * doc/driver_doc: Mention preferences on how the ESA should be set. + 2001-10-30 Jonathan Larmour <jlarmour@redhat.com> * doc/driver_doc: Add description of poll, deliver and int_vector
--- a/packages/io/eth/current/doc/driver_doc +++ b/packages/io/eth/current/doc/driver_doc @@ -132,6 +132,13 @@ unit. Note: the ethernet station addres world-unique, 48 bit address for this particular ethernet interface. Typically it is provided by the board/hardware manufacturer in ROM. +In many packages it is possible for the ESA to be set from RedBoot, +(perhaps from 'fconfig' data), hard-coded from CDL, or from an EPROM. +A driver should choose a run-time specified ESA (e.g. from RedBoot) +preferentially, otherwise (in order) it should use a CDL specified +ESA if one has been set, otherwise an EPROM set ESA, or otherwise +fail. See the cl/cs8900a eth driver for an example. + static void HRDWR_start(struct eth_drv_sc *sc, unsigned char *enaddr, int flags) ====================================================================
--- a/packages/io/fileio/current/ChangeLog +++ b/packages/io/fileio/current/ChangeLog @@ -1,3 +1,7 @@ +2001-11-29 Jonathan Larmour <jlarmour@redhat.com> + + * src/file.cxx (chdir): Don't detach from current dir if unset. + 2001-11-02 Felix Wong <felixwong@i-technologies.cc> 2001-11-02 Jonathan Larmour <jlarmour@redhat.com>
--- a/packages/io/fileio/current/src/file.cxx +++ b/packages/io/fileio/current/src/file.cxx @@ -433,7 +433,7 @@ static Cyg_Mutex getcwd_lock CYGBLD_ATTR update_cwd( mte, dir, name ); #endif - if( cdir_mtab_entry != NULL ) + if( cdir_mtab_entry != NULL && cdir_dir != CYG_DIR_NULL ) { // Now detach from current cdir. We call the current directory's // chdir routine with a NULL dir_out pointer.
--- a/packages/kernel/current/ChangeLog +++ b/packages/kernel/current/ChangeLog @@ -1,3 +1,14 @@ +2001-11-29 Jonathan Larmour <jlarmour@redhat.com> + + * src/sched/mlqueue.cxx (timeslice_cpu): Reset timeslice_count on + a timeslice. + Noticed by Tony Kho. + +2001-11-23 Jonathan Larmour <jlarmour@redhat.com> + + * tests/klock.c (entry1): Support running with + CYGFUN_KERNEL_THREADS_TIMER disabled. + 2001-10-30 Nick Garnett <nickg@redhat.com> * tests/kcache2.c (test_dsync):
--- a/packages/kernel/current/src/sched/mlqueue.cxx +++ b/packages/kernel/current/src/sched/mlqueue.cxx @@ -551,7 +551,7 @@ Cyg_Scheduler_Implementation::timeslice_ if( queue->get_head() != thread ) sched->set_need_reschedule(); -// timeslice_count[cpu_this] = CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS; + timeslice_count[cpu_this] = CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS; } }
--- a/packages/kernel/current/tests/klock.c +++ b/packages/kernel/current/tests/klock.c @@ -203,8 +203,12 @@ static void entry1( cyg_addrword_t data while( thread0_state < 6 ) cyg_thread_yield(); thread1_state = 6; +#ifdef CYGFUN_KERNEL_THREADS_TIMER res = cyg_semaphore_timed_wait( &sem, cyg_current_time()+10 ); - CYG_TEST_CHECK( res , "FALSE result from cyg_semaphore_timed_wait()" ); +#else + res = cyg_semaphore_wait( &sem ); +#endif + CYG_TEST_CHECK( res , "FALSE result from cyg_semaphore[_timed]_wait()" ); thread1_state = 7; // -------------------------------------------------- @@ -213,8 +217,12 @@ static void entry1( cyg_addrword_t data cyg_flag_setbits( &fl, 1 ); thread1_state = 8; +#ifdef CYGFUN_KERNEL_THREADS_TIMER cyg_flag_timed_wait( &fl, 2, CYG_FLAG_WAITMODE_OR|CYG_FLAG_WAITMODE_CLR, cyg_current_time()+10 ); +#else + cyg_flag_wait( &fl, 2, CYG_FLAG_WAITMODE_OR|CYG_FLAG_WAITMODE_CLR ); +#endif thread1_state = 9; // -------------------------------------------------- @@ -222,11 +230,19 @@ static void entry1( cyg_addrword_t data #ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT { void *mbret; +#ifdef CYGFUN_KERNEL_THREADS_TIMER cyg_mbox_timed_put( mbh, (void *)0xAAAAAAAA, cyg_current_time()+10 ); +#else + cyg_mbox_put( mbh, (void *)0xAAAAAAAA ); +#endif thread1_state = 10; +#ifdef CYGFUN_KERNEL_THREADS_TIMER mbret = cyg_mbox_timed_get( mbh, cyg_current_time()+10); - CYG_TEST_CHECK( mbret == (void *)0xBBBBBBBB , "bad result from cyg_mbox_timed_get()"); +#else + mbret = cyg_mbox_get( mbh ); +#endif + CYG_TEST_CHECK( mbret == (void *)0xBBBBBBBB , "bad result from cyg_mbox[_timed]_get()"); thread1_state = 9; } #endif
--- a/packages/language/c/libc/string/current/ChangeLog +++ b/packages/language/c/libc/string/current/ChangeLog @@ -1,3 +1,10 @@ +2001-11-27 Jonathan Larmour <jlarmour@redhat.com> + + * cdl/string.cdl (CYGFUN_LIBC_STRING_BSD_FUNCS): New option to indicate + provision of BSD-ish string functions. + * include/bsdstring.h: New header to export BSD string func prototypes. + * src/bsdstring.cxx: New file. + 2001-08-21 Jonathan Larmour <jlarmour@redhat.com> * cdl/string.cdl (CYGSEM_LIBC_STRING_PER_THREAD_STRTOK): Improve
--- a/packages/language/c/libc/string/current/cdl/string.cdl +++ b/packages/language/c/libc/string/current/cdl/string.cdl @@ -94,6 +94,22 @@ cdl_package CYGPKG_LIBC_STRING { same effect can be produced if the code is compiled with the -Os option to the compiler." } + + cdl_option CYGFUN_LIBC_STRING_BSD_FUNCS { + display "Provide BSD compatibility functions" + flavor bool + default_value 1 + implements CYGINT_ISO_STRING_BSD_FUNCS + requires { CYGBLD_ISO_STRING_BSD_FUNCS_HEADER == \ + "<cyg/libc/string/bsdstring.h>" } + requires CYGINT_ISO_CTYPE + compile bsdstring.cxx + description " + Enabling this option causes various compatibility functions + commonly found in the BSD UNIX operating system to be included. + These are functions such as bzero, bcmp, bcopy, bzero, strcasecmp, + strncasecmp, index, rindex and swab." + } cdl_component CYGPKG_LIBC_STRING_STRTOK { display "strtok"
new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/string/current/include/bsdstring.h @@ -0,0 +1,100 @@ +#ifndef CYGONCE_LIBC_BSDSTRING_H +#define CYGONCE_LIBC_BSDSTRING_H +/*=========================================================================== +// +// bsdstring.h +// +// BSD standard string and memory area manipulation routines +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: +// Date: 2001-11-27 +// Purpose: This file provides various string functions normally +// provided in the BSD UNIX operating system. +// Description: +// Usage: Do not include this file directly - use #include <string.h> +// +//####DESCRIPTIONEND#### +// +//=========================================================================*/ + +/* CONFIGURATION */ + +#include <pkgconf/libc_string.h> /* Configuration header */ + +#ifdef CYGFUN_LIBC_STRING_BSD_FUNCS + +#define __need_size_t +#include <stddef.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/*=========================================================================*/ + +/* FUNCTION PROTOTYPES */ + + +extern int +strcasecmp( const char * /* s1 */, const char * /* s2 */ ); + +extern int +strncasecmp( const char * /* s1 */, const char * /* s2 */, size_t /* n */ ); + +extern int +bcmp( const void * /* s1 */, const void * /* s2 */, size_t /* n */ ); + +extern void +bcopy( const void * /* src */, void * /* dest */, size_t /* n */ ); + +extern void +bzero( void * /* s */, size_t /* n */ ); + +extern char * +index( const char * /* s */, int /* c */ ); + +extern char * +rindex( const char * /* s */, int /* c */ ); + +extern void +swab( const void * /* from */, void * /* to */, size_t /* n */ ); + +/*=========================================================================*/ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* ifdef CYGFUN_LIBC_STRING_BSD_FUNCS */ + +#endif /* CYGONCE_LIBC_BSDSTRING_H multiple inclusion protection */ + +/* EOF bsdstring.h */
new file mode 100644 --- /dev/null +++ b/packages/language/c/libc/string/current/src/bsdstring.cxx @@ -0,0 +1,226 @@ +//=========================================================================== +// +// bsdstring.cxx +// +// BSD string routines +// +//=========================================================================== +//####COPYRIGHTBEGIN#### +// +// ------------------------------------------- +// The contents of this file are subject to the Red Hat eCos Public License +// Version 1.1 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://www.redhat.com/ +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations under +// the License. +// +// The Original Code is eCos - Embedded Configurable Operating System, +// released September 30, 1998. +// +// The Initial Developer of the Original Code is Red Hat. +// Portions created by Red Hat are +// Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc. +// All Rights Reserved. +// ------------------------------------------- +// +//####COPYRIGHTEND#### +//=========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): jlarmour +// Contributors: +// Date: 2001-11-27 +// Purpose: Provide string functions derived from BSD +// Description: +// Usage: #include <string.h> +// +//####DESCRIPTIONEND#### +// +//=========================================================================== + +// CONFIGURATION + +#include <pkgconf/libc_string.h> // Configuration header + +// INCLUDES + +#include <cyg/infra/cyg_type.h> // Common type definitions +#include <cyg/infra/cyg_trac.h> // Tracing support +#include <cyg/infra/cyg_ass.h> // Assertion support +#include <string.h> // Header for this file +#include <stddef.h> // size_t, NULL etc. +#include <ctype.h> // toupper/tolower + +// FUNCTIONS + +/*---------------------------------------------------------------------*/ +/* strcasecmp */ + +__externC int +__strcasecmp( const char *s1, const char *s2 ) +{ + CYG_REPORT_FUNCNAMETYPE( "strcasecmp", "returning %d" ); + CYG_REPORT_FUNCARG2( "s1=%08x, s2=%08x", s1, s2 ); + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + + while (*s1 != '\0' && tolower(*s1) == tolower(*s2)) + { + s1++; + s2++; + } + + int ret = tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2); + CYG_REPORT_RETVAL( ret ); + return ret; +} + +__externC int +strcasecmp( const char *s1, const char *s2 ) \ + CYGBLD_ATTRIB_WEAK_ALIAS(__strcasecmp); + + +/*---------------------------------------------------------------------*/ +/* strncasecmp */ + +__externC int +__strncasecmp( const char *s1, const char *s2, size_t n ) +{ + CYG_REPORT_FUNCNAMETYPE( "strncasecmp", "returning %d" ); + CYG_REPORT_FUNCARG3( "s1=%08x, s2=%08x, n=%d", s1, s2, n ); + + if (n == 0) + { + CYG_REPORT_RETVAL(0); + return 0; + } + + CYG_CHECK_DATA_PTR( s1, "s1 is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( s2, "s2 is not a valid pointer!" ); + + while (n-- != 0 && tolower(*s1) == tolower(*s2)) + { + if (n == 0 || *s1 == '\0' || *s2 == '\0') + break; + s1++; + s2++; + } + + int ret = tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2); + CYG_REPORT_RETVAL( ret ); + return ret; +} + +__externC int +strncasecmp( const char *s1, const char *s2, size_t n ) \ + CYGBLD_ATTRIB_WEAK_ALIAS(__strncasecmp); + +/*---------------------------------------------------------------------*/ +/* bcmp */ + +__externC int +__bcmp( const void *s1, const void *s2, size_t n ) +{ + // Don't bother tracing - memcmp can do that + return memcmp (s1, s2, n); +} + +__externC int +bcmp( const void *s1, const void *s2, size_t n ) \ + CYGBLD_ATTRIB_WEAK_ALIAS(__bcmp); + +/*---------------------------------------------------------------------*/ +/* bcopy */ + +__externC void +__bcopy( const void *src, void *dest, size_t n ) +{ + // Don't bother tracing - memmove can do that + memmove (dest, src, n); +} + +__externC void +bcopy( const void *src, void *dest, size_t n ) \ + CYGBLD_ATTRIB_WEAK_ALIAS(__bcopy); + +/*---------------------------------------------------------------------*/ +/* bzero */ + +__externC void +__bzero( void *s, size_t n ) +{ + // Don't bother tracing - memset can do that + memset( s, 0, n ); +} + +__externC void +bzero( void *s, size_t n ) CYGBLD_ATTRIB_WEAK_ALIAS(__bzero); + +/*---------------------------------------------------------------------*/ +/* index */ + +__externC char * +__index( const char *s, int c ) +{ + // Don't bother tracing - strchr can do that + return strchr(s, c); +} + +__externC char * +index( const char *s, int c ) CYGBLD_ATTRIB_WEAK_ALIAS(__index); + +/*---------------------------------------------------------------------*/ +/* rindex */ + +__externC char * +__rindex( const char *s, int c ) +{ + // Don't bother tracing - strrchr can do that + return strrchr(s, c); +} + +__externC char * +rindex( const char *s, int c ) CYGBLD_ATTRIB_WEAK_ALIAS(__rindex); + +/*---------------------------------------------------------------------*/ +/* swab */ + +__externC void +__swab( const void *from, void *to, size_t n ) +{ + const char *f = (const char *)from; + char *t = (char *)to; + size_t ptr; + + CYG_REPORT_FUNCNAME( "swab" ); + CYG_REPORT_FUNCARG3( "from=%08x, to=%08x, n=%d", from, to, n ); + + if (n) { + CYG_CHECK_DATA_PTR( from, "from is not a valid pointer!" ); + CYG_CHECK_DATA_PTR( to, "to is not a valid pointer!" ); + } + + for (ptr = 1; ptr < n; ptr += 2) + { + char p = f[ptr]; + char q = f[ptr-1]; + t[ptr-1] = p; + t[ptr ] = q; + } + if (ptr == n) /* I.e., if n is odd, */ + t[ptr-1] = '\0'; /* then pad with a NUL. */ + + CYG_REPORT_RETURN(); +} + +__externC void +swab( const void *from, void *to, size_t n ) \ + CYGBLD_ATTRIB_WEAK_ALIAS(__swab); + +/*---------------------------------------------------------------------*/ +// EOF bsdstring.cxx
--- a/packages/net/tcpip/current/ChangeLog +++ b/packages/net/tcpip/current/ChangeLog @@ -1,3 +1,10 @@ +2001-11-29 Jonathan Larmour <jlarmour@redhat.com> + + * include/machine/ansi.h: No longer require BSD string function + compatibility macros (in fact they confuse things). + + * cdl/net.cdl: Require BSD compatibility functions from <string.h>. + 2001-11-19 Hugo Tyson <hmt@redhat.com> * include/bootp.h (BP_STD_TX_MINPKTSZ): New symbol defining the
--- a/packages/net/tcpip/current/cdl/net.cdl +++ b/packages/net/tcpip/current/cdl/net.cdl @@ -51,6 +51,7 @@ cdl_package CYGPKG_NET { requires CYGINT_ISO_ERRNO requires CYGINT_ISO_ERRNO_CODES requires CYGINT_ISO_MALLOC + requires CYGINT_ISO_STRING_BSD_FUNCS description "Basic networking support, including TCP/IP." cdl_interface CYGPKG_NET_DRIVER_FRAMEWORK {
--- a/packages/net/tcpip/current/include/machine/ansi.h +++ b/packages/net/tcpip/current/include/machine/ansi.h @@ -58,11 +58,7 @@ // Mappings of BSD-style functions used in networking code to those provided // by the eCos environment. -externC void net_memcpy(void *d, void *s, int n); -externC void net_memset(void *s, int v, int n); - -#define bcopy(s,d,n) net_memcpy(d,s,n) -#define bzero(s,n) net_memset(s,0,n) +// Nothing to do here any more. #endif // _MACHINE_ANSI_H_
--- a/packages/redboot/current/ChangeLog +++ b/packages/redboot/current/ChangeLog @@ -1,3 +1,25 @@ +2001-11-29 Jonathan Larmour <jlarmour@redhat.com> + + * src/net/dns.c: Rename index -> ptdindex to avoid conflict with BSD + index() function. + +2001-11-29 Jesper Skov <jskov@redhat.com> + + * src/net/tftp_client.c (tftp_stream_open): Clear from_addr's + sin_port so multiple loads are possible. + +2001-11-26 Jesper Skov <jskov@redhat.com> + + * misc/redboot_XXX.ecm: Added. Replaced the _RAM, _ROM, and + _ROMRAM variants. + + * misc/redboot_ROM.ecm: Added configuration with all packages + relevant for a full RedBoot configuration. Whenever new (optional) + RedBoot peer packages are added, they should be added to these + files and not the RedBoot template. + * misc/redboot_ROMRAM.ecm: Same. + * misc/redboot_RAM.ecm: Same. + 2001-11-15 Jesper Skov <jskov@redhat.com> * include/redboot.h: Added load_address and load_address_end
new file mode 100644 --- /dev/null +++ b/packages/redboot/current/misc/redboot_XXX.ecm @@ -0,0 +1,15 @@ +cdl_savefile_version 1; +cdl_savefile_command cdl_savefile_version {}; +cdl_savefile_command cdl_savefile_command {}; +cdl_savefile_command cdl_configuration { description hardware template package }; +cdl_savefile_command cdl_package { value_source user_value wizard_value inferred_value }; +cdl_savefile_command cdl_component { value_source user_value wizard_value inferred_value }; +cdl_savefile_command cdl_option { value_source user_value wizard_value inferred_value }; +cdl_savefile_command cdl_interface { value_source user_value wizard_value inferred_value }; + +cdl_configuration eCos { + package -template CYGPKG_COMPRESS_ZLIB current ; + package -template CYGPKG_IO_FLASH current; + package -template CYGPKG_IO_ETH_DRIVERS current; +}; +
--- a/packages/redboot/current/src/net/tftp_client.c +++ b/packages/redboot/current/src/net/tftp_client.c @@ -245,6 +245,7 @@ tftp_stream_open(char *filename, tftp_stream.actual_len = -1; tftp_stream.last_good_block = 0; tftp_stream.total_timeouts = 0; + tftp_stream.from_addr.sin_port = 0; // Try and read the first byte [block] since no errors are // reported until then.
--- a/packages/templates/all/ChangeLog +++ b/packages/templates/all/ChangeLog @@ -1,3 +1,7 @@ +2001-11-27 Jonathan Larmour <jlarmour@redhat.com> + + current.ect: Provide default for CYGBLD_ISO_STRING_BSD_FUNCS_HEADER + 2001-10-01 Jonathan Larmour <jlarmour@redhat.com> * current.ect: Add net related packages.
--- a/packages/templates/all/current.ect +++ b/packages/templates/all/current.ect @@ -180,3 +180,7 @@ cdl_option CYGBLD_ISO_PMUTEXTYPES_HEADER inferred_value 1 <cyg/posix/muttypes.h> }; + +cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER { + inferred_value 1 <cyg/libc/string/bsdstring.h> +};
--- a/packages/templates/cygmon/ChangeLog +++ b/packages/templates/cygmon/ChangeLog @@ -1,3 +1,7 @@ +2001-11-27 Jonathan Larmour <jlarmour@redhat.com> + + current.ect: Provide default for CYGBLD_ISO_STRING_BSD_FUNCS_HEADER + 2000-07-24 Jonathan Larmour <jlarmour@redhat.co.uk> * current.ect: Fix up after libc package reorg and memalloc package
--- a/packages/templates/cygmon/current.ect +++ b/packages/templates/cygmon/current.ect @@ -88,3 +88,7 @@ cdl_option CYGBLD_ISO_STRING_STRFUNCS_HE cdl_option CYGBLD_ISO_SETJMP_HEADER { user_value 1 <cyg/libc/setjmp/setjmp.h> }; + +cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER { + inferred_value 1 <cyg/libc/string/bsdstring.h> +};
--- a/packages/templates/cygmon_no_kernel/ChangeLog +++ b/packages/templates/cygmon_no_kernel/ChangeLog @@ -1,3 +1,7 @@ +2001-11-27 Jonathan Larmour <jlarmour@redhat.com> + + current.ect: Provide default for CYGBLD_ISO_STRING_BSD_FUNCS_HEADER + 2000-08-14 Drew Moseley <dmoseley@redhat.com> * current.ect: Modified to bring closer to cygmon/current.ect.
--- a/packages/templates/cygmon_no_kernel/current.ect +++ b/packages/templates/cygmon_no_kernel/current.ect @@ -83,3 +83,7 @@ cdl_option CYGBLD_ISO_STRING_STRFUNCS_HE cdl_option CYGBLD_ISO_SETJMP_HEADER { user_value 1 <cyg/libc/setjmp/setjmp.h> }; + +cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER { + inferred_value 1 <cyg/libc/string/bsdstring.h> +};
--- a/packages/templates/default/ChangeLog +++ b/packages/templates/default/ChangeLog @@ -1,3 +1,7 @@ +2001-11-27 Jonathan Larmour <jlarmour@redhat.com> + + current.ect: Provide default for CYGBLD_ISO_STRING_BSD_FUNCS_HEADER + 2000-11-03 Jonathan Larmour <jlarmour@redhat.com> * current.ect: Update inferred values for stdio streams header
--- a/packages/templates/default/current.ect +++ b/packages/templates/default/current.ect @@ -123,3 +123,7 @@ cdl_option CYGBLD_ISO_SETJMP_HEADER { cdl_option CYGBLD_ISO_STDIO_STREAMS_HEADER { inferred_value 1 <cyg/libc/stdio/stdio.h> }; + +cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER { + inferred_value 1 <cyg/libc/string/bsdstring.h> +};
--- a/packages/templates/elix/ChangeLog +++ b/packages/templates/elix/ChangeLog @@ -1,3 +1,7 @@ +2001-11-27 Jonathan Larmour <jlarmour@redhat.com> + + current.ect: Provide default for CYGBLD_ISO_STRING_BSD_FUNCS_HEADER + 2001-08-21 Jonathan Larmour <jlarmour@redhat.com> * current.ect: Pre-infer CYGBLD_ISO_PMUTEXTYPES_HEADER.
--- a/packages/templates/elix/current.ect +++ b/packages/templates/elix/current.ect @@ -189,3 +189,7 @@ cdl_option CYGBLD_ISO_OPEN_MAX_HEADER { cdl_option CYGBLD_ISO_PMUTEXTYPES_HEADER { inferred_value 1 <cyg/posix/muttypes.h> }; + +cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER { + inferred_value 1 <cyg/libc/string/bsdstring.h> +};
--- a/packages/templates/net/ChangeLog +++ b/packages/templates/net/ChangeLog @@ -1,3 +1,7 @@ +2001-11-27 Jonathan Larmour <jlarmour@redhat.com> + + current.ect: Provide default for CYGBLD_ISO_STRING_BSD_FUNCS_HEADER + 2001-09-27 Jonathan Larmour <jlarmour@redhat.com> * current.ect: Don't include uitron. Not appropriate for base net
--- a/packages/templates/net/current.ect +++ b/packages/templates/net/current.ect @@ -189,3 +189,7 @@ cdl_option CYGBLD_ISO_OPEN_MAX_HEADER { cdl_option CYGBLD_ISO_PMUTEXTYPES_HEADER { inferred_value 1 <cyg/posix/muttypes.h> }; + +cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER { + inferred_value 1 <cyg/libc/string/bsdstring.h> +};
--- a/packages/templates/posix/ChangeLog +++ b/packages/templates/posix/ChangeLog @@ -1,3 +1,7 @@ +2001-11-27 Jonathan Larmour <jlarmour@redhat.com> + + current.ect: Provide default for CYGBLD_ISO_STRING_BSD_FUNCS_HEADER + 2001-08-21 Jonathan Larmour <jlarmour@redhat.com> * current.ect: Pre-infer CYGBLD_ISO_PMUTEXTYPES_HEADER.
--- a/packages/templates/posix/current.ect +++ b/packages/templates/posix/current.ect @@ -123,3 +123,7 @@ cdl_option CYGBLD_ISO_OPEN_MAX_HEADER { cdl_option CYGBLD_ISO_PMUTEXTYPES_HEADER { inferred_value 1 <cyg/posix/muttypes.h> }; + +cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER { + inferred_value 1 <cyg/libc/string/bsdstring.h> +};
--- a/packages/templates/redboot/ChangeLog +++ b/packages/templates/redboot/ChangeLog @@ -1,3 +1,14 @@ +2001-11-27 Jonathan Larmour <jlarmour@redhat.com> + + current.ect: Provide default for CYGBLD_ISO_STRING_BSD_FUNCS_HEADER + +2001-11-26 Jesper Skov <jskov@redhat.com> + + * current.ect: Added ZLIB package. + And removed again. Instead added + redboot/current/misc/redboot_XXX.ecm files with maximal + configurations. + 2001-09-12 Gary Thomas <gthomas@redhat.com> * current.ect: Large stack no longer necessary as 'fconfig' data
--- a/packages/templates/redboot/current.ect +++ b/packages/templates/redboot/current.ect @@ -45,3 +45,7 @@ cdl_option CYGNUM_HAL_COMMON_INTERRUPTS_ user_value 4096 }; + +cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER { + inferred_value 1 <cyg/libc/string/bsdstring.h> +};
--- a/packages/templates/uitron/ChangeLog +++ b/packages/templates/uitron/ChangeLog @@ -1,3 +1,7 @@ +2001-11-27 Jonathan Larmour <jlarmour@redhat.com> + + current.ect: Provide default for CYGBLD_ISO_STRING_BSD_FUNCS_HEADER + 2000-11-03 Jonathan Larmour <jlarmour@redhat.com> * current.ect: Add inferred values for CDL that confuses the
