Mercurial > ecos-v3_0-branch
changeset 119:77cec8369160 ecos-sw-2000-09-01
Merge from eCos master repository on 2000-09-01-07:47:03-BST
line wrap: on
line diff
--- a/packages/ChangeLog +++ b/packages/ChangeLog @@ -1,3 +1,7 @@ +2000-08-29 Jonathan Larmour <jlarmour@redhat.co.uk> + + * ecos.db: Include CYGPKG_IO_PCI in vrc4373 target + 2000-08-24 Gary Thomas <gthomas@redhat.com> * ecos.db: Add FLASH driver for Intel Assabet.
--- a/packages/devs/eth/cf/current/ChangeLog +++ b/packages/devs/eth/cf/current/ChangeLog @@ -1,3 +1,13 @@ +2000-08-29 Gary Thomas <gthomas@redhat.com> + + * src/if_sc_lpe.c (sc_lpe_recv): Better handling if upper layer + had no buffers [this routine called anyway]. + +2000-08-28 Gary Thomas <gthomas@redhat.com> + + * src/if_sc_lpe.c: Better handling of "hot" cards (i.e. one + initialized by a debug environment). + 2000-08-23 Gary Thomas <gthomas@redhat.com> * src/if_sc_lpe.c: Add new function to return interrupt vector
--- a/packages/devs/eth/cf/current/src/if_sc_lpe.c +++ b/packages/devs/eth/cf/current/src/if_sc_lpe.c @@ -154,7 +154,9 @@ sc_lpe_card_handler(cyg_addrword_t param cyg_drv_dsr_unlock(); // Give DSRs a chance to run (card insertion) cyg_drv_dsr_lock(); if (slot->state == CF_SLOT_STATE_Inserted) { - cf_change_state(slot, CF_SLOT_STATE_Ready); + if (slot->state != CF_SLOT_STATE_Ready) { + cf_change_state(slot, CF_SLOT_STATE_Ready); + } if (slot->state != CF_SLOT_STATE_Ready) { diag_printf("CF card won't go ready!\n"); continue; @@ -512,10 +514,12 @@ sc_lpe_recv(struct eth_drv_sc *sc, struc regs->w.page0.cr = DP8390_CR_RDMA | DP8390_CR_START; for (i = 0; i < sg_len; i++) { data = (unsigned char *)sg_list[i].buf; - mlen = sg_list[i].len; - while (mlen >= sizeof(*data)) { - *data++ = regs->r.page0.data; - mlen -= sizeof(*data); + if (data) { + mlen = sg_list[i].len; + while (mlen >= sizeof(*data)) { + *data++ = regs->r.page0.data; + mlen -= sizeof(*data); + } } } } @@ -573,7 +577,7 @@ sc_lpe_int(struct eth_drv_sc *sc) regs->w.page0.cr = DP8390_CR_NODMA | DP8390_CR_PAGE0 | DP8390_CR_START; while ((isr = regs->r.page0.isr) != 0) { regs->w.page0.isr = isr; // Clear set bits - if (!dp->running) return; // Is this necessary? + if (!dp->running) break; // Is this necessary? if (isr & (DP8390_ISR_TxP|DP8390_ISR_TxE)) { sc_lpe_TxEvent(sc, isr); }
--- a/packages/devs/flash/arm/assabet/current/ChangeLog +++ b/packages/devs/flash/arm/assabet/current/ChangeLog @@ -1,3 +1,7 @@ +2000-08-29 Gary Thomas <gthomas@redhat.com> + + * src/assabet_flash.c: Improve error decoding. + 2000-08-24 Gary Thomas <gthomas@redhat.com> * src/flash_query.c:
--- a/packages/devs/flash/arm/ebsa285/current/ChangeLog +++ b/packages/devs/flash/arm/ebsa285/current/ChangeLog @@ -1,3 +1,7 @@ +2000-08-29 Gary Thomas <gthomas@redhat.com> + + * src/ebsa285_flash.c: Improve error decoding. + 2000-08-22 Hugo Tyson <hmt@cygnus.co.uk> * src/ebsa285_flash.c (flash_hwr_init): Add
--- a/packages/devs/flash/arm/ebsa285/current/src/ebsa285_flash.c +++ b/packages/devs/flash/arm/ebsa285/current/src/ebsa285_flash.c @@ -90,7 +90,13 @@ int flash_hwr_map_error(int err) { if (err & 0x7E) { - return FLASH_ERR_ERASE; // FIXME + if (err & 0x10) { + return FLASH_ERR_PROGRAM; + } else + if (err & 0x20) { + return FLASH_ERR_ERASE; + } else + return FLASH_ERR_HWR; // FIXME } else { return FLASH_ERR_OK; }
--- a/packages/devs/flash/arm/edb7xxx/current/ChangeLog +++ b/packages/devs/flash/arm/edb7xxx/current/ChangeLog @@ -1,3 +1,7 @@ +2000-08-29 Gary Thomas <gthomas@redhat.com> + + * src/edb7xxx_flash.c: Improve error decoding. + 2000-08-15 Gary Thomas <gthomas@redhat.com> * src/edb7xxx_flash.c (flash_code_overlaps):
--- a/packages/devs/flash/arm/edb7xxx/current/src/edb7xxx_flash.c +++ b/packages/devs/flash/arm/edb7xxx/current/src/edb7xxx_flash.c @@ -121,7 +121,7 @@ flash_hwr_map_error(int err) if (err & 0x00200020) { return FLASH_ERR_ERASE; } else - return FLASH_ERR_ERASE; // FIXME + return FLASH_ERR_HWR; // FIXME } else { return FLASH_ERR_OK; }
--- a/packages/devs/pcmcia/arm/assabet/current/ChangeLog +++ b/packages/devs/pcmcia/arm/assabet/current/ChangeLog @@ -1,3 +1,10 @@ +2000-08-28 Gary Thomas <gthomas@redhat.com> + + * src/assabet_pcmcia.c (cf_irq_dsr): Support [shared] network + debug situation where "IF" functions need to see device interrupts. + This is used to detect ^C over the connection. This also requires + additional care when setting up the bus initially. + 2000-08-24 Gary Thomas <gthomas@redhat.com> * src/assabet_pcmcia.c: Add hardware function to clear interrupts.
--- a/packages/devs/pcmcia/arm/assabet/current/src/assabet_pcmcia.c +++ b/packages/devs/pcmcia/arm/assabet/current/src/assabet_pcmcia.c @@ -103,8 +103,16 @@ static void cf_irq_dsr(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) { struct cf_slot *slot = (struct cf_slot *)data; +#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) + cyg_bool was_ctrlc_int; +#endif + // Clear interrupt [edge indication] cyg_drv_interrupt_acknowledge(SA1110_CF_IRQ); +#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) + was_ctrlc_int = HAL_CTRLC_CHECK(vector, data); + if (!was_ctrlc_int) // Fall through and run normal code +#endif // Process interrupt (slot->irq_handler.handler)(slot->irq_handler.param); // Allow interrupts to happen again @@ -143,10 +151,10 @@ cf_hwr_init(struct cf_slot *slot) &cf_irq_interrupt_handle, &cf_irq_interrupt); cyg_drv_interrupt_attach(cf_irq_interrupt_handle); - cyg_drv_interrupt_acknowledge(SA1110_CF_IRQ); cyg_drv_interrupt_unmask(SA1110_CF_IRQ); #endif cyg_drv_interrupt_configure(SA1110_CF_IRQ, false, false); // Falling edge + cyg_drv_interrupt_acknowledge(SA1110_CF_IRQ); } slot->attr = (unsigned char *)0x38000000; slot->attr_length = 0x200; @@ -155,6 +163,7 @@ cf_hwr_init(struct cf_slot *slot) slot->mem = (unsigned char *)0x3C000000; slot->mem_length = 0x04000000; slot->int_num = SA1110_CF_IRQ; +#ifdef CYG_HAL_STARTUP_ROM // Disable CF bus & power (idle/off) assabet_BCR(SA1110_BCR_CF_POWER | SA1110_BCR_CF_RESET | @@ -162,8 +171,14 @@ cf_hwr_init(struct cf_slot *slot) SA1110_BCR_CF_POWER_OFF | SA1110_BCR_CF_RESET_DISABLE | SA1110_BCR_CF_BUS_OFF); +#endif if ((new_state & SA1110_GPIO_CF_DETECT) == SA1110_GPIO_CF_PRESENT) { - slot->state = CF_SLOT_STATE_Inserted; + if ((_assabet_BCR & SA1110_BCR_CF_POWER) == SA1110_BCR_CF_POWER_ON) { + // Assume that the ROM environment has turned the bus on + slot->state = CF_SLOT_STATE_Ready; + } else { + slot->state = CF_SLOT_STATE_Inserted; + } } else { slot->state = CF_SLOT_STATE_Empty; }
--- a/packages/ecos.db +++ b/packages/ecos.db @@ -1375,6 +1375,7 @@ target vrc4373 { CYGPKG_HAL_MIPS_VR4300 CYGPKG_HAL_MIPS_VR4300_VRC4373 CYGPKG_IO_SERIAL_MIPS_VRC4373 + CYGPKG_IO_PCI } description " The vrc4373 target provides the packages needed to run
--- a/packages/hal/arm/sa11x0/assabet/current/ChangeLog +++ b/packages/hal/arm/sa11x0/assabet/current/ChangeLog @@ -1,3 +1,13 @@ +2000-08-28 Gary Thomas <gthomas@redhat.com> + + * cdl/hal_arm_sa11x0_assabet.cdl: Define default console [even + though there is no real choice]. This is required to support + network debug connections. + +2000-08-25 Jonathan Larmour <jlarmour@redhat.co.uk> + + * misc/cf_test.c: Delete. Not needed any more. + 2000-08-24 Gary Thomas <gthomas@redhat.com> * include/pkgconf/mlt_arm_sa11x0_assabet_ram.mlt:
--- a/packages/hal/arm/sa11x0/assabet/current/cdl/hal_arm_sa11x0_assabet.cdl +++ b/packages/hal/arm/sa11x0/assabet/current/cdl/hal_arm_sa11x0_assabet.cdl @@ -127,6 +127,13 @@ cdl_package CYGPKG_HAL_ARM_SA11X0_ASSABE The assabet board has only one serial port. This option chooses which port will be used for diagnostic output." } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT { + display "Default console channel." + flavor data + legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 + calculated 0 + } cdl_component CYGBLD_GLOBAL_OPTIONS { display "Global build options"
--- a/packages/hal/common/current/ChangeLog +++ b/packages/hal/common/current/ChangeLog @@ -1,3 +1,12 @@ +2000-08-28 Gary Thomas <gthomas@redhat.com> + + * src/hal_if.c: + * include/hal_if.h (hal_ctrlc_check): Define new routine to be + called by interrupt handlers (DSRs) which may be using hardware + shared with a debug channel. In particular, network adaptors + need to call this function to see if a ^C has occurred on the + network debug connection. + 2000-08-24 Gary Thomas <gthomas@redhat.com> * include/hal_tables.h: Need descriminated tables (for proper sorting).
--- a/packages/hal/common/current/include/hal_if.h +++ b/packages/hal/common/current/include/hal_if.h @@ -381,8 +381,10 @@ externC void hal_if_diag_read_char(char //-------------------------------------------------------------------------- // Ctrl-c support. externC cyg_uint32 hal_ctrlc_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data); +externC cyg_bool hal_ctrlc_check(CYG_ADDRWORD vector, CYG_ADDRWORD data); #define HAL_CTRLC_ISR hal_ctrlc_isr +#define HAL_CTRLC_CHECK hal_ctrlc_check #endif // CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT
--- a/packages/hal/common/current/src/hal_if.c +++ b/packages/hal/common/current/src/hal_if.c @@ -419,6 +419,27 @@ hal_ctrlc_isr(CYG_ADDRWORD vector, CYG_A cyg_hal_user_break( (CYG_ADDRWORD *)hal_saved_interrupt_state ); return isr_ret; } + +cyg_bool +hal_ctrlc_check(CYG_ADDRWORD vector, CYG_ADDRWORD data) +{ + hal_virtual_comm_table_t* chan = CYGACC_CALL_IF_DEBUG_PROCS(); + int gdb_vector = -1; + int isr_ret, ctrlc = 0; + + // This check only to avoid crash on older stubs in case of unhandled + // interrupts. It is a bit messy, but required in a transition period. + if (CYGNUM_CALL_IF_TABLE_VERSION+1 == CYGACC_CALL_IF_VERSION()) { + gdb_vector = CYGACC_COMM_IF_CONTROL(*chan, __COMMCTL_DBG_ISR_VECTOR); + } + if( vector == gdb_vector ) { + isr_ret = CYGACC_COMM_IF_DBG_ISR(*chan, &ctrlc, vector, data); + if (ctrlc) + cyg_hal_user_break( (CYG_ADDRWORD *)hal_saved_interrupt_state ); + return true; + } + return false; +} #endif // CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT || CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT //--------------------------------------------------------------------------
--- a/packages/hal/mips/vrc4373/current/ChangeLog +++ b/packages/hal/mips/vrc4373/current/ChangeLog @@ -1,3 +1,8 @@ +2000-08-31 Jonathan Larmour <jlarmour@redhat.com> + + * src/platform.S (hal_pci_config_read): Prevent assembler reordering, + the address is important + 2000-08-16 Nick Garnett <nickg@cygnus.co.uk> * include/pkgconf/mlt_mips_vr4300_vrc4373_romram.mlt:
--- a/packages/hal/mips/vrc4373/current/src/platform.S +++ b/packages/hal/mips/vrc4373/current/src/platform.S @@ -189,6 +189,7 @@ 1: FUNC_START(hal_pci_config_read) hal_pci_config_read_load: + .set noreorder lw v0,0(a0) # Read the value. If this bus-errors the # handler will skip this instruction and # put 0xFFFFFFFF into v0.
--- a/packages/hal/mn10300/arch/current/ChangeLog +++ b/packages/hal/mn10300/arch/current/ChangeLog @@ -1,3 +1,7 @@ +2000-08-29 Jonathan Larmour <jlarmour@redhat.co.uk> + + * src/vectors.S (__default_nmi_vsr): Fix quoting in comment problem + 2000-08-15 Drew Moseley <dmoseley@redhat.com> * src/mn10300_stub.c (__is_breakpoint_function): Prepend an _ to
--- a/packages/hal/mn10300/arch/current/src/vectors.S +++ b/packages/hal/mn10300/arch/current/src/vectors.S @@ -515,7 +515,7 @@ 0: # This should probably be done as the first thing in the exception # handler to guard against the possibility of having a bad SP to # begin with. ie if the user sets the SP to a bad location, we - # won't run properly. Ideally we should switch to monitor mode + # will not run properly. Ideally we should switch to monitor mode # on entry to any exception. However, a lot of other code # assumes things work this way. mov __interrupt_stack-4,a0
--- a/packages/hal/powerpc/mbx/current/ChangeLog +++ b/packages/hal/powerpc/mbx/current/ChangeLog @@ -1,3 +1,8 @@ +2000-08-28 Gary Thomas <gthomas@redhat.com> + + * cdl/hal_powerpc_mbx.cdl: Fix startup type description - was + totally bogus stuff copied from a different HAL. + 2000-08-15 Gary Thomas <gthomas@redhat.com> * src/mbx.S: Use actual ROM layout instead of magic numbers.
--- a/packages/hal/powerpc/mbx/current/cdl/hal_powerpc_mbx.cdl +++ b/packages/hal/powerpc/mbx/current/cdl/hal_powerpc_mbx.cdl @@ -69,8 +69,10 @@ cdl_package CYGPKG_HAL_POWERPC_MBX { no_define define -file system.h CYG_HAL_STARTUP description " - When targetting the FADS board for RAM bootstrap it is expected - that the image will be downloaded via the Motorola MPC8BUG tool." + This option is used to control where the application program will + run, either from RAM or ROM (flash) memory. ROM based applications + must be self contained, while RAM applications will typically assume + the existence of a debug environment, such as GDB stubs." } cdl_option CYGHWR_HAL_POWERPC_BOARD_SPEED {
--- a/packages/hal/v85x/arch/current/ChangeLog +++ b/packages/hal/v85x/arch/current/ChangeLog @@ -1,3 +1,7 @@ +2000-08-30 Gary Thomas <gthomas@redhat.com> + + * src/vectors.S (start): Allow programs to field NMI exceptions. + 2000-07-24 Jonathan Larmour <jlarmour@redhat.co.uk> * include/basetype.h: Removed definition of CYG_LABEL_NAME().
--- a/packages/hal/v85x/arch/current/src/vectors.S +++ b/packages/hal/v85x/arch/current/src/vectors.S @@ -179,6 +179,11 @@ 10: st.w r8,0[r6] jarl _hal_ctrlc_isr_init,r31 #endif #endif +#else // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS +// All programs need to provide for NMI handlers + lea _hal_vsr_table+4,r6 + lea do_exception,r8 + st.w r8,0[r6] #endif // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS // Run through static constructors
--- a/packages/io/eth/current/ChangeLog +++ b/packages/io/eth/current/ChangeLog @@ -1,3 +1,17 @@ +2000-08-29 Gary Thomas <gthomas@redhat.com> + + * src/stand_alone/eth_drv.c: Use null buffer, (char *)0, + instead of wasting memory - low level drivers must be designed + to handle this case. + +2000-08-28 Gary Thomas <gthomas@redhat.com> + + * src/stand_alone/eth_drv.c: Use new configuration parameters. + + * cdl/eth_drivers.cdl: Add new configury to control number of + internal buffers used by this layer. Also exposed some of the + debug flags here. + 2000-08-25 Hugo Tyson <hmt@cygnus.co.uk> * include/eth_drv_stats.h (ether_drv_stats): A little further
--- a/packages/io/eth/current/cdl/eth_drivers.cdl +++ b/packages/io/eth/current/cdl/eth_drivers.cdl @@ -62,6 +62,37 @@ cdl_package CYGPKG_IO_ETH_DRIVERS { default_value 1 no_define compile stand_alone/eth_drv.c + + cdl_option CYGNUM_IO_ETH_DRIVERS_NUM_PKT { + display "Number of \[network\] buffers" + flavor data + default_value 16 + legal_values 2 to 32 + description " + This option is used to allocate space to buffer incoming network + packets. These buffers are used to hold data until they can be + logically processed by higher layers." + } + + cdl_option CYGSEM_IO_ETH_DRIVERS_WARN { + display "Show driver warnings" + flavor bool + default_value 0 + description " + Selecting this option will allows the stand-alone ethernet driver + to display warnings on the system console when incoming network + packets are being discarded due to lack of buffer space." + } + + cdl_option CYGSEM_IO_ETH_DRIVERS_DEBUG { + display "Print driver debug information" + flavor bool + default_value 0 + description " + Selecting this option will enable the stand-alone driver to print + lots of information. Useful only when getting a low-level hardware + driver to work." + } } cdl_component CYGPKG_IO_ETH_DRIVERS_OPTIONS {
--- a/packages/io/eth/current/src/stand_alone/eth_drv.c +++ b/packages/io/eth/current/src/stand_alone/eth_drv.c @@ -44,6 +44,8 @@ //========================================================================== #include <pkgconf/system.h> +#include <pkgconf/io_eth_drivers.h> + #include <cyg/infra/cyg_type.h> #include <cyg/hal/hal_arch.h> #include <cyg/infra/diag.h> @@ -104,7 +106,7 @@ extern char __local_ip_addr[4]; // #define MAX_ETH_MSG 1540 -#define NUM_ETH_MSG 16 +#define NUM_ETH_MSG CYGNUM_IO_ETH_DRIVERS_NUM_PKT struct eth_msg { struct eth_msg *next, *prev; @@ -119,9 +121,6 @@ struct eth_msg_hdr { static struct eth_msg_hdr eth_msg_free, eth_msg_full; static struct eth_msg eth_msgs[NUM_ETH_MSG]; -// Used to "empty" hardware, even if there are no free buffers -static unsigned char no_pkt[MAX_ETH_MSG]; - // Prototypes for functions used in this module static void eth_drv_start(struct eth_drv_sc *sc); @@ -284,7 +283,7 @@ eth_drv_tx_done(struct eth_drv_sc *sc, C } else { // It's possible that this acknowledgement is for a different // [logical] driver. Try and pass it on. -#ifdef DEBUG +#ifdef CYGSEM_IO_ETH_DRIVERS_DEBUG int old_console; old_console = start_console(); printf("tx_done for other key: %x\n", key); @@ -378,11 +377,13 @@ eth_drv_recv(struct eth_drv_sc *sc, int if (msg) { buf = msg->data; } else { +#ifdef CYGSEM_IO_ETH_DRIVERS_WARN int old_console; old_console = start_console(); printf("%s: packet of %d bytes dropped\n", __FUNCTION__, total_len); end_console(old_console); - buf = &no_pkt[0]; +#endif + buf = (char *)0; // Drivers know this means "the bit bucket" } sg_list[0].buf = (CYG_ADDRESS)buf; sg_list[0].len = total_len;
--- a/packages/io/fileio/current/ChangeLog +++ b/packages/io/fileio/current/ChangeLog @@ -1,3 +1,8 @@ +2000-08-31 Nick Garnett <nickg@cygnus.co.uk> + + * src/select.cxx (select): Added scheduler unlock in timeout + return case. + 2000-08-22 Jonathan Larmour <jlarmour@redhat.co.uk> * doc/fileio.txt: Add Nick's text description of plug-in filesystems
--- a/packages/io/fileio/current/src/select.cxx +++ b/packages/io/fileio/current/src/select.cxx @@ -223,6 +223,7 @@ select(int nfd, fd_set *in, fd_set *out, if( Cyg_Clock::real_time_clock->current_value() >= ticks ) { select_mutex.unlock(); + Cyg_Scheduler::unlock(); FILEIO_RETURN_VALUE(0); } else error = EINTR;
--- a/packages/io/flash/current/ChangeLog +++ b/packages/io/flash/current/ChangeLog @@ -1,3 +1,9 @@ +2000-08-28 Gary Thomas <gthomas@redhat.com> + + * src/flash.c: + * include/flash.h: + * cdl/io_flash.cdl: Support block locking (optional by hardware). + 2000-08-22 Hugo Tyson <hmt@cygnus.co.uk> * src/flash.c (flash_program): Add HAL_ICACHE_DISABLE/ENABLE pairs
--- a/packages/io/flash/current/cdl/io_flash.cdl +++ b/packages/io/flash/current/cdl/io_flash.cdl @@ -63,4 +63,11 @@ cdl_package CYGPKG_IO_FLASH { This option enables the hardware device drivers for the current platform." } + + cdl_interface CYGHWR_IO_FLASH_BLOCK_LOCKING { + display "Hardware can support block locking" + description " + This option will be enabled by devices which can support + locking (write-protection) of individual blocks." + } }
--- a/packages/io/flash/current/include/flash.h +++ b/packages/io/flash/current/include/flash.h @@ -44,11 +44,17 @@ #ifndef _IO_FLASH_H_ #define _IO_FLASH_H_ +#include <pkgconf/io_flash.h> + #define FLASH_MIN_WORKSPACE 0x10000 // Space used by FLASH code extern int flash_init(void *work_space, int work_space_length); extern int flash_erase(void *base, int len, void **err_address); extern int flash_program(void *flash_base, void *ram_base, int len, void **err_address); +#ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING +extern int flash_lock(void *base, int len, void **err_address); +extern int flash_unlock(void *base, int len, void **err_address); +#endif extern int flash_verify_addr(void *base); extern int flash_get_limits(void *base, void **start, void **end); extern int flash_get_block_info(int *block_size, int *blocks);
--- a/packages/io/flash/current/src/flash.c +++ b/packages/io/flash/current/src/flash.c @@ -41,6 +41,9 @@ // //========================================================================== +#include <pkgconf/system.h> +#include <pkgconf/io_flash.h> + #include <cyg/hal/hal_arch.h> #include <cyg/hal/hal_intr.h> #include <cyg/hal/hal_cache.h> @@ -186,6 +189,91 @@ flash_program(void *_addr, void *_data, return (stat); } +#ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING + +int +flash_lock(void *addr, int len, void **err_addr) +{ + unsigned short *block, *end_addr; + int stat = 0; + extern char flash_lock_block, flash_lock_block_end; + int code_len; + typedef int code_fun(unsigned short *); + code_fun *_flash_lock_block; + + if (!flash_info.init) { + return FLASH_ERR_NOT_INIT; + } + + // Copy 'lock' code to RAM for execution + code_len = (unsigned long)&flash_lock_block_end - (unsigned long)&flash_lock_block; + _flash_lock_block = (code_fun *)flash_info.work_space; + memcpy(_flash_lock_block, &flash_lock_block, code_len); + HAL_DCACHE_SYNC(); // Should guarantee this code will run + HAL_ICACHE_DISABLE(); // is also required to avoid old contents + + block = (unsigned short *)((unsigned long)addr & flash_info.block_mask); + end_addr = (unsigned short *)((unsigned long)addr+len); + + printf("... Lock from %p-%p: ", block, end_addr); + + while (block < end_addr) { + stat = (*_flash_lock_block)(block); + stat = flash_hwr_map_error(stat); + if (stat) { + *err_addr = (void *)block; + break; + } + block += flash_info.block_size / sizeof(*block); + printf("."); + } + HAL_ICACHE_ENABLE(); + printf("\n"); + return (stat); +} + +int +flash_unlock(void *addr, int len, void **err_addr) +{ + unsigned short *block, *end_addr; + int stat = 0; + extern char flash_unlock_block, flash_unlock_block_end; + int code_len; + typedef int code_fun(unsigned short *, int, int); + code_fun *_flash_unlock_block; + + if (!flash_info.init) { + return FLASH_ERR_NOT_INIT; + } + + // Copy 'lock' code to RAM for execution + code_len = (unsigned long)&flash_unlock_block_end - (unsigned long)&flash_unlock_block; + _flash_unlock_block = (code_fun *)flash_info.work_space; + memcpy(_flash_unlock_block, &flash_unlock_block, code_len); + HAL_DCACHE_SYNC(); // Should guarantee this code will run + HAL_ICACHE_DISABLE(); // is also required to avoid old contents + + block = (unsigned short *)((unsigned long)addr & flash_info.block_mask); + end_addr = (unsigned short *)((unsigned long)addr+len); + + printf("... Unlock from %p-%p: ", block, end_addr); + + while (block < end_addr) { + stat = (*_flash_unlock_block)(block, flash_info.block_size, flash_info.blocks); + stat = flash_hwr_map_error(stat); + if (stat) { + *err_addr = (void *)block; + break; + } + block += flash_info.block_size / sizeof(*block); + printf("."); + } + HAL_ICACHE_ENABLE(); + printf("\n"); + return (stat); +} +#endif + char * flash_errmsg(int err) {
--- a/packages/isoinfra/current/ChangeLog +++ b/packages/isoinfra/current/ChangeLog @@ -1,3 +1,12 @@ +2000-08-30 Jonathan Larmour <jlarmour@redhat.co.uk> + + * include/assert.h (assert): Fix logic + +2000-08-29 Jonathan Larmour <jlarmour@redhat.co.uk> + + * include/stddef.h: Don't use CYGONCE_ multiple header inclusion + protection for this file - this is special. + 2000-08-08 Jonathan Larmour <jlarmour@redhat.co.uk> * include/limits.h: Add SSIZE_MAX
--- a/packages/isoinfra/current/include/assert.h +++ b/packages/isoinfra/current/include/assert.h @@ -71,7 +71,7 @@ # define assert( __bool ) \ do { \ - if (0 != (__bool)) { \ + if (0 == (__bool)) { \ fprintf( stderr, "User assertion failed: \"%s\", at %s:%d\n", \ #__bool, __FILE__, __LINE__); \ abort(); \ @@ -95,7 +95,7 @@ # define assert( __bool ) \ do { \ - if (0 != (__bool)) { \ + if (0 == (__bool)) { \ diag_printf( "User assertion failed: \"%s\", at %s:%d\n", \ #__bool, __FILE__, __LINE__); \ for (;;); \
--- a/packages/isoinfra/current/include/stddef.h +++ b/packages/isoinfra/current/include/stddef.h @@ -1,5 +1,4 @@ -#ifndef CYGONCE_ISO_STDDEF_H -#define CYGONCE_ISO_STDDEF_H +// Do not define CYGONCE_ISO_STDDEF_H. It is not appropriate for this file /*======================================================================== // // stddef.h @@ -55,6 +54,4 @@ #include_next <stddef.h> -#endif /* CYGONCE_ISO_STDDEF_H multiple inclusion protection */ - /* EOF stddef.h */
--- a/packages/language/c/libm/current/ChangeLog +++ b/packages/language/c/libm/current/ChangeLog @@ -1,3 +1,9 @@ +2000-08-31 Jonathan Larmour <jlarmour@redhat.com> + + * include/math.h: Declare cyg_libm_infinity as an array type for correct + relocations + * src/misc/infconst.c: Define it likewise + 2000-05-30 Jesper Skov <jskov@redhat.com> * include/sys/ieeefp.h: Undo below change.
--- a/packages/language/c/libm/current/include/math.h +++ b/packages/language/c/libm/current/include/math.h @@ -67,7 +67,7 @@ // HUGE_VAL is a positive double (not necessarily representable as a float) // representing infinity as specified in ANSI 7.5. cyg_libm_infinity is // defined further down -#define HUGE_VAL (cyg_libm_infinity.value) +#define HUGE_VAL (cyg_libm_infinity[0].value) #ifndef CYGSYM_LIBM_NO_XOPEN_SVID_NAMESPACE_POLLUTION @@ -103,7 +103,7 @@ struct exception { // GLOBALS -externC const Cyg_libm_ieee_double_shape_type cyg_libm_infinity; +externC const Cyg_libm_ieee_double_shape_type cyg_libm_infinity[]; //=========================================================================== // FUNCTION PROTOTYPES
--- a/packages/language/c/libm/current/src/misc/infconst.c +++ b/packages/language/c/libm/current/src/misc/infconst.c @@ -62,11 +62,11 @@ #if (CYG_BYTEORDER == CYG_MSBFIRST) // Big endian -const Cyg_libm_ieee_double_shape_type cyg_libm_infinity = { {0x7ff00000, 0} }; +const Cyg_libm_ieee_double_shape_type cyg_libm_infinity[] = { {0x7ff00000, 0} }; #else // Little endian -const Cyg_libm_ieee_double_shape_type cyg_libm_infinity = { {0, 0x7ff00000} }; +const Cyg_libm_ieee_double_shape_type cyg_libm_infinity[] = { {0, 0x7ff00000} }; #endif
--- a/packages/net/snmp/agent/current/ChangeLog +++ b/packages/net/snmp/agent/current/ChangeLog @@ -1,3 +1,9 @@ +2000-08-31 Hugo Tyson <hmt@cygnus.co.uk> + + * tests/snmpping.c (net_test): Add use of network realtime test + harness - if available. One example is provided for the EBSA285 + in "devs/eth/arm/ebsa285/VERSION/tests/test_net_realtime.h" + 2000-08-25 Hugo Tyson <hmt@cygnus.co.uk> * src/mibgroup/mibII/dot3.c (var_dot3StatsTable): A little further
--- a/packages/net/snmp/agent/current/tests/snmpping.c +++ b/packages/net/snmp/agent/current/tests/snmpping.c @@ -138,8 +138,35 @@ CONNECTION WITH THE USE OR PERFORMANCE O #include <network.h> +#include <pkgconf/system.h> +#include <pkgconf/net.h> + #include <cyg/infra/testcase.h> +#ifdef CYGBLD_DEVS_ETH_DEVICE_H // Get the device config if it exists +#include CYGBLD_DEVS_ETH_DEVICE_H // May provide CYGTST_DEVS_ETH_TEST_NET_REALTIME +#endif + +#ifdef CYGPKG_NET_TESTS_USE_RT_TEST_HARNESS // do we use the rt test? +# ifdef CYGTST_DEVS_ETH_TEST_NET_REALTIME // Get the test ancilla if it exists +# include CYGTST_DEVS_ETH_TEST_NET_REALTIME +# endif +#endif + +// Fill in the blanks if necessary +#ifndef TNR_OFF +# define TNR_OFF() +#endif +#ifndef TNR_ON +# define TNR_ON() +#endif +#ifndef TNR_INIT +# define TNR_INIT() +#endif +#ifndef TNR_PRINT_ACTIVITY +# define TNR_PRINT_ACTIVITY() +#endif + #define STACK_SIZE (CYGNUM_HAL_STACK_SIZE_TYPICAL + 0x1000) static char stack[STACK_SIZE]; static cyg_thread thread_data; @@ -232,8 +259,10 @@ ping_host(int s, struct sockaddr_in *hos ok_recv = 0; bogus_recv = 0; + TNR_OFF(); diag_printf("PING server %s\n", inet_ntoa(host->sin_addr)); for (seq = 0; seq < NUM_PINGS; seq++) { + TNR_ON(); // Build ICMP packet icmp->icmp_type = ICMP_ECHO; icmp->icmp_code = 0; @@ -251,12 +280,14 @@ ping_host(int s, struct sockaddr_in *hos icmp->icmp_cksum = inet_cksum( (u_short *)icmp, icmp_len+8); // Send it off if (sendto(s, icmp, icmp_len+8, 0, (struct sockaddr *)host, sizeof(*host)) < 0) { + TNR_OFF(); perror("sendto"); continue; } // Wait for a response fromlen = sizeof(from); len = recvfrom(s, pkt2, sizeof(pkt2), 0, (struct sockaddr *)&from, &fromlen); + TNR_OFF(); if (len < 0) { perror("recvfrom"); } else { @@ -267,6 +298,7 @@ ping_host(int s, struct sockaddr_in *hos } } } + TNR_OFF(); diag_printf("Sent %d packets, received %d OK, %d bad\n", NUM_PINGS, ok_recv, bogus_recv); } @@ -338,6 +370,7 @@ net_test(cyg_addrword_t p) int i = 0; int j; diag_printf("Start PING test\n"); + TNR_INIT(); init_all_network_interfaces(); #ifdef CYGPKG_SNMPAGENT { @@ -346,6 +379,7 @@ net_test(cyg_addrword_t p) } #endif do { + TNR_ON(); #ifdef CYGHWR_NET_DRIVER_ETH0 if (eth0_up) { ping_test(ð0_bootp_data); @@ -364,6 +398,8 @@ net_test(cyg_addrword_t p) cyg_thread_delay(500); } #endif + TNR_OFF(); + TNR_PRINT_ACTIVITY(); } while ( i-- > 0 ); CYG_TEST_PASS_FINISH( "Done pinging while SNMP looks on" ); }
--- a/packages/net/tcpip/current/ChangeLog +++ b/packages/net/tcpip/current/ChangeLog @@ -1,3 +1,9 @@ +2000-08-31 Hugo Tyson <hmt@cygnus.co.uk> + + * tests/tcp_echo.c: Change the priorities of the main and loading + threads to accommodate the network having helper threads around at + adjacent priorities to its main thread prio. + 2000-08-24 Hugo Tyson <hmt@cygnus.co.uk> * src/sys/net/if.c (ifioctl): Support the two new ioctl() keys; at
--- a/packages/net/tcpip/current/tests/tcp_echo.c +++ b/packages/net/tcpip/current/tests/tcp_echo.c @@ -120,8 +120,8 @@ static cyg_handle_t thread_handle; // Background load stuff #define NUM_LOAD_THREADS 20 // Get 5% granularity #define IDLE_THREAD_PRIORITY CYGPKG_NET_THREAD_PRIORITY+3 -#define LOAD_THREAD_PRIORITY CYGPKG_NET_THREAD_PRIORITY-1 -#define MAIN_THREAD_PRIORITY CYGPKG_NET_THREAD_PRIORITY-2 +#define LOAD_THREAD_PRIORITY CYGPKG_NET_THREAD_PRIORITY-3 +#define MAIN_THREAD_PRIORITY CYGPKG_NET_THREAD_PRIORITY-4 #define DESIRED_BACKGROUND_LOAD 50 // should be accurate enough over range // starting points for load calculation
--- a/packages/redboot/current/ChangeLog +++ b/packages/redboot/current/ChangeLog @@ -1,3 +1,7 @@ +2000-08-28 Gary Thomas <gthomas@redhat.com> + + * src/flash.c: Support block locking if available. + 2000-08-25 Gary Thomas <gthomas@redhat.com> * src/load.c (getc): Fix edge condition when file is an exact multiple
--- a/packages/redboot/current/cdl/redboot.cdl +++ b/packages/redboot/current/cdl/redboot.cdl @@ -101,7 +101,7 @@ cdl_package CYGPKG_REDBOOT { cdl_option CYGNUM_REDBOOT_NETWORKING_TCP_PORT { display "TCP port to listen for incoming connections" - flavor data + flavor data default_value 9000 description " RedBoot will 'listen' on this port for incoming TCP connections. @@ -111,7 +111,7 @@ cdl_package CYGPKG_REDBOOT { cdl_option CYGNUM_REDBOOT_NETWORKING_MAX_PKTBUF { display "Number of \[network\] packet buffers" - flavor data + flavor data default_value 4 legal_values 2 to 8 description "
--- a/packages/redboot/current/src/flash.c +++ b/packages/redboot/current/src/flash.c @@ -96,6 +96,20 @@ local_cmd_entry("erase", fis_erase, FIS_cmds ); +#ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING +local_cmd_entry("lock", + "LOCK FLASH contents", + "-f <flash_addr> -l <length>", + fis_lock, + FIS_cmds + ); +local_cmd_entry("unlock", + "UNLOCK FLASH contents", + "-f <flash_addr> -l <length>", + fis_unlock, + FIS_cmds + ); +#endif local_cmd_entry("delete", "Display an image from FLASH Image System [FIS]", "name", @@ -469,6 +483,81 @@ fis_erase(int argc, char *argv[]) } } +#ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING + +static void +fis_lock(int argc, char *argv[]) +{ + int stat; + unsigned long flash_addr, length; + bool flash_addr_set = false; + bool length_set = false; + void *err_addr; + struct option_info opts[2]; + + init_opts(&opts[0], 'f', true, OPTION_ARG_TYPE_NUM, + (void **)&flash_addr, (bool *)&flash_addr_set, "FLASH memory base address"); + init_opts(&opts[1], 'l', true, OPTION_ARG_TYPE_NUM, + (void **)&length, (bool *)&length_set, "length"); + if (!scan_opts(argc, argv, 2, opts, 2, (void **)0, 0, "")) + { + fis_usage("invalid arguments"); + return; + } + + if (!flash_addr_set || !length_set) { + fis_usage("missing argument"); + return; + } + if (flash_addr_set && + ((stat = flash_verify_addr((void *)flash_addr)) || + (stat = flash_verify_addr((void *)(flash_addr+length-1))))) { + printf("Invalid FLASH address: %p (%s)\n", (void *)flash_addr, flash_errmsg(stat)); + printf(" valid range is %p-%p\n", (void *)flash_start, (void *)flash_end); + return; + } + if ((stat = flash_lock((void *)flash_addr, length, (void **)&err_addr)) != 0) { + printf("Error locking at %p: %x(%s)\n", err_addr, stat, flash_errmsg(stat)); + } +} + +static void +fis_unlock(int argc, char *argv[]) +{ + int stat; + unsigned long flash_addr, length; + bool flash_addr_set = false; + bool length_set = false; + void *err_addr; + struct option_info opts[2]; + + init_opts(&opts[0], 'f', true, OPTION_ARG_TYPE_NUM, + (void **)&flash_addr, (bool *)&flash_addr_set, "FLASH memory base address"); + init_opts(&opts[1], 'l', true, OPTION_ARG_TYPE_NUM, + (void **)&length, (bool *)&length_set, "length"); + if (!scan_opts(argc, argv, 2, opts, 2, (void **)0, 0, "")) + { + fis_usage("invalid arguments"); + return; + } + + if (!flash_addr_set || !length_set) { + fis_usage("missing argument"); + return; + } + if (flash_addr_set && + ((stat = flash_verify_addr((void *)flash_addr)) || + (stat = flash_verify_addr((void *)(flash_addr+length-1))))) { + printf("Invalid FLASH address: %p (%s)\n", (void *)flash_addr, flash_errmsg(stat)); + printf(" valid range is %p-%p\n", (void *)flash_start, (void *)flash_end); + return; + } + if ((stat = flash_unlock((void *)flash_addr, length, (void **)&err_addr)) != 0) { + printf("Error unlocking at %p: %x(%s)\n", err_addr, stat, flash_errmsg(stat)); + } +} +#endif + static void fis_delete(int argc, char *argv[]) { @@ -503,7 +592,7 @@ fis_delete(int argc, char *argv[]) printf("No image '%s' found\n", name); return; } - // Erase data blocks (free space) + // Erase Data blocks (free space) if ((stat = flash_erase((void *)img->flash_base, img->size, (void **)&err_addr)) != 0) { printf("Error erasing at %p: %x(%s)\n", err_addr, stat, flash_errmsg(stat)); }
--- a/packages/services/memalloc/common/current/ChangeLog +++ b/packages/services/memalloc/common/current/ChangeLog @@ -1,3 +1,9 @@ +2000-08-31 Jonathan Larmour <jlarmour@redhat.com> + + * cdl/memalloc.cdl: Make dlmalloc the default malloc implementation now. + Also add info to the variable block and dlmalloc descriptions to + describe the pros and cons of these allocators. + 2000-08-09 Jonathan Larmour <jlarmour@redhat.co.uk> * tests/malloc4.cxx (thrfree): Don't yield at loop end - actually delay
--- a/packages/services/memalloc/common/current/cdl/memalloc.cdl +++ b/packages/services/memalloc/common/current/cdl/memalloc.cdl @@ -84,7 +84,10 @@ cdl_package CYGPKG_MEMALLOC { no_define description " This component contains configuration options related to the - simple variable block memory allocator." + simple variable block memory allocator. This allocator is not + very fast, and in particular does not scale well with large + numbers of allocations. It is however very compact in terms of + code size and does not have very much overhead per allocation." cdl_option CYGSEM_MEMALLOC_ALLOCATOR_VARIABLE_THREADAWARE { display "Make thread safe" @@ -116,7 +119,10 @@ cdl_package CYGPKG_MEMALLOC { description " This component contains configuration options related to the port of Doug Lea's memory allocator, normally known as - dlmalloc." + dlmalloc. dlmalloc has a reputation for being both fast + and space-conserving, as well as resisting fragmentation well. + It is a common choice for a general purpose allocator and + has been used in both newlib and Linux glibc." cdl_option CYGDBG_MEMALLOC_ALLOCATOR_DLMALLOC_DEBUG { display "Debug build" @@ -244,14 +250,14 @@ cdl_package CYGPKG_MEMALLOC { to do this is set in this option. It is only intended to be set by the implementation, not the user." # default corresponds to the default allocator - default_value {"<cyg/memalloc/memvar.hxx>"} + default_value {"<cyg/memalloc/dlmalloc.hxx>"} } cdl_option CYGIMP_MEMALLOC_MALLOC_VARIABLE_SIMPLE { display "Simple variable block implementation" description "This causes malloc() to use the simple variable block allocator." - default_value 1 + default_value 0 implements CYGINT_MEMALLOC_MALLOC_ALLOCATORS requires { CYGBLD_MEMALLOC_MALLOC_IMPLEMENTATION_HEADER == \ "<cyg/memalloc/memvar.hxx>" } @@ -262,7 +268,7 @@ cdl_package CYGPKG_MEMALLOC { display "Doug Lea's malloc implementation" description "This causes malloc() to use a version of Doug Lea's malloc (dlmalloc) as the underlying implementation." - default_value 0 + default_value 1 implements CYGINT_MEMALLOC_MALLOC_ALLOCATORS requires { CYGBLD_MEMALLOC_MALLOC_IMPLEMENTATION_HEADER == \ "<cyg/memalloc/dlmalloc.hxx>" }
