# HG changeset patch # User bartv # Date 1032112106 0 # Node ID 7c1c8dc43ba1c7690191dc4635c4696f3e496f23 # Parent 83cd88af121162f98044010a88d87599ba6533d3 Now witness the firepower of this fully armed and operational synthetic target. diff --git a/packages/devs/eth/synth/ecosynth/current/ChangeLog b/packages/devs/eth/synth/ecosynth/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/ChangeLog @@ -0,0 +1,35 @@ +2002-08-07 Bart Veer + + * synthetic target ethernet driver package created + +//=========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 2002 Bart Veer +// +// 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. +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//=========================================================================== diff --git a/packages/devs/eth/synth/ecosynth/current/cdl/syntheth.cdl b/packages/devs/eth/synth/ecosynth/current/cdl/syntheth.cdl new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/cdl/syntheth.cdl @@ -0,0 +1,143 @@ +# ==================================================================== +# +# syntheth.cdl +# +# Synthetic target ethernet package. +# +# ==================================================================== +#####ECOSGPLCOPYRIGHTBEGIN#### +## ------------------------------------------- +## This file is part of eCos, the Embedded Configurable Operating System. +## Copyright (C) 2002 Bart Veer +## +## 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 the +## copyright holder(s). +## ------------------------------------------- +#####ECOSGPLCOPYRIGHTEND#### +# ==================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): bartv +# Original data: bartv +# Contributors: +# Date: 2002-08-07 +# +#####DESCRIPTIONEND#### +# ==================================================================== + +cdl_package CYGPKG_DEVS_ETH_ECOSYNTH { + display "Synthetic target ethernet driver" + description " + The ethernet driver for the eCos synthetic target allows applications + and other packages such as a TCP/IP stack to perform ethernet I/O. + This can involve either an unused ethernet device, or an emulated + ethernet device as provided by the Linux kernel's tunnel/tap + support. The eCos code interacts with a suitable Linux application + through the I/O auxiliary. Up to four ethernet devices are + supported, and the host-side target definition file controls how + each device will perform its I/O." + + parent CYGPKG_IO_ETH_DRIVERS + active_if CYGPKG_IO_ETH_DRIVERS + active_if CYGPKG_HAL_SYNTH + + cdl_option CYGVAR_DEVS_ETH_ECOSYNTH_ETH0 { + display "Provide eth0 device" + description " + The synthetic target can provide up to four ethernet devices, + eth0 to eth3. By default eth0 is enabled when a TCP/IP stack + is part of the configuration, disabled otherwise." + default_value CYGPKG_NET_STACK + implements CYGHWR_NET_DRIVERS + implements CYGHWR_NET_DRIVER_ETH0 + } + + cdl_option CYGVAR_DEVS_ETH_ECOSYNTH_ETH1 { + display "Provide eth1 device" + description " + The synthetic target can provide up to four ethernet devices, + eth0 to eth3. By default eth1 is always disabled, but can + be enabled if the eCos application needs more than one ethernet + device." + default_value 0 + implements CYGHWR_NET_DRIVERS + implements CYGHWR_NET_DRIVER_ETH1 + } + + cdl_option CYGVAR_DEVS_ETH_ECOSYNTH_ETH2 { + display "Provide eth2 device" + description " + The synthetic target can provide up to four ethernet devices, + eth0 to eth3. By default eth2 is always disabled, but can + be enabled if the eCos application needs more than two ethernet + devices." + default_value 0 + implements CYGHWR_NET_DRIVERS + } + + cdl_option CYGVAR_DEVS_ETH_ECOSYNTH_ETH3 { + display "Provide eth3 device" + description " + The synthetic target can provide up to four ethernet devices, + eth0 to eth3. By default eth3 is always disabled, but can + be enabled if the eCos application needs more than three ethernet + devices." + default_value 0 + implements CYGHWR_NET_DRIVERS + } + + cdl_component CYGPKG_DEVS_ETH_ECOSYNTH_OPTIONS { + display "Build options" + active_if { CYGVAR_DEVS_ETH_ECOSYNTH_ETH0 || CYGVAR_DEVS_ETH_ECOSYNTH_ETH1 || CYGVAR_DEVS_ETH_ECOSYNTH_ETH2 || CYGVAR_DEVS_ETH_ECOSYNTH_ETH3 } + flavor none + compile -library=libextras.a syntheth.c + description " + Package-specific build options including control over compiler + flags used only in building this package." + + cdl_option CYGPKG_DEVS_ETH_ECOSYNTH_CFLAGS_ADD { + display "Additional compiler flags" + flavor data + no_define + default_value { "" } + description " + This option modifies the set of compiler flags for + building this package. These flags are used in addition + to the set of global flags." + } + cdl_option CYGPKG_DEVS_ETH_ECOSYNTH_CFLAGS_REMOVE { + display "Suppressed compiler flags" + flavor data + no_define + default_value { "" } + description " + This option modifies the set of compiler flags for + building this package. These flags are removed from + the set of global flags if present." + } + } +} + diff --git a/packages/devs/eth/synth/ecosynth/current/doc/devs-eth-synth-ecosynth.html b/packages/devs/eth/synth/ecosynth/current/doc/devs-eth-synth-ecosynth.html new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/doc/devs-eth-synth-ecosynth.html @@ -0,0 +1,912 @@ + + + + + + + + + + + +Synthetic Target Ethernet Driver +

Synthetic Target Ethernet Driver

Name

Synthetic Target Ethernet Support -- Allow synthetic target applications to perform ethernet I/O

Overview

The synthetic target ethernet package can provide up to four network +devices, eth0 to eth3. These can +be used directly by the eCos application or, more commonly, by a +TCP/IP stack that is linked with the eCos application. Each eCos +device can be mapped on to a real Linux network device. For example, +if the Linux PC has two ethernet cards and eth1 is +not currently being used by Linux itself, then one of the eCos devices +can be mapped on to this Linux device. Alternatively, it is possible +to map some or all of the eCos devices on to the ethertap support +provided by the Linux kernel. +

The ethernet package depends on the I/O auxiliary provided by the +synthetic target architectural HAL package. During initialization the +eCos application will attempt to instantiate the desired devices, by +sending a request to the auxiliary. This will load a Tcl script +ethernet.tcl that is responsible for handling the +instantiation request and subsequent I/O operations, for example +transmitting an ethernet packet. However, some of the low-level I/O +operations cannot conveniently be done by a Tcl script so +ethernet.tcl will actually run a separate program +rawether to interact with the Linux network device. +

On the target-side there are configuration options to control which +network devices should be present. For many applications a single +device will be sufficient, but if the final eCos application is +something like a network bridge then the package can support multiple +devices. On the host-side each eCos network device needs to be mapped +on to a Linux one, either a real ethernet device or an ethertap +device. This is handled by an entry in the target definition file: +

synth_device ethernet {
+    eth0 real eth1
+    eth1 ethertap tap3 00:01:02:03:FE:05
+    …
+}

The ethernet package also comes with support for packet logging, +and provides various facilities for use by user Tcl scripts. +

Installation

Before a synthetic target eCos application can access ethernet devices +it is necessary to build and install host-side support. The relevant +code resides in the host +subdirectory of the synthetic target ethernet package, and building it +involves the standard configure, +make and make install steps. +The build involves a new executable rawether which +must be able to access a raw Linux network device. This is achieved by +installing it suid root, so the make install step +has to be run with superuser privileges. +

Caution

Installing rawether suid root introduces a +potential security problem. Although normally +rawether is executed only by the I/O auxiliary, +theoretically it can be run by any program. Effectively it gives any +user the ability to monitor all ethernet traffic and to inject +arbitrary packets into the network. Also, as with any suid root +programs there may be as yet undiscovered exploits. Users and system +administrators should consider the risks before running make +install. +

There are two main ways of building the host-side software. It is +possible to build both the generic host-side software and all +package-specific host-side software, including the ethernet support, +in a single build tree. This involves using the +configure script at the toplevel of the eCos +repository. For more information on this, see the +README.host file at the top of the repository. +Note that if you have an existing build tree which does not include +the synthetic target ethernet support then it will be necessary to +rerun the toplevel configure script: the search for appropriate +packages happens at configure time. +

The alternative is to build just the host-side for this package. +This requires a separate build directory, building directly in the +source tree is disallowed. The configure options +are much the same as for a build from the toplevel, and the +README.host file can be consulted for more +details. It is essential that the ethernet support be configured with +the same --prefix option as other eCos host-side +software, especially the I/O auxiliary provided by the architectural +synthetic target HAL package, otherwise the I/O auxiliary will be +unable to locate the ethernet support. +

Target-side Configuration Options

The target-side code can be configured to support up to four ethernet +devices, eth0 to eth3. By +default eth0 is enabled if the configuration +includes a TCP/IP stack, otherwise it is disabled. The other three +devices are always disabled by default. If any of the devices are +enabled then there will also be the usual configuration options +related to building this package. Other options related to network +devices, for example whether or not to use DHCP, are provided by +the generic network device package. +

Real Ethernet

One obvious way of providing a synthetic target eCos application with +ethernet I/O is to use a real ethernet device in the PC: transmitted +packets go out on a real network, and packets on the network addressed +to the right MAC address are passed on to eCos. This way synthetic +target networking behaves just like networking on a real target with +ethernet hardware. For example, if there is a DHCP server anywhere on +the network then eCos will be able to contact it during networking +startup and get hold of IP address information. +

Configuring the ethernet support to use a real ethernet device +requires a simple entry in the target definition file: +

synth_device ethernet {
+    <eCos device> real <linux device>
+    …
+}

For example, to map the eCos network device eth0 to +the Linux device eth1: +

synth_device ethernet {
+    eth0 real eth1
+    …
+}

It is not possible for an ethernet device to be shared by both the +eCos TCP/IP stack and the Linux one: there would be no simple way to +work out which stack incoming packets are intended for. In theory +it might be possible to do some demultiplexing using distinct IP +addresses, but it would be impossible to support some functionality +such as DHCP. Therefore the rawether program will +refuse to access any ethernet device already in use. On a typical +Linux system eth0 will be used for Linux +networking, and the PC will have to be equipped with additional +ethernet devices for use by eCos. +

The rawether program will access the hardware via +the appropriate Linux device driver, so it is important that the +system is set up such that the relevant module will be automatically +loaded or is already loaded. The details of this will depend on the +installed distribution and version, but typically it will involve an +entry in /etc/modules.conf. +

Ethertap

The Linux kernel's ethertap facility provides a virtual network +interface. A Linux application, for example the +rawether program, can open a special character +device /dev/net/tun, perform various +ioctl calls, and then write +and read ethernet packets. When the device is +opened the Linux kernel automatically creates a new network interface, +for example tap0. The Linux TCP/IP stack can be +made to use this network interface like any other interface, receiving +and transmitting ethernet packets. The net effect is a virtual network +connecting just the Linux and eCos TCP/IP stacks, with no other nodes +attached. By default all traffic remains inside this virtual network +and is never forwarded to a real network. +

Support for the ethertap facility may or may not be provided +automatically, depending on your Linux distribution and version. If +your system does not have a device /dev/net/tun +or a module tun.o then the appropriate kernel +documentation should be consulted, for example +/usr/src/linux-2.4/Documentation/networking/tuntap.txt. +

The target definition file is used to map eCos network devices on to +ethertap devices. The simplest usage is: +

synth_device ethernet {
+    eth0 ethertap
+    …
+}

The Linux kernel will automatically allocate the next available tap +network interface. Usually this will be tap0 but if +other software is using the ethertap facility, for example to +implement a VPN, then a different number may be allocated. Usually it +will be better to specify the particular tap device that should be +used for each eCos device, for example: +

synth_device ethernet {
+    eth0 ethertap tap3
+    eth1 ethertap tap4
+    …
+}

The user now knows exactly which eCos device is mapped onto which +Linux device, avoiding much potential confusion. Because the virtual +devices are emulated ethernet devices, they require MAC addresses. +There is no physical hardware to provide these addresses, so normally +MAC addresses will be invented. That means that each time the eCos +application is run it will have different MAC addresses, which makes +it more difficult to compare the results of different runs. To get +more deterministic behaviour it is possible to specify the MAC +addresses in the target definition file: +

synth_device ethernet {
+    eth0 ethertap tap3 00:01:02:03:FE:05
+    eth1 ethertap tap4 00:01:02:03:FE:06
+    …
+}

During the initialization phase the eCos application will instantiate +the various network devices. This will cause the I/O auxiliary to load +the ethernet.tcl script and spawn +rawether processes, which in turn will +open /dev/net/tun and +perform the appropriate ioctl calls. On the Linux +side there will now be new network interfaces such as +tap3, and these can be configured like any other +network interface using commands such as ifconfig. +In addition, if the Linux system is set up with hotplug support then +it may be possible to arrange for the network interface to become +active automatically. On a Red Hat Linux system this would require +files such as +/etc/sysconfig/network-scripts/ifcfg-tap3, +containing data like: +

DEVICE="tap3"
+BOOTPROTO="none"
+BROADCAST=10.2.2.255
+IPADDR="10.2.2.1"
+NETMASK="255.255.255.0"
+NETWORK=10.2.2.0
+ONBOOT="no"

This gives the Linux interface the address 10.2.2.1 +on the network 10.2.2.0. The eCos network device +should be configured with a compatible address. One way of doing this +would be to enable CYGHWR_NET_DRIVER_ETH0_ADDRS, +set CYGHWR_NET_DRIVER_ETH0_ADDRS_IP to +10.2.2.2, and similarly update the +NETMASK, BROADCAST, +GATEWAY and SERVER configuration +options. +

It should be noted that the ethertap facility provides a virtual +network, and any packets transmitted by the eCos application will +not appear on a real network. Therefore usually there will no +accessible DHCP server, and eCos cannot use DHCP or BOOTP to obtain IP +address information. Instead the eCos configuration should use manual +or static addresses. +

An alternative approach would be to set up the Linux box as a network +bridge, using commands like brctl to connect the +virtual network interface tap3 to a physical +network interface such as eth0. Any packets sent by +the eCos application will get forwarded automatically to the real +network, and some packets on the real network will get forwarded over +the virtual network to the eCos application. Note that the eCos +application might also get some packets that were not intended for it, +but usually those will just be discarded by the eCos TCP/IP stack. The +exact details of setting up a network bridge are left as an exercise +to the reader. +

Packet Logging

The ethernet support comes with support for logging the various +packets that are transferred, including a simple protocol analyser. +This generates simple text output using the filter mechanisms provided +by the I/O auxiliary, so it is possible to control the appearance and +visibility of different types of output. For example the user might +want to see IPv4 headers and all ICMPv4 and ARP operations, but not +TCP headers or any of the packet data. +

The protocol analyser is not intended to be a fully functional +analyser with knowledge of many different TCP/IP protocols, advanced +search facilities, graphical traffic displays, and so on. +Functionality like that is already provided by other tools such as +ethereal and +tcpdump. Achieving similar levels of +functionality would require a lot of work, for very little gain. It is +still useful to have some protocol analysis functionality available +because the output will be interleaved with other output, for example +printf calls from the application. That may make +it easier to understand the sequence of events. +

One problem with logging ethernet traffic is that it can involve very +large amounts of data. If the application is expected to run for a +long time or is very I/O intensive then it is easy to end up with many +megabytes. When running in graphical mode all the logging data will be +held in memory, even data that is not currently visible. At some point +the system will begin to run low on memory and performance will +suffer. To avoid problems, the ethernet script maintains a flag that +controls whether or not packet logging is active. The default is to +run with logging disabled, but this can be changed in the target +definition file: +

synth_device ethernet {
+    …
+    logging 1
+}

The ethernet script will add a toolbar button that allows this flag to +be changed at run-time, allowing the user to capture traffic for +certain periods of time while the application continues running. +

The target definition file can contain the following entries for the +various packet logging filters: +

synth_device ethernet {
+    …
+    filter ether  -hide 0 -background LightBlue -foreground "#000080"
+    filter arp    -hide 0 -background LightBlue -foreground "#000050"
+    filter ipv4   -hide 0 -background LightBlue -foreground "#000040"
+    filter ipv6   -hide 1 -background LightBlue -foreground "#000040"
+    filter icmpv4 -hide 0 -background LightBlue -foreground "#000070"
+    filter icmpv6 -hide 1 -background LightBlue -foreground "#000070"
+    filter udp    -hide 0 -background LightBlue -foreground "#000030"
+    filter tcp    -hide 0 -background LightBlue -foreground "#000020"
+    filter hexdata   -hide 1 -background LightBlue -foreground "#000080"
+    filter asciidata -hide 1 -background LightBlue -foreground "#000080"
+}

All output will show the eCos network device, for example +eth0, and the direction relative to the eCos +application. Some of the filters will show packet headers, for example +ether gives details of the ethernet packet header +and tcp gives information about TCP headers such as +whether or not the SYN flag is set. The TCP and UDP filters will also +show source and destination addresses, using numerical addresses and +if possible host names. However, host names will only be shown if the +host appears in /etc/hosts: doing full DNS +lookups while the data is being captured would add significantly to +complexity and overhead. The hexdata and +asciidata filters show the remainder of the packets +after the ethernet, IP and TCP or UDP headers have been stripped. +

Some of the filters will provide raw dumps of some of the packet data. +Showing up to 1500 bytes of data for each packet would be expensive, +and often the most interesting information is near the start of the +packet. Therefore it is possible to set a limit on the number of bytes +that will be shown using the target definition file. The default limit +is 64 bytes. +

synth_device ethernet {
+    …
+    max_show 128
+}

User Interface Additions

When running in graphical mode the ethernet script extends the user +interface in two ways: a button is added to the toolbar so that users +can enable or disable packet logging; and an entry is added to the +Help menu for the ethernet-specific documentation. +

Command Line Arguments

The synthetic target ethernet support does not use any command line +arguments. All configuration is handled through the target definition +file. +

Hooks

The ethernet support defines two hooks that can be used by other +scripts, especially user scripts: ethernet_tx and +ethernet_rx. The tx hook is called whenever eCos +tries to transmit a packet. The rx hook is called whenever an incoming +packet is passed to the eCos application. Note that this may be a +little bit after the packet was actually received by the I/O auxiliary +since it can buffer some packets. Both hooks are called with two +arguments, the name of the network device and the packet being +transferred. Typical usage might look like: +

  proc my_tx_hook { arg_list } {
+    set dev [lindex $arg_list 0]
+    incr ::my_ethernet_tx_packets($dev)
+    incr ::my_ethernet_tx_bytes($dev) [string length [lindex $arg_list 1]]
+  }
+  proc my_rx_hook { arg_list } {
+    set dev [lindex $arg_list 0]
+    incr ::my_ethernet_rx_packets($dev)
+    incr ::my_ethernet_rx_bytes($dev) [string length [lindex $arg_list 1]]
+  }
+  synth::hook_add "ethernet_tx" my_tx_hook
+  synth::hook_add "ethernet_rx" my_rx_hook

The global arrays my_ethernet_tx_packets etc. will +now be updated whenever there is ethernet traffic. Other code, +probably running at regular intervals by use of the Tcl +after procedure, can then use this information to +update a graphical monitor of some sort. +

Additional Tcl Procedures

The ethernet support provides one additional Tcl procedure that can be +used by other scripts; +

ethernet::devices_get_list    

This procedure returns a list of the ethernet devices that have been +instantiated, for example {eth0 eth1}. +

\ No newline at end of file diff --git a/packages/devs/eth/synth/ecosynth/current/doc/makefile b/packages/devs/eth/synth/ecosynth/current/doc/makefile new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/doc/makefile @@ -0,0 +1,34 @@ +#============================================================================= +# +# makefile +# +# For building the synthetic target ethernet package documentation +# +#============================================================================= +#####COPYRIGHTBEGIN#### +# +# =============================================================== +# Copyright (C) 2002 Bart Veer +# This material may be distributed only subject to the terms +# and conditions set forth in the Open Publication License, v1.0 +# or later (the latest version is presently available at +# http://www.opencontent.org/openpub/) +# =============================================================== +# +#####COPYRIGHTEND#### +#============================================================================= +#####DESCRIPTIONBEGIN#### +# +# Author(s): bartv +# Date: 2002-08-20 +#####DESCRIPTIONEND#### +#============================================================================= + +TOPLEVEL := ../../../../../.. +MAIN_SGML := syntheth.sgml +MAIN_HTML := devs-eth-synth.html +MAIN_PDF := devs-eth-synth.pdf +OTHER_SGML := +PICTURES := + +include $(TOPLEVEL)/pkgconf/rules.doc diff --git a/packages/devs/eth/synth/ecosynth/current/doc/overview.fig b/packages/devs/eth/synth/ecosynth/current/doc/overview.fig new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/doc/overview.fig @@ -0,0 +1,54 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 1500 300 1500 1500 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 2400 300 2400 1500 +2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 + 300 300 3000 300 3000 1500 300 1500 300 300 +2 2 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 + 3600 300 6000 300 6000 1500 3600 1500 3600 300 +2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 + 4800 300 4800 1500 +2 1 0 1 0 7 50 0 -1 4.000 0 0 7 1 1 2 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 + 3000 900 3600 900 +2 1 0 1 0 7 50 0 -1 4.000 0 0 7 1 1 2 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 + 6000 1050 6600 1050 +2 1 0 1 0 7 50 0 -1 4.000 0 0 7 1 1 2 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 + 7500 450 8100 450 +2 1 0 1 0 7 50 0 -1 4.000 0 0 7 1 1 2 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 + 7500 1050 8100 1050 +2 2 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 + 6600 900 7500 900 7500 1200 6600 1200 6600 900 +2 2 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 + 6600 300 7500 300 7500 600 6600 600 6600 300 +2 1 0 1 0 7 50 0 -1 4.000 0 0 7 1 1 2 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 + 6000 450 6600 450 +4 0 0 50 0 0 12 0.0000 4 180 825 375 1200 application\001 +4 0 0 50 0 0 12 0.0000 4 135 390 600 900 eCos\001 +4 0 0 50 0 0 12 0.0000 4 135 540 1650 900 TCP/IP\001 +4 0 0 50 0 0 12 0.0000 4 135 330 2550 675 eth0\001 +4 0 0 50 0 0 12 0.0000 4 135 330 2550 1200 eth1\001 +4 0 0 50 0 0 12 0.0000 4 180 975 3675 900 I/O Auxiliary\001 +4 0 0 50 0 0 12 0.0000 4 135 870 4950 900 ethernet.tcl\001 +4 0 0 50 0 0 12 0.0000 4 135 330 8175 525 eth1\001 +4 0 0 50 0 0 12 0.0000 4 180 330 8175 1125 tap3\001 +4 0 0 50 0 0 12 0.0000 4 135 675 6675 1125 rawether\001 +4 0 0 50 0 0 12 0.0000 4 135 675 6675 525 rawether\001 diff --git a/packages/devs/eth/synth/ecosynth/current/doc/overview.gif b/packages/devs/eth/synth/ecosynth/current/doc/overview.gif new file mode 100644 index 0000000000000000000000000000000000000000..d404959783366417f0eafc180c0d2bae6d8182d3 GIT binary patch literal 1581 zc$@((2GaRQNk%v~VI%@l0Du4h00030|Nkri0000a0#X0~0{)DTsmtvTqnxzbi?iOm z`wxcVNMgW=rs~SJ?hD8AOxO1PmI}`I{tpbYbP1ucMI-@|%w03HY(|;WC)N6_61CU} zw|n`5L*ntGEJBmbIyGD4{>0hyx6_`+JL(+%#;*qf7`T^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fC9AfRds1~aI z18loG9}T~F#5WdkkCtg&5YQH+#64(k8?;a%Yr(pM9WsxMT%^hzsYggIOpcOtVazxW4pC}tiOJBnAnamVg);5XF+r^Tb zRn+D+NtsLpjgy?tjN>=cIZSuvlAYaz+h-`Lnt7U%p2y@TE~DAZYI;bZqaq|f37R2< fhRLAxROo>c{0PyAO4K-6n5acB3Q>Pfpa1|nKLHXz diff --git a/packages/devs/eth/synth/ecosynth/current/doc/syntheth.sgml b/packages/devs/eth/synth/ecosynth/current/doc/syntheth.sgml new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/doc/syntheth.sgml @@ -0,0 +1,506 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Synthetic Target Ethernet Driver + + + Synthetic Target Ethernet Support + Allow synthetic target applications to perform ethernet I/O + + + Overview + +The synthetic target ethernet package can provide up to four network +devices, eth0 to eth3. These can +be used directly by the eCos application or, more commonly, by a +TCP/IP stack that is linked with the eCos application. Each eCos +device can be mapped on to a real Linux network device. For example, +if the Linux PC has two ethernet cards and eth1 is +not currently being used by Linux itself, then one of the eCos devices +can be mapped on to this Linux device. Alternatively, it is possible +to map some or all of the eCos devices on to the ethertap support +provided by the Linux kernel. + + +The ethernet package depends on the I/O auxiliary provided by the +synthetic target architectural HAL package. During initialization the +eCos application will attempt to instantiate the desired devices, by +sending a request to the auxiliary. This will load a Tcl script +ethernet.tcl that is responsible for handling the +instantiation request and subsequent I/O operations, for example +transmitting an ethernet packet. However, some of the low-level I/O +operations cannot conveniently be done by a Tcl script so +ethernet.tcl will actually run a separate program +rawether to interact with the Linux network device. + + + + + + + + + +On the target-side there are configuration options to control which +network devices should be present. For many applications a single +device will be sufficient, but if the final eCos application is +something like a network bridge then the package can support multiple +devices. On the host-side each eCos network device needs to be mapped +on to a Linux one, either a real ethernet device or an ethertap +device. This is handled by an entry in the target definition file: + + +synth_device ethernet { + eth0 real eth1 + eth1 ethertap tap3 00:01:02:03:FE:05 + … +} + + +The ethernet package also comes with support for packet logging, +and provides various facilities for use by user Tcl scripts. + + + + Installation + +Before a synthetic target eCos application can access ethernet devices +it is necessary to build and install host-side support. The relevant +code resides in the host +subdirectory of the synthetic target ethernet package, and building it +involves the standard configure, +make and make install steps. +The build involves a new executable rawether which +must be able to access a raw Linux network device. This is achieved by +installing it suid root, so the make install step +has to be run with superuser privileges. + + +Installing rawether suid root introduces a +potential security problem. Although normally +rawether is executed only by the I/O auxiliary, +theoretically it can be run by any program. Effectively it gives any +user the ability to monitor all ethernet traffic and to inject +arbitrary packets into the network. Also, as with any suid root +programs there may be as yet undiscovered exploits. Users and system +administrators should consider the risks before running make +install. + + +There are two main ways of building the host-side software. It is +possible to build both the generic host-side software and all +package-specific host-side software, including the ethernet support, +in a single build tree. This involves using the +configure script at the toplevel of the eCos +repository. For more information on this, see the +README.host file at the top of the repository. +Note that if you have an existing build tree which does not include +the synthetic target ethernet support then it will be necessary to +rerun the toplevel configure script: the search for appropriate +packages happens at configure time. + + +The alternative is to build just the host-side for this package. +This requires a separate build directory, building directly in the +source tree is disallowed. The configure options +are much the same as for a build from the toplevel, and the +README.host file can be consulted for more +details. It is essential that the ethernet support be configured with +the same option as other eCos host-side +software, especially the I/O auxiliary provided by the architectural +synthetic target HAL package, otherwise the I/O auxiliary will be +unable to locate the ethernet support. + + + + Target-side Configuration Options + +The target-side code can be configured to support up to four ethernet +devices, eth0 to eth3. By +default eth0 is enabled if the configuration +includes a TCP/IP stack, otherwise it is disabled. The other three +devices are always disabled by default. If any of the devices are +enabled then there will also be the usual configuration options +related to building this package. Other options related to network +devices, for example whether or not to use DHCP, are provided by +the generic network device package. + + + + Real Ethernet + +One obvious way of providing a synthetic target eCos application with +ethernet I/O is to use a real ethernet device in the PC: transmitted +packets go out on a real network, and packets on the network addressed +to the right MAC address are passed on to eCos. This way synthetic +target networking behaves just like networking on a real target with +ethernet hardware. For example, if there is a DHCP server anywhere on +the network then eCos will be able to contact it during networking +startup and get hold of IP address information. + + +Configuring the ethernet support to use a real ethernet device +requires a simple entry in the target definition file: + + +synth_device ethernet { + <eCos device> real <linux device> + … +} + + +For example, to map the eCos network device eth0 to +the Linux device eth1: + + +synth_device ethernet { + eth0 real eth1 + … +} + + +It is not possible for an ethernet device to be shared by both the +eCos TCP/IP stack and the Linux one: there would be no simple way to +work out which stack incoming packets are intended for. In theory +it might be possible to do some demultiplexing using distinct IP +addresses, but it would be impossible to support some functionality +such as DHCP. Therefore the rawether program will +refuse to access any ethernet device already in use. On a typical +Linux system eth0 will be used for Linux +networking, and the PC will have to be equipped with additional +ethernet devices for use by eCos. + + +The rawether program will access the hardware via +the appropriate Linux device driver, so it is important that the +system is set up such that the relevant module will be automatically +loaded or is already loaded. The details of this will depend on the +installed distribution and version, but typically it will involve an +entry in /etc/modules.conf. + + + + Ethertap + +The Linux kernel's ethertap facility provides a virtual network +interface. A Linux application, for example the +rawether program, can open a special character +device /dev/net/tun, perform various +ioctl calls, and then write +and read ethernet packets. When the device is +opened the Linux kernel automatically creates a new network interface, +for example tap0. The Linux TCP/IP stack can be +made to use this network interface like any other interface, receiving +and transmitting ethernet packets. The net effect is a virtual network +connecting just the Linux and eCos TCP/IP stacks, with no other nodes +attached. By default all traffic remains inside this virtual network +and is never forwarded to a real network. + + +Support for the ethertap facility may or may not be provided +automatically, depending on your Linux distribution and version. If +your system does not have a device /dev/net/tun +or a module tun.o then the appropriate kernel +documentation should be consulted, for example +/usr/src/linux-2.4/Documentation/networking/tuntap.txt. + + +The target definition file is used to map eCos network devices on to +ethertap devices. The simplest usage is: + + +synth_device ethernet { + eth0 ethertap + … +} + + +The Linux kernel will automatically allocate the next available tap +network interface. Usually this will be tap0 but if +other software is using the ethertap facility, for example to +implement a VPN, then a different number may be allocated. Usually it +will be better to specify the particular tap device that should be +used for each eCos device, for example: + + +synth_device ethernet { + eth0 ethertap tap3 + eth1 ethertap tap4 + … +} + + +The user now knows exactly which eCos device is mapped onto which +Linux device, avoiding much potential confusion. Because the virtual +devices are emulated ethernet devices, they require MAC addresses. +There is no physical hardware to provide these addresses, so normally +MAC addresses will be invented. That means that each time the eCos +application is run it will have different MAC addresses, which makes +it more difficult to compare the results of different runs. To get +more deterministic behaviour it is possible to specify the MAC +addresses in the target definition file: + + +synth_device ethernet { + eth0 ethertap tap3 00:01:02:03:FE:05 + eth1 ethertap tap4 00:01:02:03:FE:06 + … +} + + +During the initialization phase the eCos application will instantiate +the various network devices. This will cause the I/O auxiliary to load +the ethernet.tcl script and spawn +rawether processes, which in turn will +open /dev/net/tun and +perform the appropriate ioctl calls. On the Linux +side there will now be new network interfaces such as +tap3, and these can be configured like any other +network interface using commands such as ifconfig. +In addition, if the Linux system is set up with hotplug support then +it may be possible to arrange for the network interface to become +active automatically. On a Red Hat Linux system this would require +files such as +/etc/sysconfig/network-scripts/ifcfg-tap3, +containing data like: + + +DEVICE="tap3" +BOOTPROTO="none" +BROADCAST=10.2.2.255 +IPADDR="10.2.2.1" +NETMASK="255.255.255.0" +NETWORK=10.2.2.0 +ONBOOT="no" + + +This gives the Linux interface the address 10.2.2.1 +on the network 10.2.2.0. The eCos network device +should be configured with a compatible address. One way of doing this +would be to enable CYGHWR_NET_DRIVER_ETH0_ADDRS, +set CYGHWR_NET_DRIVER_ETH0_ADDRS_IP to +10.2.2.2, and similarly update the +NETMASK, BROADCAST, +GATEWAY and SERVER configuration +options. + + +It should be noted that the ethertap facility provides a virtual +network, and any packets transmitted by the eCos application will +not appear on a real network. Therefore usually there will no +accessible DHCP server, and eCos cannot use DHCP or BOOTP to obtain IP +address information. Instead the eCos configuration should use manual +or static addresses. + + +An alternative approach would be to set up the Linux box as a network +bridge, using commands like brctl to connect the +virtual network interface tap3 to a physical +network interface such as eth0. Any packets sent by +the eCos application will get forwarded automatically to the real +network, and some packets on the real network will get forwarded over +the virtual network to the eCos application. Note that the eCos +application might also get some packets that were not intended for it, +but usually those will just be discarded by the eCos TCP/IP stack. The +exact details of setting up a network bridge are left as an exercise +to the reader. + + + + Packet Logging + +The ethernet support comes with support for logging the various +packets that are transferred, including a simple protocol analyser. +This generates simple text output using the filter mechanisms provided +by the I/O auxiliary, so it is possible to control the appearance and +visibility of different types of output. For example the user might +want to see IPv4 headers and all ICMPv4 and ARP operations, but not +TCP headers or any of the packet data. + + +The protocol analyser is not intended to be a fully functional +analyser with knowledge of many different TCP/IP protocols, advanced +search facilities, graphical traffic displays, and so on. +Functionality like that is already provided by other tools such as +ethereal and +tcpdump. Achieving similar levels of +functionality would require a lot of work, for very little gain. It is +still useful to have some protocol analysis functionality available +because the output will be interleaved with other output, for example +printf calls from the application. That may make +it easier to understand the sequence of events. + + +One problem with logging ethernet traffic is that it can involve very +large amounts of data. If the application is expected to run for a +long time or is very I/O intensive then it is easy to end up with many +megabytes. When running in graphical mode all the logging data will be +held in memory, even data that is not currently visible. At some point +the system will begin to run low on memory and performance will +suffer. To avoid problems, the ethernet script maintains a flag that +controls whether or not packet logging is active. The default is to +run with logging disabled, but this can be changed in the target +definition file: + + +synth_device ethernet { + … + logging 1 +} + + +The ethernet script will add a toolbar button that allows this flag to +be changed at run-time, allowing the user to capture traffic for +certain periods of time while the application continues running. + + +The target definition file can contain the following entries for the +various packet logging filters: + + +synth_device ethernet { + … + filter ether -hide 0 -background LightBlue -foreground "#000080" + filter arp -hide 0 -background LightBlue -foreground "#000050" + filter ipv4 -hide 0 -background LightBlue -foreground "#000040" + filter ipv6 -hide 1 -background LightBlue -foreground "#000040" + filter icmpv4 -hide 0 -background LightBlue -foreground "#000070" + filter icmpv6 -hide 1 -background LightBlue -foreground "#000070" + filter udp -hide 0 -background LightBlue -foreground "#000030" + filter tcp -hide 0 -background LightBlue -foreground "#000020" + filter hexdata -hide 1 -background LightBlue -foreground "#000080" + filter asciidata -hide 1 -background LightBlue -foreground "#000080" +} + + +All output will show the eCos network device, for example +eth0, and the direction relative to the eCos +application. Some of the filters will show packet headers, for example +ether gives details of the ethernet packet header +and tcp gives information about TCP headers such as +whether or not the SYN flag is set. The TCP and UDP filters will also +show source and destination addresses, using numerical addresses and +if possible host names. However, host names will only be shown if the +host appears in /etc/hosts: doing full DNS +lookups while the data is being captured would add significantly to +complexity and overhead. The hexdata and +asciidata filters show the remainder of the packets +after the ethernet, IP and TCP or UDP headers have been stripped. + + +Some of the filters will provide raw dumps of some of the packet data. +Showing up to 1500 bytes of data for each packet would be expensive, +and often the most interesting information is near the start of the +packet. Therefore it is possible to set a limit on the number of bytes +that will be shown using the target definition file. The default limit +is 64 bytes. + + +synth_device ethernet { + … + max_show 128 +} + + + + User Interface Additions + +When running in graphical mode the ethernet script extends the user +interface in two ways: a button is added to the toolbar so that users +can enable or disable packet logging; and an entry is added to the +Help menu for the ethernet-specific documentation. + + + + Command Line Arguments + +The synthetic target ethernet support does not use any command line +arguments. All configuration is handled through the target definition +file. + + + + Hooks + +The ethernet support defines two hooks that can be used by other +scripts, especially user scripts: ethernet_tx and +ethernet_rx. The tx hook is called whenever eCos +tries to transmit a packet. The rx hook is called whenever an incoming +packet is passed to the eCos application. Note that this may be a +little bit after the packet was actually received by the I/O auxiliary +since it can buffer some packets. Both hooks are called with two +arguments, the name of the network device and the packet being +transferred. Typical usage might look like: + + + proc my_tx_hook { arg_list } { + set dev [lindex $arg_list 0] + incr ::my_ethernet_tx_packets($dev) + incr ::my_ethernet_tx_bytes($dev) [string length [lindex $arg_list 1]] + } + proc my_rx_hook { arg_list } { + set dev [lindex $arg_list 0] + incr ::my_ethernet_rx_packets($dev) + incr ::my_ethernet_rx_bytes($dev) [string length [lindex $arg_list 1]] + } + synth::hook_add "ethernet_tx" my_tx_hook + synth::hook_add "ethernet_rx" my_rx_hook + + +The global arrays my_ethernet_tx_packets etc. will +now be updated whenever there is ethernet traffic. Other code, +probably running at regular intervals by use of the Tcl +after procedure, can then use this information to +update a graphical monitor of some sort. + + + + Additional Tcl Procedures + +The ethernet support provides one additional Tcl procedure that can be +used by other scripts; + + +ethernet::devices_get_list + + +This procedure returns a list of the ethernet devices that have been +instantiated, for example {eth0 eth1}. + + + + diff --git a/packages/devs/eth/synth/ecosynth/current/host/Makefile.am b/packages/devs/eth/synth/ecosynth/current/host/Makefile.am new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/host/Makefile.am @@ -0,0 +1,91 @@ +## Process this file with automake to produce Makefile.in +## ===================================================================== +## +## Makefile.am +## +## Build support for the host-side synthetic target support, +## the ethernetpackage. +## +## ===================================================================== +######COPYRIGHTBEGIN#### +# +# ---------------------------------------------------------------------------- +# Copyright (C) 2002 Bart Veer +# +# This file is part of the eCos synthetic target ethernet support. +# +# This program 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 of the License, or (at your option) +# any later version. +# +# This program 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 +# this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# ---------------------------------------------------------------------------- +# +######COPYRIGHTEND#### +## ===================================================================== +#######DESCRIPTIONBEGIN#### +## +## Author(s): bartv +## Contact(s): bartv +## Date: 2002/08/07 +## Version: 0.01 +## +######DESCRIPTIONEND#### +## ===================================================================== + +AUTOMAKE_OPTIONS = 1.3 foreign + +## Only some platforms are supported. Having the configure script throw +## an error when attempting to configure on an unsupported platform +## would be a mistake, since that would prevent any configury from +## the toplevel on unsupported platforms. Instead an automake conditional +## is used, leading to null makefiles on unsupported platforms. + +if SUPPORTED + +AM_CFLAGS = @ecos_CFLAGS@ -DECOSYNTH_VERSION=\"@VERSION@\" \ + -DECOS_REPOSITORY=\"@ECOS_REPOSITORY@\" \ + -DLIBEXECDIR=\"$(libexecdir)\" \ + -DPACKAGE_DIR=\"@PACKAGE_DIR@\" \ + -DPACKAGE_VERSION=\"@PACKAGE_VERSION@\" \ + -DPACKAGE_INSTALL=\"@PACKAGE_INSTALL@\" +AM_CXXFLAGS = @ecos_CXXFLAGS@ +INCLUDES = @ecos_INCLUDES@ +LIBS = @ecos_LIBS@ @ecos_LDADD@ + +## The synthetic target support consists of a single program rawether, +## a number of Tcl scripts, and some additional data files. These are +## all installed in a single directory $(libexec)/ecos/_/ +## Neither the rawether executable nor any of the scripts are directly +## executable, instead rawether gets fork()'d/execve()'d by the Tcl +## script so $(libexec) is appropriate. Strictly speaking the +## Tcl scripts and data files are architecture-independent so should +## probably be installed in an analogous directory below $(datadir), +## but that would add more directories for little real gain. The scripts +## are treated as data files since they should not be executed directly, +## i.e. they should not be installed with the execute bit set. + +etherdir = $(libexecdir)/ecos/@PACKAGE_INSTALL@ +ether_PROGRAMS = rawether +ether_DATA = ethernet.tcl ethernet.tdf netrecord.xbm + +rawether_SOURCES = rawether.c + +## Manual dependencies +rawether.$(OBJEXT) : Makefile ../src/protocol.h + +## The rawether program needs to run with root privileges, or it will +## be unable to access the ethernet hardware. +install-data-hook: + chown root $(etherdir)/rawether + chmod u+s $(etherdir)/rawether + +endif diff --git a/packages/devs/eth/synth/ecosynth/current/host/Makefile.in b/packages/devs/eth/synth/ecosynth/current/host/Makefile.in new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/host/Makefile.in @@ -0,0 +1,450 @@ +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +######COPYRIGHTBEGIN#### +# +# ---------------------------------------------------------------------------- +# Copyright (C) 2002 Bart Veer +# +# This file is part of the eCos synthetic target ethernet support. +# +# This program 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 of the License, or (at your option) +# any later version. +# +# This program 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 +# this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# ---------------------------------------------------------------------------- +# +######COPYRIGHTEND#### +#######DESCRIPTIONBEGIN#### +######DESCRIPTIONEND#### + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +CC = @CC@ +CXX = @CXX@ +ECOS_REPOSITORY = @ECOS_REPOSITORY@ +EXEEXT = @EXEEXT@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MSVC_SRCDIR = @MSVC_SRCDIR@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_DIR = @PACKAGE_DIR@ +PACKAGE_INSTALL = @PACKAGE_INSTALL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +VERSION = @VERSION@ +ecos_CFLAGS = @ecos_CFLAGS@ +ecos_CXXFLAGS = @ecos_CXXFLAGS@ +ecos_INCLUDES = @ecos_INCLUDES@ +ecos_LDADD = @ecos_LDADD@ +ecos_LIBS = @ecos_LIBS@ +ecos_infra_incdir = @ecos_infra_incdir@ +ecos_infra_libdir = @ecos_infra_libdir@ +ecos_libcdl_incdir = @ecos_libcdl_incdir@ +ecos_libcdl_libdir = @ecos_libcdl_libdir@ +ecos_tk_libs = @ecos_tk_libs@ + +AUTOMAKE_OPTIONS = 1.3 foreign + +@SUPPORTED_TRUE@AM_CFLAGS = @SUPPORTED_TRUE@@ecos_CFLAGS@ -DECOSYNTH_VERSION=\"@VERSION@\" \ +@SUPPORTED_TRUE@ -DECOS_REPOSITORY=\"@ECOS_REPOSITORY@\" \ +@SUPPORTED_TRUE@ -DLIBEXECDIR=\"$(libexecdir)\" \ +@SUPPORTED_TRUE@ -DPACKAGE_DIR=\"@PACKAGE_DIR@\" \ +@SUPPORTED_TRUE@ -DPACKAGE_VERSION=\"@PACKAGE_VERSION@\" \ +@SUPPORTED_TRUE@ -DPACKAGE_INSTALL=\"@PACKAGE_INSTALL@\" +@SUPPORTED_TRUE@AM_CXXFLAGS = @SUPPORTED_TRUE@@ecos_CXXFLAGS@ +@SUPPORTED_TRUE@INCLUDES = @SUPPORTED_TRUE@@ecos_INCLUDES@ +@SUPPORTED_TRUE@LIBS = @SUPPORTED_TRUE@@ecos_LIBS@ @ecos_LDADD@ + +@SUPPORTED_TRUE@etherdir = @SUPPORTED_TRUE@$(libexecdir)/ecos/@PACKAGE_INSTALL@ +@SUPPORTED_TRUE@ether_PROGRAMS = @SUPPORTED_TRUE@rawether +@SUPPORTED_TRUE@ether_DATA = @SUPPORTED_TRUE@ethernet.tcl ethernet.tdf netrecord.xbm + +@SUPPORTED_TRUE@rawether_SOURCES = @SUPPORTED_TRUE@rawether.c +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../../../../acsupport/mkinstalldirs +CONFIG_CLEAN_FILES = +@SUPPORTED_TRUE@ether_PROGRAMS = rawether$(EXEEXT) +PROGRAMS = $(ether_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +@SUPPORTED_TRUE@rawether_OBJECTS = rawether.$(OBJEXT) +rawether_LDADD = $(LDADD) +rawether_DEPENDENCIES = +rawether_LDFLAGS = +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DATA = $(ether_DATA) + +DIST_COMMON = Makefile.am Makefile.in acinclude.m4 aclocal.m4 configure \ +configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +DEP_FILES = .deps/rawether.P +SOURCES = $(rawether_SOURCES) +OBJECTS = $(rawether_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .obj .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 + cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +mostlyclean-etherPROGRAMS: + +clean-etherPROGRAMS: + -test -z "$(ether_PROGRAMS)" || rm -f $(ether_PROGRAMS) + +distclean-etherPROGRAMS: + +maintainer-clean-etherPROGRAMS: + +install-etherPROGRAMS: $(ether_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(etherdir) + @list='$(ether_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(etherdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(etherdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +uninstall-etherPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(ether_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(etherdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +rawether$(EXEEXT): $(rawether_OBJECTS) $(rawether_DEPENDENCIES) + @rm -f rawether$(EXEEXT) + $(LINK) $(rawether_LDFLAGS) $(rawether_OBJECTS) $(rawether_LDADD) $(LIBS) + +install-etherDATA: $(ether_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(etherdir) + @list='$(ether_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(etherdir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(etherdir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(etherdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(etherdir)/$$p; \ + fi; fi; \ + done + +uninstall-etherDATA: + @$(NORMAL_UNINSTALL) + list='$(ether_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(etherdir)/$$p; \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-etherPROGRAMS install-etherDATA + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-etherPROGRAMS uninstall-etherDATA +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) $(DATA) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(etherdir) $(DESTDIR)$(etherdir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-etherPROGRAMS mostlyclean-compile \ + mostlyclean-tags mostlyclean-depend mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-etherPROGRAMS clean-compile clean-tags clean-depend \ + clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-etherPROGRAMS distclean-compile distclean-tags \ + distclean-depend distclean-generic clean-am + +distclean: distclean-am + -rm -f config.status + +maintainer-clean-am: maintainer-clean-etherPROGRAMS \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-depend maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + -rm -f config.status + +.PHONY: mostlyclean-etherPROGRAMS distclean-etherPROGRAMS \ +clean-etherPROGRAMS maintainer-clean-etherPROGRAMS \ +uninstall-etherPROGRAMS install-etherPROGRAMS mostlyclean-compile \ +distclean-compile clean-compile maintainer-clean-compile \ +uninstall-etherDATA install-etherDATA tags mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir \ +mostlyclean-depend distclean-depend clean-depend \ +maintainer-clean-depend info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +@SUPPORTED_TRUE@rawether.$(OBJEXT) : Makefile ../src/protocol.h + +@SUPPORTED_TRUE@install-data-hook: +@SUPPORTED_TRUE@ chown root $(etherdir)/rawether +@SUPPORTED_TRUE@ chmod u+s $(etherdir)/rawether + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/packages/devs/eth/synth/ecosynth/current/host/acinclude.m4 b/packages/devs/eth/synth/ecosynth/current/host/acinclude.m4 new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/host/acinclude.m4 @@ -0,0 +1,45 @@ +dnl Process this file with aclocal to get an aclocal.m4 file. Then +dnl process that with autoconf. +dnl ==================================================================== +dnl +dnl acinclude.m4 +dnl +dnl ==================================================================== +dnl####COPYRIGHTBEGIN#### +dnl +dnl ---------------------------------------------------------------------------- +dnl Copyright (C) 2002 Bart Veer +dnl +dnl This file is part of the eCos host tools. +dnl +dnl This program is free software; you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License as published by the Free +dnl Software Foundation; either version 2 of the License, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but WITHOUT +dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +dnl more details. +dnl +dnl You should have received a copy of the GNU General Public License along with +dnl this program; if not, write to the Free Software Foundation, Inc., +dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +dnl ---------------------------------------------------------------------------- +dnl +dnl####COPYRIGHTEND#### +dnl ==================================================================== +dnl#####DESCRIPTIONBEGIN#### +dnl +dnl Author(s): bartv +dnl Contact(s): bartv +dnl Date: 2002/08/07 +dnl Version: 0.01 +dnl +dnl####DESCRIPTIONEND#### +dnl ==================================================================== + +dnl Access shared macros. +dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not +dnl incorporate the macro into aclocal.m4 +sinclude(../../../../../../../acsupport/acinclude.m4) diff --git a/packages/devs/eth/synth/ecosynth/current/host/aclocal.m4 b/packages/devs/eth/synth/ecosynth/current/host/aclocal.m4 new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/host/aclocal.m4 @@ -0,0 +1,183 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4-p5 + +dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl Process this file with aclocal to get an aclocal.m4 file. Then +dnl process that with autoconf. +dnl ==================================================================== +dnl +dnl acinclude.m4 +dnl +dnl ==================================================================== +dnl####COPYRIGHTBEGIN#### +dnl +dnl ---------------------------------------------------------------------------- +dnl Copyright (C) 2002 Bart Veer +dnl +dnl This file is part of the eCos host tools. +dnl +dnl This program is free software; you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License as published by the Free +dnl Software Foundation; either version 2 of the License, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but WITHOUT +dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +dnl more details. +dnl +dnl You should have received a copy of the GNU General Public License along with +dnl this program; if not, write to the Free Software Foundation, Inc., +dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +dnl ---------------------------------------------------------------------------- +dnl +dnl####COPYRIGHTEND#### +dnl ==================================================================== +dnl#####DESCRIPTIONBEGIN#### +dnl +dnl Author(s): bartv +dnl Contact(s): bartv +dnl Date: 2002/08/07 +dnl Version: 0.01 +dnl +dnl####DESCRIPTIONEND#### +dnl ==================================================================== + +dnl Access shared macros. +dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not +dnl incorporate the macro into aclocal.m4 +sinclude(../../../../../../../acsupport/acinclude.m4) + +# Define a conditional. + +AC_DEFUN([AM_CONDITIONAL], +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN([AM_MISSING_PROG], +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + diff --git a/packages/devs/eth/synth/ecosynth/current/host/configure b/packages/devs/eth/synth/ecosynth/current/host/configure new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/host/configure @@ -0,0 +1,2013 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" +ac_help="$ac_help + --enable-debug do a debug rather than a release build" +ac_help="$ac_help + --enable-ansi do an ANSI rather than a unicode build" +ac_help="$ac_help + --with-tcl-version= version of Tcl to be used" +ac_help="$ac_help + --with-tcl-header= location of Tcl header" +ac_help="$ac_help + --with-tcl-lib= location of Tcl libraries" +ac_help="$ac_help + --with-tcl= location of Tcl header and libraries" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=rawether.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../../../../../acsupport $srcdir/../../../../../../../acsupport; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../../../../../acsupport $srcdir/../../../../../../../acsupport" 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + + + echo $ac_n "checking that a separate build tree is being used""... $ac_c" 1>&6 +echo "configure:563: checking that a separate build tree is being used" >&5 + ecos_cwd=`/bin/pwd` + if test "${srcdir}" = "." ; then + srcdir=${ecos_cwd} + fi + if test "${ecos_cwd}" = "${srcdir}" ; then + echo "$ac_t""no" 1>&6 + { echo "configure: error: This configure script should not be run inside the source tree. Instead please use a separate build tree" 1>&2; exit 1; } + else + echo "$ac_t""yes" 1>&6 + fi + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:582: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:614: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:667: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:724: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=eCos_synthetic_target_ethernet + +VERSION=0.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi + + + +missing_dir=`cd $ac_aux_dir && pwd` +echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 +echo "configure:763: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:776: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:789: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:802: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:815: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:829: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +case "${host}" in + i[34567]86-*-linux-gnu* ) SUPPORTED="yes";; + * ) SUPPORTED="no" +esac + + +if test "${SUPPORTED}" = "yes"; then + SUPPORTED_TRUE= + SUPPORTED_FALSE='#' +else + SUPPORTED_TRUE='#' + SUPPORTED_FALSE= +fi + +if test "${SUPPORTED}" = "yes" ; then + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:870: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:900: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:951: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:983: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 994 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1025: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1030: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1058: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + + for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1094: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CXX="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CXX="$ac_cv_prog_CXX" +if test -n "$CXX"; then + echo "$ac_t""$CXX" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CXX" && break +done +test -n "$CXX" || CXX="gcc" + + +echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:1126: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 + +ac_ext=C +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cxx_cross + +cat > conftest.$ac_ext << EOF + +#line 1137 "configure" +#include "confdefs.h" + +int main(){return(0);} +EOF +if { (eval echo configure:1142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cxx_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cxx_cross=no + else + ac_cv_prog_cxx_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cxx_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 +if test $ac_cv_prog_cxx_works = no; then + { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1168: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 +cross_compiling=$ac_cv_prog_cxx_cross + +echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 +echo "configure:1173: checking whether we are using GNU C++" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gxx=yes +else + ac_cv_prog_gxx=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gxx" 1>&6 + +if test $ac_cv_prog_gxx = yes; then + GXX=yes +else + GXX= +fi + +ac_test_CXXFLAGS="${CXXFLAGS+set}" +ac_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS= +echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 +echo "configure:1201: checking whether ${CXX-g++} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.cc +if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then + ac_cv_prog_cxx_g=yes +else + ac_cv_prog_cxx_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS="$ac_save_CXXFLAGS" +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi + +for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat > conftest.$ac_ext < +$ac_declaration +int main() { +exit (42); +; return 0; } +EOF +if { (eval echo configure:1250: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + continue +fi +rm -f conftest* + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + + + echo $ac_n "checking for object suffix""... $ac_c" 1>&6 +echo "configure:1284: checking for object suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftest* +echo 'int i = 1;' > conftest.$ac_ext +if { (eval echo configure:1290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; + *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; + esac + done +else + { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_objext" 1>&6 +OBJEXT=$ac_cv_objext +ac_objext=$ac_cv_objext + + echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:1308: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:1341: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1372: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + + + ecos_CFLAGS="" + ecos_CXXFLAGS="" + ecos_LDADD="" + ecos_INCLUDES="" + ecos_LIBS="" + + + + + + + + + + + + echo $ac_n "checking "for Visual C++"""... $ac_c" 1>&6 +echo "configure:1420: checking "for Visual C++"" >&5 + MSVC="no"; + if test "${CC}" = "cl" ; then + MSVC="yes" + CXX="cl" + + + + if test "${MSVC}" = "yes" ; then + MSVC_SRCDIR=`cygpath -w ${MSVC_SRCDIR} | tr \\\\\\\\ /` + fi + + + ecos_INCLUDES="${ecos_INCLUDES} \"-I${msvc_srcdir}\"" + ecos_LDADD="-link" + ecos_LIBS="advapi32.lib" + fi + + +if test "${MSVC}" = "yes"; then + MSVC_TRUE= + MSVC_FALSE='#' +else + MSVC_TRUE='#' + MSVC_FALSE= +fi + if test "${MSVC}" = "yes" ; then + echo "$ac_t""unfortunately yes" 1>&6 + else + echo "$ac_t""no" 1>&6 + fi + + + + + + + + echo $ac_n "checking "the default compiler flags"""... $ac_c" 1>&6 +echo "configure:1459: checking "the default compiler flags"" >&5 + + ecosflags_enable_debug="no" + # Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + case "${enableval}" in + yes) ecosflags_enable_debug="yes" ;; + *) ecosflags_enable_debug="no" ;; + esac +fi + + + ecosflags_enable_ansi="no" + if test "${MSVC}" = "yes" ; then + # Check whether --enable-ansi or --disable-ansi was given. +if test "${enable_ansi+set}" = set; then + enableval="$enable_ansi" + case "${enableval}" in + yes) ecosflags_enable_ansi="yes" ;; + *) ecosflags_enable_ansi="no" ;; + esac +fi + + fi + + if test "${GCC}" = "yes" ; then + ecos_CFLAGS="${ecos_CFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs" + ecos_CXXFLAGS="${ecos_CXXFLAGS} -pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual" + elif test "${MSVC}" = "yes" ; then + ecos_CFLAGS="${ecos_CFLAGS} -nologo -W3" + ecos_CXXFLAGS="${ecos_CXXFLAGS} -nologo -W3 -GR -GX" + else + { echo "configure: error: "default flags for ${CC} are not known"" 1>&2; exit 1; } + fi + + if test "${ecosflags_enable_debug}" = "yes" ; then + if test "${GCC}" = "yes" ; then + ecos_CFLAGS="${ecos_CFLAGS} -g -O0" + ecos_CXXFLAGS="${ecos_CXXFLAGS} -g -O0" + elif test "${MSVC}" = "yes" ; then + ecos_CFLAGS="${ecos_CFLAGS} -MDd -Zi" + ecos_CXXFLAGS="${ecos_CXXFLAGS} -MDd -Zi" + fi + else + if test "${GCC}" = "yes" ; then + ecos_CFLAGS="${ecos_CFLAGS} -O0" + ecos_CXXFLAGS="${ecos_CXXFLAGS} -O0" + elif test "${MSVC}" = "yes" ; then + ecos_CFLAGS="${ecos_CFLAGS} -MD -O2" + ecos_CXXFLAGS="${ecos_CXXFLAGS} -MD -O2" + fi + fi + + CFLAGS="${ac_save_CFLAGS}" + CXXFLAGS="${ac_save_CXXFLAGS}" + + echo "$ac_t""done" 1>&6 + + + + + + + + ecos_tcl_version="" + ecos_tcl_incdir="" + ecos_tcl_libdir="" + ecos_tk_libs="" + + + echo $ac_n "checking for Tcl version""... $ac_c" 1>&6 +echo "configure:1531: checking for Tcl version" >&5 + # Check whether --with-tcl-version or --without-tcl-version was given. +if test "${with_tcl_version+set}" = set; then + withval="$with_tcl_version" + + ecos_tcl_version=${with_tcl_version} + +else + + if test "${MSVC}" = "yes" ; then + ecos_tcl_version=80 + elif test "${ac_cv_cygwin}" = "yes" ; then + ecos_tcl_version=80 + else + ecos_tcl_version="" + fi + +fi + + echo "$ac_t""${ecos_tcl_version}" 1>&6 + + echo $ac_n "checking for Tcl installation""... $ac_c" 1>&6 +echo "configure:1553: checking for Tcl installation" >&5 + + # Check whether --with-tcl-header or --without-tcl-header was given. +if test "${with_tcl_header+set}" = set; then + withval="$with_tcl_header" + : +fi + + # Check whether --with-tcl-lib or --without-tcl-lib was given. +if test "${with_tcl_lib+set}" = set; then + withval="$with_tcl_lib" + : +fi + + # Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + : +fi + + + + if test "${MSVC}" = "yes" ; then + + if test "${with_tcl_header+set}" = set ; then + ecos_tcl_incdir=${with_tcl_header} + elif test "${with_tcl+set}" = set ; then + ecos_tcl_incdir="${with_tcl}/include" + else + { echo "configure: error: You must specify a Tcl installation with either --with-tcl= or --with-tcl-header=" 1>&2; exit 1; } + fi + + if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then + { echo "configure: error: unable to locate Tcl header file tcl.h" 1>&2; exit 1; } + fi + ecos_msvc_tcl_incdir="${ecos_tcl_incdir}" + + + + if test "${MSVC}" = "yes" ; then + ecos_msvc_tcl_incdir=`cygpath -w ${ecos_msvc_tcl_incdir} | tr \\\\\\\\ /` + fi + + ecos_INCLUDES="${ecos_INCLUDES} \"-I${ecos_msvc_tcl_incdir}\"" + + if test "${with_tcl_lib+set}" = set; then + ecos_tcl_libdir=${with_tcl_lib} + elif test "${with_tcl+set}" = set; then + ecos_tcl_libdir="${with_tcl}/lib" + else + { echo "configure: error: You must specify a Tcl installation with either --with-tcl= or --with-tcl-lib=" 1>&2; exit 1; } + fi + + + + if test "${MSVC}" = "yes" ; then + ecos_tcl_libdir=`cygpath -w ${ecos_tcl_libdir} | tr \\\\\\\\ /` + fi + + ecos_LIBS="${ecos_LIBS} tcl${ecos_tcl_version}.lib" + ecos_LDADD="${ecos_LDADD} \"-libpath=${ecos_tcl_libdir}\"" + + ecos_tk_libs="" + + else + possibles="${with_tcl_header} ${with_tcl}/include ${prefix}/include /usr/include/tcl${ecos_tcl_version} /usr/include" + + ecos_tcl_incdir="" + for i in ${possibles}; do + if test -r "$i/"tcl.h""; then + ecos_tcl_incdir=$i + break + fi + done + + if test \! -r "${ecos_tcl_incdir}/tcl.h" ; then + { echo "configure: error: unable to locate Tcl header file tcl.h" 1>&2; exit 1; } + else + if test "${ecos_tcl_incdir}" != "/usr/include" ; then + ecos_INCLUDES="${ecos_INCLUDES} -I${ecos_tcl_incdir}" + fi + fi + possibles="${with_tcl_lib} ${with_tcl}/lib ${libdir} ${prefix}/lib /usr/lib/tcl$${ecos_tcl_version} /usr/lib" + + ecos_tcl_libdir="" + for i in ${possibles}; do + if test -r "$i/"tclConfig.sh""; then + ecos_tcl_libdir=$i + break + fi + done + + if test \! -r "${ecos_tcl_libdir}/tclConfig.sh" ; then + { echo "configure: error: unable to locate Tcl config file tclConfig.sh" 1>&2; exit 1; } + else + . ${ecos_tcl_libdir}/tclConfig.sh + ecos_LIBS="${ecos_LIBS} -ltcl${ecos_tcl_version} ${TCL_LIBS}" + fi + + possible_tk_libdir=`echo ${ecos_tcl_libdir} | sed -e 's,tcl,tk,'` + possibles="${ecos_tcl_libdir} ${possible_tk_libdir}" + + ecos_tk_libdir="" + for i in ${possibles}; do + if test -r "$i/"tkConfig.sh""; then + ecos_tk_libdir=$i + break + fi + done + + if test \! -r "${ecos_tk_libdir}/tkConfig.sh" ; then + { echo "configure: error: unable to locate Tk config file tkConfig.sh" 1>&2; exit 1; } + else + . ${ecos_tk_libdir}/tkConfig.sh + ecos_tk_libs="-ltk${ecos_tcl_version} ${TK_LIBS}" + for lib in ${TCL_LIBS} ; do + ecos_tk_libs=`echo ${ecos_tk_libs} | sed -e "s!${lib}!!"` + done + fi + fi + + echo "$ac_t""-I${ecos_tcl_incdir} -L${ecos_tcl_libdir}" 1>&6 + + + + if test "${TK_MAJOR_VERSION}" = "8" ; then + if test ${TK_MINOR_VERSION} -lt 3 ; then + { echo "configure: error: The synthetic target ethernet support requires at least version 8.3 of Tcl/Tk" 1>&2; exit 1; } + fi + fi + + + package_dir=`cd ${srcdir} && /bin/pwd` + PACKAGE_VERSION=`dirname ${package_dir}` + PACKAGE_VERSION=`basename ${PACKAGE_VERSION}` + + package_dir=`dirname ${package_dir}` + package_dir=`dirname ${package_dir}` + + possibles="${package_dir}/.. ${package_dir}/../.. ${package_dir}/../../.. ${package_dir}/../../../.." + possibles="${possibles} ${package_dir}/../../../../.. ${package_dir}/../../../../../.." + + repository_root="" + for i in ${possibles}; do + if test -d "$i/"acsupport""; then + repository_root=$i + break + fi + done + + if test "${repository_root}" = "" ; then + { echo "configure: error: Failed to identify this package's position within the eCos repository" 1>&2; exit 1; } + fi + ECOS_REPOSITORY=`cd "${repository_root}/packages/pkgconf/.." && /bin/pwd` + + PACKAGE_DIR=`echo ${package_dir} | sed -e "s:${ECOS_REPOSITORY}/::"` + + PACKAGE_INSTALL="${PACKAGE_DIR}/${PACKAGE_VERSION}" + + + + + + +fi + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile:Makefile.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@SUPPORTED_TRUE@%$SUPPORTED_TRUE%g +s%@SUPPORTED_FALSE@%$SUPPORTED_FALSE%g +s%@CC@%$CC%g +s%@CXX@%$CXX%g +s%@OBJEXT@%$OBJEXT%g +s%@EXEEXT@%$EXEEXT%g +s%@ecos_CFLAGS@%$ecos_CFLAGS%g +s%@ecos_CXXFLAGS@%$ecos_CXXFLAGS%g +s%@ecos_LDADD@%$ecos_LDADD%g +s%@ecos_INCLUDES@%$ecos_INCLUDES%g +s%@ecos_LIBS@%$ecos_LIBS%g +s%@MSVC_SRCDIR@%$MSVC_SRCDIR%g +s%@MSVC_TRUE@%$MSVC_TRUE%g +s%@MSVC_FALSE@%$MSVC_FALSE%g +s%@ecos_tk_libs@%$ecos_tk_libs%g +s%@ECOS_REPOSITORY@%$ECOS_REPOSITORY%g +s%@PACKAGE_DIR@%$PACKAGE_DIR%g +s%@PACKAGE_VERSION@%$PACKAGE_VERSION%g +s%@PACKAGE_INSTALL@%$PACKAGE_INSTALL%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/packages/devs/eth/synth/ecosynth/current/host/configure.in b/packages/devs/eth/synth/ecosynth/current/host/configure.in new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/host/configure.in @@ -0,0 +1,92 @@ +dnl Process this file with autoconf to produce a configure script. +dnl ==================================================================== +dnl +dnl configure.in +dnl +dnl configure script for eCos synthetic target ethernet +dnl host-side support +dnl +dnl ==================================================================== +dnl####COPYRIGHTBEGIN#### +dnl +dnl ---------------------------------------------------------------------------- +dnl Copyright (C) 2002 Bart Veer +dnl +dnl This file is part of the eCos synthetic target support. +dnl +dnl This program is free software; you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License as published by the Free +dnl Software Foundation; either version 2 of the License, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but WITHOUT +dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +dnl more details. +dnl +dnl You should have received a copy of the GNU General Public License along with +dnl this program; if not, write to the Free Software Foundation, Inc., +dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +dnl ---------------------------------------------------------------------------- +dnl +dnl####COPYRIGHTEND#### +dnl ==================================================================== +dnl#####DESCRIPTIONBEGIN#### +dnl +dnl Author(s): bartv +dnl Contact(s): bartv +dnl Date: 2002/08/07 +dnl Version: 0.01 +dnl +dnl####DESCRIPTIONEND#### +dnl ==================================================================== + + +AC_INIT(rawether.c) + +dnl Pick up the support files from the top-level acsupport directory. +AC_CONFIG_AUX_DIR(../../../../../../../acsupport) + +ECOS_CHECK_BUILD_ne_SRC +AC_CANONICAL_HOST +AM_INIT_AUTOMAKE(eCos_synthetic_target_ethernet,0.1,0) +AM_MAINTAINER_MODE + +dnl The current version of the synthetic target is implemented only for +dnl x86 Linux platforms, so a test is appropriate here. However +dnl it is not a good idea for the configure script to report an error: +dnl that would prevent any top-level configury working for other +dnl platforms. Instead an automake conditional is used to suppress adding +dnl targets to the build. +case "${host}" in + i[[34567]]86-*-linux-gnu* ) SUPPORTED="yes";; + * ) SUPPORTED="no" +esac +AM_CONDITIONAL(SUPPORTED, test "${SUPPORTED}" = "yes") + +if test "${SUPPORTED}" = "yes" ; then + AC_PROG_CC + AC_PROG_CXX + AC_OBJEXT + AC_EXEEXT + ECOS_PROG_MSVC + ECOS_PROG_STANDARD_COMPILER_FLAGS + + ECOS_PATH_TCL + dnl Check that the version of tk is sufficiently recent. + dnl For example the text widget's tag -elide facility was + dnl added between 8.2 and 8.3. Initial development of + dnl the synthetic target used 8.3.1 + if test "${TK_MAJOR_VERSION}" = "8" ; then + if test ${TK_MINOR_VERSION} -lt 3 ; then + AC_MSG_ERROR([The synthetic target ethernet support requires at least version 8.3 of Tcl/Tk]) + fi + fi + ECOS_PACKAGE_DIRS +fi + +dnl There is no real need for a config.h file at this time, since the code +dnl is specific to x86 Linux. This may change in future. +dnl AM_CONFIG_HEADER(config.h:config.h.in) + +AC_OUTPUT(Makefile:Makefile.in) diff --git a/packages/devs/eth/synth/ecosynth/current/host/ethernet.tcl b/packages/devs/eth/synth/ecosynth/current/host/ethernet.tcl new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/host/ethernet.tcl @@ -0,0 +1,1226 @@ +# {{{ Banner + +# ============================================================================ +# +# ethernet.tcl +# +# Ethernet support for the eCos synthetic target I/O auxiliary +# +# ============================================================================ +# ####COPYRIGHTBEGIN#### +# +# ---------------------------------------------------------------------------- +# Copyright (C) 2002 Bart Veer +# +# This file is part of the eCos host tools. +# +# This program 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 of the License, or (at your option) +# any later version. +# +# This program 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 +# this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# ---------------------------------------------------------------------------- +# +# ####COPYRIGHTEND#### +# ============================================================================ +# #####DESCRIPTIONBEGIN#### +# +# Author(s): bartv +# Contact(s): bartv +# Date: 2002/08/07 +# Version: 0.01 +# Description: +# Implementation of the ethernet device. This script should only ever +# be run from inside the ecosynth auxiliary. +# +# ####DESCRIPTIONEND#### +# ============================================================================ + +# }}} + +# Overview. +# +# Linux provides a number of different ways of performing low-level +# ethernet I/O from user space, including accessing an otherwise +# unused ethernet card via a PF_PACKET socket, and the tap facility. +# The necessary functionality is not readily accessible from Tcl, +# and performing this low-level I/O generally requires special +# privileges. Therefore the actual I/O happens in a C program +# rawether, installed suid root, +# +# The synthetic ethernet package supports up to four ethernet devices, +# eth0 to eth3. The target definition file maps these onto the +# underlying I/O facility. Instantiation requires spawning a rawether +# process with appropriate arguments, and then waiting for a message +# from that process indicating whether or not the instantiation +# succeeded. That message includes the MAC address. A file event +# handler is installed to handle data detected by raw ether. +# +# eCos can send a number of requests: transmit a packet, start the +# interface (possibly in promiscuous mode), stop the interface, +# or get the various parameters such as the MAC address. All those +# requests can just be passed on to the rawether process. Incoming +# ethernet packets are slightly more complicated: rawether will +# immediately pass these up to this Tcl script, which will buffer +# the packets until they are requested by eCos; in addition an +# interrupt will be raised. + +namespace eval ethernet { + # The protocol between eCos and this script. + variable SYNTH_ETH_TX 0x01 + variable SYNTH_ETH_RX 0x02 + variable SYNTH_ETH_START 0x03 + variable SYNTH_ETH_STOP 0x04 + variable SYNTH_ETH_GETPARAMS 0x05 + variable SYNTH_ETH_MULTIALL 0x06 + + # This array holds all the interesting data for all the + # interfaces, indexed by the instance id. It is also useful + # to keep track of the instance id's associated with ethernet + # devices. + array set data [list] + set ids [list] + + # One-off initialization, for example loading images. If this fails + # then all attempts at instantiation will fail as well. + variable init_ok 1 + variable install_dir $synth::device_install_dir + variable rawether_executable [file join $ethernet::install_dir "rawether"] + + if { ![file exists $rawether_executable] } { + synth::report_error "Ethernet device, rawether executable has not been installed in $ethernet::install_dir.\n" + set init_ok 0 + } elseif { ![file executable $rawether_executable] } { + synth::report_error "Ethernet device, installed program $rawether_executable is not executable.\n" + set init_ok 0 + } + + if { $synth::flag_gui } { + foreach _image [list "netrecord.xbm"] { + variable image_[file rootname $_image] + if { ! [synth::load_image "ethernet::image_[file rootname $_image]" [file join $ethernet::install_dir $_image]] } { + set init_ok 0 + } + } + unset _image + } + + # Maximum number of packets that should be buffered per interface. + # This can be changed in the target definition + variable max_buffered_packets 16 + + if { [synth::tdf_has_option "ethernet" "max_buffer"] } { + set ethernet::max_buffered_packets [synth::tdf_get_option "ethernet" "max_buffer"] + if { ![string is integer -strict $ethernet::max_buffered_packets] } { + synth::report_error "Ethernet device, invalid value in target definition file $synth::target_definition\n \ + Entry max_buffer should be a simple integer, not $ethernet::max_buffered_packets\n" + set init_ok 0 + } + } + + # Define hooks for tx and rx packets + synth::hook_define "ethernet_tx" + synth::hook_define "ethernet_rx" + + # Get a list of known ethernet devices + proc devices_get_list { } { + set result [list] + foreach id $ids { + lappend result $::ethernet::data($id,name) + } + return $result + } + + # ---------------------------------------------------------------------------- + proc instantiate { id name data } { + if { ! $ethernet::init_ok } { + synth::report_warning "Cannot instantiate ethernet device $name, initialization failed.\n" + return "" + } + + # id is a small number that uniquely identifies this device. It will + # be used as an array index. + # name is something like eth0 or eth1 + # There should be no device-specific data + + # The hard work is done by an auxiliary process which needs to be + # spawned off. It requires some additional information to map the + # eCos device name on to a suitable Linux network device such + # as tap0. That information has to come from the config file. + if { ![synth::tdf_has_option "ethernet" $name] } { + synth::report_error "Cannot instantiate ethernet device $name\n \ + No entry in target definition file $synth::target_definition\n" + return "" + } + set use [synth::tdf_get_option "ethernet" $name] + + # Do some validation here, before the rawether process is started. + # Typical entries would look like + # eth0 real eth1 + # eth1 ethertap [[tap-device] [MAC]] + set junk "" + set optional "" + set mac "" + if { [regexp -- {^\s*real\s*[a-zA-z0-9_]+$} $use] } { + # Real ethernet. + } elseif { [regexp -- {^\s*ethertap\s*(.*)$} $use junk optional ] } { + if { "" != $optional } { + if { ! [regexp -- {^tap[0-9]+\s*(.*)$} $optional junk mac ] } { + synth::report_error "Cannot instantiate ethernet device $name\n \ + Invalid entry \"$use\" in target definition file $synth::target_definition\n \ + Should be \"ethertap \[ \[\]\]\"\n" + return "" + } + if { "" != $mac } { + if { ! [regexp -- {^\s*([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}\s*} $mac ] } { + synth::report_error "Cannot instantiate ethernet device $name\n \ + Invalid entry \"$use\" in target definition file $synth::target_definition\n \ + MAC address should be of the form xx:xx:xx:xx:xx:xx, all hexadecimal digits.\n" + return "" + } + } + } + } else { + synth::report_error "Cannot instantiate ethernet device $name\n \ + Invalid entry \"$use\" in target definition file $synth::target_definition\n \ + Should be \"real \" or \"ethertap \[ \[\]\]\"\n" + return "" + } + + # Now spawn the rawether process. Its stdin and stdout are + # pipes connected to ecosynth. Its stderr is redirected to + # the current tty to avoid confusion between incoming ethernet + # packets and diagnostics. + if { [catch { set rawether [open "|$ethernet::rawether_executable $use 2>/dev/tty" w+] } message ] } { + synth::report_error "Failed to spawn rawether process for device $name\n $message" + return "" + } + + # No translation on this pipe please. + fconfigure $rawether -translation binary -encoding binary -buffering none + + # Now wait for the rawether device to initialize. It should send back a single + # byte, '0' for failure or '1' for success. Failure is followed by a text + # message which should be reported. Success is followed by a six-byte MAC + # address. + set reply [read $rawether 1] + if { "" == $reply } { + synth::report_error "rawether process for device $name exited unexpectedly.\n" + catch { close $rawether } + return "" + } + + if { "1" != $reply } { + set message [read $rawether 1024] + synth::report_error "rawether process was unable to initialize eCos device $name ($use)\n $message" + catch { close $rawether } + return "" + } + + set reply [read $rawether 7] + if { [string length $reply] != 7 } { + synth::report_error "rawether process for eCos device $name ($use) failed to provide the initialization response.\n" + catch { close $rawether } + return "" + } + set mac [string range $reply 0 5] + set multi [string index $reply 6] + + # Finally allocate an interrupt vector + set vector [synth::interrupt_allocate $name] + if { -1 == $vector } { + # No more interrupts left. An error will have been reported already. + catch { close $rawether } + return "" + } + + # The device is up and running. Fill in the array entries + lappend ethernet::ids $id + set ethernet::data($id,alive) 1 + set ethernet::data($id,name) $name + set ethernet::data($id,rawether) $rawether + set ethernet::data($id,packets) [list] + set ethernet::data($id,packet_count) 0 + set ethernet::data($id,up) 0 + set ethernet::data($id,interrupt_vector) $vector + set ethernet::data($id,MAC) $mac + set ethernet::data($id,multi) $multi + + # Set up the event handler to handle incoming packets. There should + # not be any until the interface is brought up + fileevent $rawether readable [list ethernet::handle_packet $name $id $rawether] + + # Finally return the request handler. The eCos device driver will + # automatically get back an ack. + return ethernet::handle_request + } + + # ---------------------------------------------------------------------------- + # eCos has sent a request to a device instance. Most of these requests should + # just be forwarded to rawether. Some care has to be taken to preserve + # packet boundaries and avoid confusion. It is also necessary to worry + # about the rawether process exiting unexpectedly, which may cause + # puts operations to raise an error (subject to buffering). + # + # Note: it might actually be more efficient to always send a header plus + # 1514 bytes of data, reducing the number of system calls at the cost of + # some extra data copying, but with at least two process switches per + # ethernet transfer efficiency is not going to be particularly good + # anyway. + + proc send_rawether { id packet } { + if { $ethernet::data($id,alive) } { + set chan $ethernet::data($id,rawether) + if { [catch { puts -nonewline $chan $packet } ] } { + set ethernet::data($id,alive) 0 + # No further action is needed here, instead the read handler + # will detect EOF and report abnormal termination. + } + } + } + + proc handle_request { id reqcode arg1 arg2 reqdata reqlen reply_len } { + + if { $reqcode == $ethernet::SYNTH_ETH_TX } { + # Transmit a single packet. To preserve packet boundaries + # this involves a four-byte header containing opcode and + # size, followed by the data itself. + set header [binary format "ccs" $reqcode 0 [string length $reqdata]] + ethernet::send_rawether $id $header + ethernet::send_rawether $id $reqdata + if { $ethernet::logging_enabled } { + ethernet::log_packet $ethernet::data($id,name) "tx" $reqdata + } + synth::hook_call "ethernet_tx" $ethernet::data($id,name) $reqdata + + } elseif { $reqcode == $ethernet::SYNTH_ETH_RX } { + # Return a single packet to eCos, plus a count of the number + # of remaining packets. All packets are buffered here, not + # in rawether. + if { $ethernet::data($id,packet_count) == 0 } { + synth::send_reply 0 0 "" + } else { + incr ethernet::data($id,packet_count) -1 + set packet [lindex $ethernet::data($id,packets) 0] + set ethernet::data($id,packets) [lrange $ethernet::data($id,packets) 1 end] + synth::send_reply $ethernet::data($id,packet_count) [string length $packet] $packet + if { $ethernet::logging_enabled } { + ethernet::log_packet $ethernet::data($id,name) "rx" $packet + } + synth::hook_call "ethernet_rx" $ethernet::data($id,name) $packet + } + } elseif { $reqcode == $ethernet::SYNTH_ETH_START } { + # Start the interface in either normal or promiscuous + # mode, depending on arg1. No reply is expected. Also + # mark the interface as up so that any packets transmitted + # by rawether will not be discarded + set ethernet::data($id,up) 1 + set header [binary format "ccs" $reqcode $arg1 0] + ethernet::send_rawether $id $header + } elseif { $reqcode == $ethernet::SYNTH_ETH_STOP } { + # Stop the interface. All pending packets should be + # discarded and no new packets should be accepted. + # No reply is expected so just pass this on to rawether + set ethernet::data($id,up) 0 + set ethernet::data($id,packets) [list] + set ethernet::data($id,packet_count) 0 + set header [binary format "ccs" $reqcode 0 0] + ethernet::send_rawether $id $header + } elseif { $reqcode == $ethernet::SYNTH_ETH_GETPARAMS } { + # Retrieve the interrupt number, the MAC address, + # and the multicast flag for this interface. eCos should be + # expecting back 6 bytes of data for the MAC, plus an + # extra byte for the multi flag, and the interrupt + # number as the return code. This is all known locally. + set reply "$ethernet::data($id,MAC)$ethernet::data($id,multi)" + synth::send_reply $ethernet::data($id,interrupt_vector) 7 $reply + } elseif { $reqcode == $ethernet::SYNTH_ETH_MULTIALL } { + set header [binary format "ccs" $reqcode $arg1 0] + ethernet::send_rawether $id $header + } else { + synth::report_error "Received unexpected request $reqcode for ethernet device" + } + } + + # ---------------------------------------------------------------------------- + # Incoming data. + # + # The rawether process continually reads packets from the low-level device + # and tries to forward them on to this script, where they will be received + # by an event handler. The packet consists of a four-byte header containing + # the size, followed by the ethernet data itself. This ensures that + # packet boundaries are preserved. Incoming packets are buffered inside + # the auxiliary until eCos sends an RX request, and an interrupt is + # generated. + # + # If eCos stops accepting data or if it cannot process the ethernet packets + # quickly enough then the auxiliary could end up buffering an unbounded + # amount of data. That is a bad idea, so there is an upper bound on the + # number of buffered packets. Any excess packets get dropped. + # + # Error conditions or EOF indicate that rawether has terminated. This + # should not happen during normal operation. rawether should only exit + # because of an ecos_exit hook when the channel gets closed, and the + # event handler gets removed first. + # + # Incoming packets are logged when they are received by eCos, not when + # they are received from the rawether device. That gives a somewhat more + # accurate view of what is happening inside eCos - a packet stuck in + # a fifo has little impact. + proc _handle_packet_error { msg id } { + append msg " No further I/O will happen on this interface.\n" + synth::report_warning $msg + set ethernet::data($id,alive) 0 + fileevent $ethernet::data($id,rawether) readable "" + catch { close $ethernet::data($id,rawether) } + } + + proc handle_packet { name id chan } { + set header [read $chan 4] + if { 4 != [string length $header] } { + ethernet::_handle_packet_error "rawether process for $name has terminated unexpectedly.\n" $id + return + } + + binary scan $header "ccs" code arg1 len + if { $ethernet::SYNTH_ETH_RX != $code } { + set msg "protocol mismatch from rawether process for $name\n" + append msg " Function code $code not recognised.\n" + ethernet::_handle_packet_error $msg $id + return + } + if { ($len < 14) || ($len > 1514) } { + set msg "protocol mismatch from rawether process for $name\n" + append msg " Invalid transfer length $len\n" + ethernet::_handle_packet_error $msg $id + return + } + + set data [read $chan $len] + if { $len != [string length $data] } { + set msg "protocol mismatch from rawether process for $name\n" + append msg " Expected $len byte ethernet packet, received [string length $data] bytes\n" + ethernet::_handle_packet_error $msg $id + return + } + + # The data has been received correctly. Should it be buffered? + if { !$ethernet::data($id,up) } { + return + } + if { $ethernet::data($id,packet_count) >= $ethernet::max_buffered_packets } { + return + } + + # Store the packet, and inform eCos there is work to be done + lappend ethernet::data($id,packets) $data + incr ethernet::data($id,packet_count) + synth::interrupt_raise $ethernet::data($id,interrupt_vector) + + } + + # ---------------------------------------------------------------------------- + # When eCos has exited, the rawether processes can and should be + # shut down immediately. + proc ecos_exited { arg_list } { + foreach id $ethernet::ids { + if { $ethernet::data($id,alive) } { + set ethernet::data($id,alive) 0 + fileevent $ethernet::data($id,rawether) readable "" + catch { close $ethernet::data($id,rawether) } + } + } + } + synth::hook_add "ecos_exit" ethernet::ecos_exited + + # ---------------------------------------------------------------------------- + # Read in various data files for use by the filters + # + # Other possible sources of information include arp, ypcat, and + # dns. Those are avoided for now because they involve running + # additional processes that might hang for a while. Also arp + # would only give useful information for very recently accessed + # machines, NIS might not be running, and dns could involve an + # expensive lookup while the system is running . + + array set services [list] + array set hosts [list] + array set protocols [list] + + proc read_services { } { + catch { + set fd [open "/etc/services" "r"] + while { -1 != [gets $fd line] } { + set junk "" + set name "" + set number "" + set protocol "" + if { [regexp -- {^([-a-zA-Z0-9_]+)\s*([0-9]+)/((?:tcp)|(?:udp)).*$} $line junk name number protocol] } { + set ethernet::services($number,$protocol) $name + } + } + close $fd + } + } + + proc read_protocols { } { + catch { + set fd [open "/etc/protocols" "r"] + while { -1 != [gets $fd line] } { + set junk "" + set name "" + set number "" + if { [regexp -- {^([-a-zA-Z0-9_]+)\s*([0-9]+)\s.*} $line junk name number] } { + set ethernet::protocols($number) $name + } + } + close $fd + } + } + + proc read_hosts { } { + catch { + set fd [open "/etc/hosts" "r"] + while { -1 != [gets $fd line] } { + set junk "" + set name "" + set number "" + + # Deliberately ignore parts of the name after the first . + if { [regexp -- {^([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})\s*([a-zA-Z0-9]+)(\.|\s|$)} $line junk number name] } { + # The number should be naturalized if it is going to match reliably + scan $line "%d.%d.%d.%d" a b c d + set index [expr (($a & 0x0FF) << 24) | (($b & 0x0FF) << 16) | (($c & 0x0FF) << 8) | ($d & 0x0FF)] + set ethernet::hosts($index) $name + } + } + close $fd + } + } + + # ---------------------------------------------------------------------------- + # Filtering support. This is only really used when running in GUI mode. + # However all the relevant options are still extracted and validated, + # to avoid warnings about unrecognised options. + + variable logging_enabled 0 + variable max_show 64 + + # Construct a string for the data, either all of it or up to max_show bytes. + # This is just hex in chunks of four bytes. + proc format_hex_data { data } { + set result "" + + set len [string length $data] + if { $len > $ethernet::max_show } { + set len $ethernet::max_show + } + binary scan $data "H[expr 2 * $len]" hex + for { set i 0 } { $i < $len } { incr i 4 } { + append result "[string range $hex [expr $i * 2] [expr ($i * 2) + 7]] " + } + set result [string trimright $result] + return $result + } + + # Given an IPv4 network address, turn it into a.b.c.d and the + # host name as well (if known). The argument should be a 32-bit + # integer. + proc inet_ipv4_ntoa { number } { + set result [format "%d.%d.%d.%d" [expr ($number >> 24) & 0x0FF] [expr ($number >> 16) & 0x0FF] \ + [expr ($number >> 8) & 0x0FF] [expr $number & 0x0FF]] + if { [info exists ethernet::hosts($number) ] } { + append result "($ethernet::hosts($number))" + } + return $result + } + + # Given an ipv4 address encapsulated in an IPv6 address, do the necessary + # conversion. We have something like 123:4567, we want a.b.c.d plus + # a host address. + proc inet_ipv4_in_ipv6_ntoa { top bottom } { + if { "" == $top } { + set top 0 + } + if { "" == $bottom } { + set bottom 0 + } + set top "0x$top" + set bottom "0x$bottom" + + set ipv4 [expr ($top << 16) | $bottom] + return inet_ipv4_ntoa $ipv4 + } + + # Ditto for IPv6. The argument should be a 32-digit hexadecimal string. + # For now there is no simple way of mapping these onto host names, + # unless the address is an IPv4-mapped or compatible one, or one of + # special cases such as loopback. + proc inet_ipv6_ntoa { number } { + # We have something like 12345678abcdef. Start by inserting the appropriate + # colons. + set result [format "%s:%s:%s:%s:%s:%s:%s:%s" [string range $number 0 3] [string range $number 4 7] \ + [string range $number 8 11] [string range $number 12 15] [string range $number 16 19] \ + [string range $number 20 23] [string range $number 24 27] [string range $number 28 31]] + # Now eliminate unwanted 0's at the start of each range. + regsub {^0+} $result {} result + regsub -all {:0+} $result {:} result + + # If we have ended up with sequences of colons, abbreviate + # them into pairs. + regsub -all {::+} $result {::} result + + # There are a couple of special addresses + if { "::1" == $result } { + return "::1(loopback)" + } elseif { "::" == $result } { + return "::(IN6ADDR_ANY)" + } + + # Look for IPv4-mapped addresses. + set junk "" + set ipv4_1 "" + set ipv4_2 "" + if { [regexp -nocase -- {::ffff:([0-9a-f]{0,3}):([0-9a-f]{0,3})$} $result junk ipv4_1 ipv4_2] } { + set result [inet_ipv4_in_ipv6_nto $ipv4_1 $ipv4_2] + return "::FFFF:$result" + } elseif { [regexp -nocase -- {::([0-9a-f]{0,3}):([0-9a-f]{0,3})$} $result junk ipv4_1 ipv4_2] } { + set result [inet_ipv4_in_ipv6_nto $ipv4_1 $ipv4_2] + return "::$result" + } else { + # Could still be aggregatable global unicast, link-local, site-local or multicast. + # But not decoded further for now. + return $result + } + } + + proc log_packet { device direction packet } { + if { [string length $packet] < 14 } { + return + } + binary scan $packet {H2H2H2H2H2H2 H2H2H2H2H2H2 S} dest5 dest4 dest3 dest2 dest1 dest0 src5 src4 src3 src2 src1 src0 eth_protocol + set packet [string range $packet 14 end] + + set ether_msg "$device $direction: [string length $packet] bytes, " + append ether_msg [format ">%s:%s:%s:%s:%s:%s <%s:%s:%s:%s:%s:%s" $dest5 $dest4 $dest3 $dest2 $dest1 $dest0 $src5 $src4 $src3 $src2 $src1 $src0] + set eth_protocol [expr $eth_protocol & 0x0FFFF] + if { $eth_protocol <= 1536 } { + append ether_msg " 802.3 " + if { [string length $packet] < 8 } { + return + } + binary scan $packet {a6 S} junk eth_protocol + set packet [string range $packet 8 end] + } + append ether_msg [format " %04x" $eth_protocol] + if { $eth_protocol == 0x0800 } { + append ether_msg "(ip)" + } elseif { $eth_protocol == 0x00806 } { + append ether_msg "(arp)" + } elseif { $eth_protocol == 0x08035 } { + append ether_msg "(rarp)" + } + append ether_msg " [ethernet::format_hex_data $packet]\n" + synth::output $ether_msg "eth_ether" + + if { 0x0806 == $eth_protocol } { + # An ARP request. This should always be 28 bytes. + if { [string length $packet] < 28 } { + return + } + binary scan $packet {SSccS H2H2H2H2H2H2 I H2H2H2H2H2H2 I} hard_type prot_type hard_size prot_size op \ + sender5 sender4 sender3 sender2 sender1 sender0 sender_ip \ + target5 target4 target3 target2 target1 target0 target_ip + set hard_type [expr $hard_type & 0x0FFFF] + set prot_type [expr $prot_type & 0x0FFFF] + set hard_size [expr $hard_size & 0x0FF] + set prot_size [expr $prot_size & 0x0FF] + set op [expr $op & 0x0FFFF] + set sender_ip [expr $sender_ip & 0x0FFFFFFFF] + set target_ip [expr $target_ip & 0x0FFFFFFFF] + + set arp_msg "$device $direction: ARP " + if { $op == 1 } { + append arp_msg "request " + } elseif { $op == 2 } { + append arp_msg "reply " + } else { + append_arp_msg " " + } + if { $hard_type != 1 } { + append arp_msg "(unexpected hard_type field $hard_type, should be 1) " + } + if { $prot_type != 0x0800 } { + append arp_msg "(unexpected prot_type field $prot_type, should be 0x0800) " + } + if { $hard_size != 6 } { + append arp_msg "(unexpected hard_size field $hard_size, should be 6) " + } + if { $prot_size != 4 } { + append arp_msg "(unexpected prot_size field $prot_size, should be 4) " + } + append arp_msg [format ", sender %s:%s:%s:%s:%s:%s " $sender5 $sender4 $sender3 $sender2 $sender1 $sender0] + append arp_msg [ethernet::inet_ipv4_ntoa $sender_ip] + append arp_msg [format ", target %s:%s:%s:%s:%s:%s " $target5 $target4 $target3 $target2 $target1 $target0] + append arp_msg [ethernet::inet_ipv4_ntoa $target_ip] + append arp_msg "\n" + + synth::output $arp_msg "eth_arp" + return + } + + if { 0x0800 != $eth_protocol } { + return + } + + # We have an IP packet. Is this IPv4 or IPv6? The first byte contains + # the version and the overall length of the IP header in 32-bit words + if { [string length $packet] < 20 } { + return + } + binary scan $packet {c} tmp + set ip_version [expr ($tmp >> 4) & 0x0F] + set ip_hdrsize [expr $tmp & 0x0F] + if { 4 == $ip_version } { + binary scan $packet {ccSSSccSII} tmp tos len id frag ttl ip_protocol checksum source_ip dest_ip + set ipv4_msg "$device $direction: IPv4" + if { 0 != $tos } { + append ipv4_msg [format " tos %02x," [expr $tos & 0x0FF]] + } + append ipv4_msg [format " len %d, id %d," [expr $len & 0x0FFFF] [expr $id & 0x0FFFF]] + if { 0 != $frag } { + append ipv4_msg [format " frag %u" [expr 8 * ($frag & 0x01FFF)]] + if { 0 != ($frag & 0x04000) } { + append ipv4_msg " DF" + } + if { 0 != ($frag & 0x02000) } { + append ipv4_msg " MF" + } + append ipv4_msg "," + } + append ipv4_msg [format " ttl %d," $ttl] + set ip_protocol [expr $ip_protocol & 0x0FF] + if { [info exists ethernet::protocols($ip_protocol)] } { + append ipv4_msg " $ethernet::protocols($ip_protocol)," + } else { + append ipv4_msg [format " protocol %d" $ip_protocol] + } + + set source_name [ethernet::inet_ipv4_ntoa $source_ip] + set dest_name [ethernet::inet_ipv4_ntoa $dest_ip] + append ipv4_msg " >${dest_name}, <${source_name}\n" + + synth::output $ipv4_msg "eth_ipv4" + + # If this packet is a fragment other than the first, do not try to decode + # subsequent packets. The header information will not be present. + if { 0 != ($frag & 0x01FFF)} { + return + } + set packet [string range $packet [expr 4 * $ip_hdrsize] end] + + } elseif { 6 == $ip_version } { + if { [string length $packet] < 40 } { + return + } + binary scan $packet {ISccH16H16} flow payload_length next_header hop_limit source_ip dest_ip + set ipv6_msg "$device $direction: IPv6" + set prio [expr ($flow & 0x0F000000) >> 24] + set flow [expr $flow & 0x00FFFFFF] + if { 0 != $flow } { + append ipv6_msg [format " flow %04x prio %x," $flow $prio] + } + append ipv6_msg " payload [expr $payload bytes & 0x0FFFF]," + append ipv6_msg " hop limit [expr $hop_limit & 0x0FF]," + set next_header [expr $next_header & 0x0FF] + if { [info exists ethernet::protocols($next_header)] } { + append ipv6_msg " $ethernet::protocols($next_header)," + } else { + append ipv6_msg [format " protocol %d," $next_header] + } + + set source_name [ethernet::inet_ipv6_ntoa $source_ip] + set dest_name [ethernet::inet_ipv6_ntoa $dest_ip] + append ipv6_msg " >${dest_name}, <${source_name}\n" + + synth::output $ipv6_msg "eth_ipv6" + + set packet [string range $packet 40 end] + + } else { + synth::output "$device $direction: unknown IP version $ip_version\n" "eth_ipv4" + return + } + + + # Now for some known protocols, icmp, tcp, udp and icmpv6 + # Possible ipv6-frag should be handled here as well. The + # fragment header should be followed by another header such + # as tcp or udp. + if { 1 == $ip_protocol } { + # ipv4 ICMP + if { [string length $packet] < 4 } { + return + } + binary scan $packet {ccS} code type checksum + + set icmpv4_msg "$device $direction: ICMPv4 " + set error 0 + set data 0 + switch -- $code { + 0 { + append icmpv4_msg "ping reply" + if { [string length $packet] >= 8 } { + # The id and seq are in the sender's format, not network format. + # We have to assume either little or bigendian, so go for the former + binary scan $packet {iss} junk id seq + append icmpv4_msg [format " id %u, seq %u" [expr $id & 0x0FFFF] [expr $seq & 0x0FFFF]] + set data 1 + set packet [string range $packet 8 end] + } + } + 3 { + append icmpv4_msg "unreachable/" + switch -- $type { + 0 { append icmpv4_msg "network" } + 1 { append icmpv4_msg "host" } + 2 { append icmpv4_msg "protocol" } + 3 { append icmpv4_msg "port" } + 4 { append icmpv4_msg "frag needed but don't frag set" } + 5 { append icmpv4_msg "source route failed" } + 6 { append icmpv4_msg "destination network unknown" } + 7 { append icmpv4_msg "destination host unknown" } + 8 { append icmpv4_msg "source host isolated" } + 9 { append icmpv4_msg "destination network prohibited" } + 10 { append icmpv4_msg "destination host prohibited" } + 11 { append icmpv4_msg "network for TOS" } + 12 { append icmpv4_msg "host for TOS" } + 13 { append icmpv4_msg "communication prohibited" } + 14 { append icmpv4_msg "host precedence violation" } + 15 { append icmpv4_msg "precedence cutoff" } + default { append icmpv4_msg "unknown" } + } + set error 1 + } + 4 { + append icmpv4_msg "source quench" + set error 1 + } + 5 { + append icmpv4_msg "redirect/" + switch -- $type { + 0 { append icmpv4_msg "network" } + 1 { append icmpv4_msg "host" } + 2 { append icmpv4_msg "tos & network" } + 3 { append icmpv4_msg "tos & host" } + default { append icmpv4_msg "unknown" } + } + set error 1 + } + 8 { + append icmpv4_msg "ping request" + if { [string length $packet] >= 8 } { + binary scan $packet {iss} junk id seq + append icmpv4_msg [format " id %u, seq %u" [expr $id & 0x0FFFF] [expr $seq & 0x0FFFF]] + set data 1 + set packet [string range $packet 8 end] + } + } + 9 { + append icmpv4_msg "router advertisement" + } + 10 { + append icmpv4_msg "router solicitation" + } + 11 { + append icmpv4_msg "time exceeded/" + switch -- $type { + 0 { append icmpv4_msg "transit" } + 1 { append icmpv4_msg "reassembly" } + default { append icmpv4_msg "unknown" } + } + set error 1 + } + 12 { + append icmpv4_msg "parameter problem/" + switch -- $type { + 0 { append icmpv4_msg "IP header bad" } + 1 { append icmpv4_msg "required option missing" } + default { append icmpv4_msg "unknown" } + } + set error 1 + } + 13 { + append icmpv4_msg "timestamp request" + } + 14 { + append icmpv4_msg "timestamp reply" + } + 15 { + append icmpv4_msg "information request" + } + 16 { + append icmpv4_msg "information reply" + } + 17 { + append icmpv4_msg "address mask request" + } + 18 { + append icmpv4_msg "address mask reply" + } + default { + append icmpv4_msg "unknown" + } + } + if { $error && ([string length $packet] >= 36) } { + # The ICMP message contains an IP header and hopefully the TCP or UDP ports as well + # Only deal with the simple cases. + binary scan $packet {iiccSiccSIISS} icmp_junk1 icmp_junk2 ip_lenver ip_junk1 ip_junk2 ip_junk3 ip_junk4 ip_protocol ip_junk5 \ + ip_source ip_dest ip_source_port ip_dest_port + if { (5 == ($ip_lenver & 0x0F)) && ((6 == $ip_protocol) || (17 == $ip_protocol)) } { + if { 6 == $ip_protocol } { + append icmpv4_msg ", tcp" + } else { + append icmpv4_msg ", udp" + } + append icmpv4_msg " >[ethernet::inet_ipv4_ntoa $ip_dest]:$ip_dest_port <[ethernet::inet_ipv4_ntoa $ip_source]:$ip_source_port" + } + } + + append icmpv4_msg "\n" + synth::output $icmpv4_msg "eth_icmpv4" + + # Only some of the requests contain additional data that should be displayed + if { !$data } { + return + } + + } elseif { 58 == $ip_protocol } { + # ipv6 ICMP + if { [string length $packet] < 4 } { + return + } + binary scan $packet {ccS} code type checksum + + set icmpv6_msg "$device $direction: ICMPv6 " + set error 0 + set data 0 + switch -- $code { + 1 { + append icmpv6_msg "unreachable/" + switch -- $type { + 0 { append icmpv6_msg "no route" } + 1 { append icmpv6_msg "prohibited" } + 2 { append icmpv6_msg "not a neighbour" } + 3 { append icmpv6_msg "any other reason" } + 4 { append icmpv6_msg "UDP port unreachable" } + default { append icmpv6_msg "unknown" } + } + set error 1 + } + 2 { + append icmpv6_msg "packet too big" + set error 1 + } + 3 { + append icmpv6_msg "time exceeded/" + switch -- $type { + 0 { append icmpv6_msg "hop limit" } + 1 { append icmpv6_msg "fragment reassembly" } + default { append icmpv6_msg "unknown" } + } + set error 1 + } + 4 { + append icmpv6_msg "parameter problem" + switch -- $type { + 0 { append icmpv6_msg "erroneous header" } + 1 { append icmpv6_msg "unrecognized next header" } + 2 { append icmpv6_msg "unrecognized option" } + default { append icmpv6_msg "unknown" } + } + set error 1 + } + 128 { + append icmpv6_msg "ping request" + # FIXME: is this the same format as for icmpv4? + } + 129 { + append icmpv6_msg "ping reply" + # FIXME: is this the same format as for icmpv4? + } + 130 { + append icmpv6_msg "group membership query" + } + 131 { + append icmpv6_msg "group membership report" + } + 132 { + append icmpv6_msg "group membership reduction" + } + 133 { + append icmpv6_msg "router solicitation" + } + 134 { + append icmpv6_msg "router advertisement" + } + 135 { + append icmpv6_msg "neighbour solicitation" + } + 136 { + append icmpv6_msg "neighbour advertisement" + } + 137 { + append icmpv6_msg "redirect" + } + } + + if { $error && ([string length $packet] >= 44) } { + # The ICMP message contains an IPv6 header and hopefully the TCP or UDP ports as well + binary scan $packet {isccH16H16SS} icmp_junk1 icmp_junk2 ip_protocol icmp_junk3 ip_source ip_dest ip_source_port ip_dest_port + if { 6 == $ip_protocol } { + append icmpv6_msg ", tcp" + } elseif { 17 == $ip_protocol } { + append icmpv6_msg ", udp" + } + append icmpv6_msg " >[ethernet::inet_ipv4_ntoa $ip_dest]:$ip_dest_port <[ethernet::inet_ipv6_ntoa $ip_source]:$ip_source_port" + } + append icmpv6_msg "\n" + synth::output $icmpv6_msg "eth_icmpv6" + + if { !$data } { + return + } + + } elseif { 6 == $ip_protocol } { + # TCP + if { [string length $packet] < 20 } { + return + } + binary scan $packet {SSIIccSSS} source_port dest_port seq ack hdrsize flags winsize checksum urg + set source_port [expr $source_port & 0x0FFFF] + set dest_port [expr $dest_port & 0x0FFFF] + set hdrsize [expr ($hdrsize >> 4) & 0x0F] + set winsize [expr $winsize & 0x0FFFF] + set urg [expr $urg & 0x0FFFF] + + set tcp_msg "$device $direction tcp: " + append tcp_msg " >${dest_name}:${dest_port}" + if { [info exists ethernet::services($dest_port,udp)] } { + append tcp_msg "($ethernet::services($dest_port,udp))" + } + append tcp_msg "<${source_name}:$source_port" + if { [info exists ethernet::services($source_port,udp)] } { + append tcp_msg "($ethernet::services($source_port,udp))" + } + + append tcp_msg ", " + if { $flags & 0x08 } { + append tcp_msg "PSH " + } + if { $flags & 0x04 } { + append tcp_msg "RST " + } + if { $flags & 0x02 } { + append tcp_msg "SYN " + } + if { $flags & 0x01 } { + append tcp_msg "FIN " + } + append tcp_msg [format "seq %u" $seq] + + if { 0 != ($flags & 0x010) } { + append tcp_msg [format ", ACK %u" $ack] + } + append tcp_msg ", win $winsize" + if { 0 != ($flags & 0x020) } { + append tcp_msg ", URG $urg" + } + append tcp_msg "\n" + synth::output $tcp_msg "eth_tcp" + + set packet [string range $packet [expr 4 * $hdrsize] end] + } elseif { 17 == $ip_protocol } { + # UDP + if { [string length $packet] < 8 } { + return + } + set udp_msg "$device $direction: udp " + binary scan $packet {SSSS} source_port dest_port len checksum + set source_port [expr $source_port & 0x0FFFF] + set dest_port [expr $dest_port & 0x0FFFF] + append udp_msg [format "%d bytes, " [expr $len & 0x0FFFF]] + append udp_msg " >${dest_name}:$dest_port" + if { [info exists ethernet::services($dest_port,udp)] } { + append udp_msg "($ethernet::services($dest_port,udp))" + } + append udp_msg "<${source_name}:$source_port" + if { [info exists ethernet::services($source_port,udp)] } { + append udp_msg "($ethernet::services($source_port,udp))" + } + append udp_msg "\n" + synth::output $udp_msg "eth_udp" + set packet [string range $packet 8 end] + } else { + # Unknown protocol, so no way of knowing where the data starts. + return + } + + # At this point we may have a payload. This should be + # dumped in both hex and ascii. The code tries to preserve + # alignment. + if { [string length $packet] == 0 } { + return + } + set hexdata_msg "$device $direction: data [format_hex_data $packet]\n" + set asciidata_msg "$device $direction: data " + set len [string length $packet] + if { $len > $ethernet::max_show } { + set len $ethernet::max_show + } + for { set i 0 } { $i < $len } { incr i } { + set char [string index $packet $i] + if { "\r" == $char } { + append asciidata_msg "\\r" + } elseif { "\n" == $char } { + append asciidata_msg "\\n" + } elseif { "\t" == $char } { + append asciidata_msg "\\t" + } elseif { [string is print -strict $char] } { + append asciidata_msg " $char" + } else { + append asciidata_msg "??" + } + if { 3 == ($i % 4) } { + append asciidata_msg " " + } + } + append asciidata_msg "\n" + synth::output $hexdata_msg "eth_hexdata" + synth::output $asciidata_msg "eth_asciidata" + + return + } + + # A utility for handling the ethernet record button on the toolbar + proc logging_button_toggle { } { + if { $ethernet::logging_enabled } { + set ethernet::logging_enabled 0 + .toolbar.ethernet_logging configure -relief flat + } else { + set ethernet::logging_enabled 1 + .toolbar.ethernet_logging configure -relief sunken + } + } + + # A dummy procedure for initialization. All of this could execute at + # the toplevel, but there are lots of locals. + proc filters_initialize { } { + ethernet::read_services + ethernet::read_protocols + ethernet::read_hosts + + # Add a button on the toolbar for enabling/disabling logging. + # Also add an entry to the help menu + if { $synth::flag_gui } { + button .toolbar.ethernet_logging -image $ethernet::image_netrecord -borderwidth 2 -relief flat -command ethernet::logging_button_toggle] + pack .toolbar.ethernet_logging -side left -padx 2 + synth::register_balloon_help .toolbar.ethernet_logging "Record ethernet traffic" + + if { [synth::tdf_has_option "ethernet" "logging"] } { + set ethernet::logging_enabled [synth::tdf_get_option "ethernet" "logging"] + } else { + # Default to logging ethernet traffic. This may not be the right thing to do + # because users may see too much output by default, but it is easy enough + # to disable. + set ethernet::logging_enabled 1 + } + if { $ethernet::logging_enabled } { + .toolbar.ethernet_logging configure -relief sunken + } + + set ethernet_help [file join $synth::device_src_dir "doc" "devs-eth-synth-ecosynth.html"] + if { ![file readable $ethernet_help] } { + synth::report_warning "Failed to locate synthetic ethernet documentation $ethernet_help\n \ + Help->Ethernet target menu option disabled.\n" + set ethernet_help "" + } + if { "" == $ethernet_help } { + .menubar.help add command -label "Ethernet" -state disabled + } else { + .menubar.help add command -label "Ethernet" -command [list synth::handle_help "file://$ethernet_help"] + } + } + + if { [synth::tdf_has_option "ethernet" "max_show"] } { + set ethernet::max_show [synth::tdf_get_option "ethernet" "max_show"] + if { ! [string is integer -strict $ethernet::max_show] } { + synth::report_error "Ethernet device, invalid value in target definition file $synth::target_definition\n \ + Entry max_show should be a simple integer, not $ethernet::max_show\n" + set ethernet::init_ok 0 + } + } + + # Filters. First, perform some validation. + set known_filters [list "ether" "arp" "ipv4" "ipv6" "icmpv4" "icmpv6" "udp" "tcp" "hexdata" "asciidata"] + set tdf_filters [synth::tdf_get_options "ethernet" "filter"] + array set filter_options [list] + + foreach filter $tdf_filters { + if { 0 == [llength $filter] } { + synth::report_error "Ethernet device, invalid value in target definition file $synth::target_definition\n \ + Option \"filter\" requires the name of a known filters.\n" + set ethernet::init_ok 0 + continue + } + set name [lindex $filter 0] + if { [info exists filter_options($name)] } { + synth::report_error "Ethernet device, invalid value in target definition file $synth::target_definition\n \ + \"filter $name\" should be defined only once.\n" + set ethernet::init_ok 0 + continue + } + if { -1 == [lsearch -exact $known_filters $name] } { + synth::report_error "Ethernet device, invalid value in target definition file $synth::target_definition\n \ + Unknown filter \"$name\".\n \ + Known filters are $known_filters\n" + set ethernet::init_ok 0 + continue + } + set filter_options($name) [lrange $filter 1 end] + } + + # We now know about all the filter entries in the target definition file. + # Time to create the filters themselves, provided we are running in GUI mode. + if { $synth::flag_gui } { + foreach filter $known_filters { + if { ! [info exists filter_options($filter)] } { + synth::filter_add "eth_$filter" -text "ethernet $filter" + } else { + array set parsed_options [list] + set message "" + if { ![synth::filter_parse_options $filter_options($filter) parsed_options message] } { + synth::report_error \ + "Invalid entry in target definition file $synth::target_definition\n \ + Ethernet filter $filter\n $message" + set ethernet::init_ok 0 + } else { + set parsed_options("-text") "ethernet $filter" + synth::filter_add_parsed "eth_$filter" parsed_options + } + } + } + } + } + ethernet::filters_initialize +} + +return ethernet::instantiate diff --git a/packages/devs/eth/synth/ecosynth/current/host/ethernet.tdf b/packages/devs/eth/synth/ecosynth/current/host/ethernet.tdf new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/host/ethernet.tdf @@ -0,0 +1,117 @@ +# Target definition file fragment for ethernet devices. +# +# The target-side can instantiate up to four ethernet devices, +# eth0 to eth3. Each instance requires an entry in the +# target definition file specifying what underlying Linux +# kernel facility should be used to implement the I/O. This +# can take the following forms: +# +# 1) an existing ethernet device, e.g. +# eth0 real eth1 +# thus mapping the eCos device eth0 on to the Linux device eth1. +# The latter network interface must not currently be in use +# by Linux. Traffic will flow to and from the real ethernet, and +# communication is possible with any machine on the LAN. +# +# 2) the Linux kernel's tap facility. +# eth0 ethertap +# This will result in a Linux ethernet interface such as +# tap3 appearing. The interface can be configured like any +# other network device, for example by using the ifconfig +# command or by creating a configuration file +# /etc/sysconfig/network-scripts/ifcfg-tap3 +# The result is a virtual ethernet segment visible only +# to the Linux host and eCos. Bridge software inside the +# Linux host can be used to connect eCos to a larger network. +# +# Optionally a specific tap device can be configured, +# eth0 ethertap tap3 +# By default the code will pick up the next free tap device, +# usually tap0. If the Linux interface should come up automatically +# then this can be achieved with an ifcfg-tap?? configuration +# file. Explicitly specifying the tap device can avoid some +# confusion. +# +# Both the eCos and the Linux network interface need a unique +# MAC address. There is no real ethernet hardware involved to +# supply these addresses, so they have to be invented. The +# Linux kernel will automatically invent one for its interface. +# By default a random MAC address will also be generated for +# the eCos interface, but to make the system more deterministic +# it is possible to specify the MAC address to be used. This +# facility is only available in conjunction with an explicit +# tap device, e.g.: +# eth0 ethertap tap3 00:01:02:03:04:05 +# The MAC address should be in the usual format: six 2-digit +# hexadecimal numbers separated by colons. It is the user's +# responsibility to make sure that the address specified +# does not match any other real or invented address visible +# on the local network. +# +# It is possible that bursts of ethernet traffic occur, causing +# packets to arrive faster than they can be forwarded to and +# processed by eCos. It is desirable that some number of packets +# be buffered, matching the behaviour of many ethernet devices +# with built-in fifos. However the number of these packets should +# be restricted: if eCos stops accepting ethernet packets or +# cannot handle the data quickly enough, then it is possible that +# an unlimited number of packets could accumulate in the I/O +# auxiliary until all available memory and swap space is exhausted. +# By default up to 16 packets will be buffered per device, but +# this can be changes with the max_buffer option. +# +# The ethernet emulation code can perform logging and limited +# analysis of each ethernet packet. For example if a particular +# packet is an IPv4 ICMP request then details of the request +# will be logged to the main text window. The appearance of the +# various filters can be controlled here, using the usual +# options such as -foreground, -background, and -hide. +# +# This logging of each ethernet frame can be somewhat time-consuming +# and, for a long run, require a lot of memory. Logging can be +# disabled by default if desired, and a button on the toolbar allows +# this setting to be toggled. +# +# Ethernet packets can be up to 1514 bytes, so showing entire packets +# on a single line can mean very wide lines. In practice the interesting +# data is usually at the start, so the output can be truncated to a +# maximum number of bytes. The data is displayed in hex so each byte +# requires two columns, and some spacing will be added as well to +# improve legibility. + +synth_device ethernet { + ## Map eCos devices on to Linux ones. + + # eth0 real eth1 + # eth0 ethertap + # eth0 ethertap tap3 + eth0 ethertap tap3 00:FE:42:63:84:A5 + + # eth1 ethertap tap4 00:FE:12:34:56:78 + # eth2 ethertap tap5 00:FE:9A:BC:DE:F0 + # eth3 real eth2 + + ## Maximum number of packets that should be buffered per interface. + ## Default 16 + max_buffer 32 + + ## Should packets be logged? The default is yes. + # logging 0 + + ## Maximum number of data bytes to be shown. + ## Default 64 + # max_show 128 + + ## Filters for the various recognised protocols. + ## By default all filters are visible and use standard colours. + # filter ether -hide 0 + # filter arp -hide 1 + # filter ipv4 -hide 1 + # filter ipv6 -hide 1 + # filter icmpv4 -hide 1 + # filter icmpv6 -hide 1 + # filter udp -hide 1 + # filter tcp -hide 1 + # filter hexdata -hide 0 + # filter asciidata -hide 0 +} diff --git a/packages/devs/eth/synth/ecosynth/current/host/fromnet.xbm b/packages/devs/eth/synth/ecosynth/current/host/fromnet.xbm new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/host/fromnet.xbm @@ -0,0 +1,4 @@ +#define fromnet_width 8 +#define fromnet_height 8 +static unsigned char fromnet_bits[] = { + 0x00, 0x87, 0xa5, 0x95, 0xfd, 0x95, 0xa5, 0x87}; diff --git a/packages/devs/eth/synth/ecosynth/current/host/netrecord.xbm b/packages/devs/eth/synth/ecosynth/current/host/netrecord.xbm new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/host/netrecord.xbm @@ -0,0 +1,6 @@ +#define netrecord_width 16 +#define netrecord_height 15 +static unsigned char netrecord_bits[] = { + 0x00, 0x00, 0xce, 0x39, 0x4a, 0x08, 0xce, 0x09, 0x46, 0x08, 0xca, 0x39, + 0x00, 0x00, 0x0e, 0x20, 0x4a, 0x24, 0x2a, 0x28, 0xfa, 0x3f, 0x2a, 0x28, + 0x4a, 0x24, 0x0e, 0x20, 0x00, 0x00}; diff --git a/packages/devs/eth/synth/ecosynth/current/host/rawether.c b/packages/devs/eth/synth/ecosynth/current/host/rawether.c new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/host/rawether.c @@ -0,0 +1,757 @@ +//============================================================================ +// +// rawether.c +// +// A utility program to perform low-level ethernet operations +// +//============================================================================ +//####COPYRIGHTBEGIN#### +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2002 Bart Veer +// +// This file is part of the eCos host tools. +// +// This program 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 of the License, or (at your option) +// any later version. +// +// This program 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 +// this program; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// ---------------------------------------------------------------------------- +// +//####COPYRIGHTEND#### +//============================================================================ +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contact(s): bartv +// Date: 2002/08/07 +// Version: 0.01 +// Description: +// +// This program is fork'ed by the ethernet.tcl script running inside +// the synthetic target auxiliary. It is responsible for performing +// low-level ethernet I/O. +// +//####DESCRIPTIONEND#### +//============================================================================ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// The protocol between host and target is defined by a private +// target-side header. +#include "../src/protocol.h" + +// Allow debug builds. Set this flag to 0, 1 or 2 +#define DEBUG 0 + +// ---------------------------------------------------------------------------- +// Statics. + +// Are we using a real ethernet device or ethertap? +static int real_ether = 0; +static int ethertap = 0; + +// The six-byte MAC address, which must be returned to eCos +static unsigned char MAC[6]; + +// Does the driver support multicasting? +static int multicast_supported = 0; + +// The file descriptor for incoming data ethernet packets. +// Used for select() together with fd 0 corresponding to ecosynth +static int ether_fd = -1; + +// Is the interface up? +static int up = 0; + +// Space for incoming and outgoing packets. In the case of rx_buffer +// there are an extra four bytes at the front for the protocol header. +#define MTU 1514 +static unsigned char tx_buffer[MTU]; +static unsigned char rx_buffer[MTU+4]; + +// ---------------------------------------------------------------------------- +// A utility buffer for messages. +#define MSG_SIZE 256 +static unsigned char msg[MSG_SIZE]; + +// Report an error to ecosynth during initialization. This means a +// single byte 0, followed by a string. +static void +report_error(char* msg) +{ + write(1, "0", 1); + write(1, msg, strlen(msg)); + close(1); + exit(0); +} + +// Report success to ecosynth. This means a byte 1 followed by +// the MAC address. +static void +report_success(void) +{ + write(1, "1", 1); + memcpy(msg, MAC, 6); + msg[6] = multicast_supported; + write(1, msg, 7); +} + + +// ---------------------------------------------------------------------------- +// Real ethernet. This involves creating a SOCK_RAW socket and binding it +// to the appropriate interface. Relevant documentation can be found in +// the man pages (packet(7) and netdevice(7)). + +// The device name. Needed for various ioctl()'s. +static char real_devname[IFNAMSIZ]; + +// The interface index. +static int real_ifindex = -1; + +// Transmit a single ethernet frame. The socket should be set up so a +// simple send() operation should do the trick. Errors such as EAGAIN, +// indicating that the network device is still busy, are ignored. +// Ethernet is not a reliable communication medium. +static void +real_handle_tx(unsigned char* buffer, int size) +{ + int result; + + result = send(ether_fd, buffer, size, MSG_DONTWAIT); + if (result < 0) { + // It appears that one retry is worthwhile, to clear pending + // errors or something. + result = send(ether_fd, buffer, size, MSG_DONTWAIT); + } +#if (DEBUG > 0) + fprintf(stderr, "rawether dbg: tx %d bytes -> %d\n", size, result); +#endif +#if (DEBUG > 1) + fprintf(stderr, " %x:%x:%x:%x:%x:%x %x:%x:%x:%x:%x:%x %x:%x\n", + buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], buffer[5], + buffer[6], buffer[7], buffer[8], buffer[9], buffer[10], buffer[11], + buffer[12], buffer[13]); +#endif +} + +// Receive a single ethernet frame, using the static rxbuffer. If the +// interface is not currently up discard it. Otherwise forward it on +// to ecosynth. + +static void +real_handle_rx(void) +{ + int size; + int result; + + size = recv(ether_fd, rx_buffer + 4, MTU, MSG_TRUNC); + +#if (DEBUG > 0) + fprintf(stderr, "rawether dbg: rx returned %d, errno %s (%d)\n", size, (errno < sys_nerr) ? sys_errlist[errno] : "", errno); +#endif + + if (size < 0) { + return; // Ignore errors, just go around the main loop again. + } + if ((size < 14) || (size > MTU)) { + return; // Invalid packet size. Discard the packet. + } + +#if (DEBUG > 1) + fprintf(stderr, " %x:%x:%x:%x:%x:%x %x:%x:%x:%x:%x:%x %x:%x\n", + rx_buffer[4], rx_buffer[5], rx_buffer[6], rx_buffer[7], rx_buffer[8], rx_buffer[9], + rx_buffer[10], rx_buffer[11], rx_buffer[12], rx_buffer[13], rx_buffer[14], rx_buffer[15], + rx_buffer[16], rx_buffer[17]); +#endif + + if (!up) { + // eCos is not currently expecting packets, so discard them. + // This may not actually be necessary because the interface + // is only up when eCos wants it to be up. + return; + } + + // It looks this packet should get forwarded to eCos. + rx_buffer[0] = SYNTH_ETH_RX; + rx_buffer[1] = 0; + rx_buffer[2] = size & 0x00FF; + rx_buffer[3] = (size >> 8) & 0x00FF; + do { + result = write(1, rx_buffer, 4 + size); + } while ((-1 == result) && (EINTR == errno)); + + if (result != (size + 4)) { + fprintf(stderr, "rawether(%s): failed to send ethernet packet to I/O auxiliary, exiting.\n", real_devname); + exit(1); + } +} + +// Utility to manipulate interface flags. This involves retrieving the +// current flags, or'ing in some bits, and'ing out others, and updating. +static void +real_update_ifflags(int set_bits, int clear_bits) +{ + struct ifreq request; + int flags; + + strncpy(request.ifr_name, real_devname, IFNAMSIZ); + if (ioctl(ether_fd, SIOCGIFFLAGS, &request) < 0) { + fprintf(stderr, "rawether (%s): failed to get interface flags, exiting\n", real_devname); + exit(1); + } + + flags = request.ifr_flags; + + flags |= set_bits; + flags &= ~clear_bits; + + if (flags == request.ifr_flags) { + // Nothing is changing. + return; + } + + strncpy(request.ifr_name, real_devname, IFNAMSIZ); + request.ifr_flags = flags; + if (ioctl(ether_fd, SIOCSIFFLAGS, &request) < 0) { + fprintf(stderr, "rawether (%s): failed to update interface flags, exiting\n", real_devname); + exit(1); + } +} + + +// Starting an interface. This involves bringing the interface up, +// and optionally setting promiscuous mode. +// NOTE: is UP really the right thing here? There is no IP address +// for this interface. In theory this should not matter because +// we have a bound socket which should receive all packets for +// this interface. + +static void +real_handle_start(int promiscuous) +{ + if (promiscuous) { + real_update_ifflags(IFF_UP | IFF_PROMISC, 0); + } else { + real_update_ifflags(IFF_UP, IFF_PROMISC); + } + up = 1; +} + +// Stopping an interface means clearing the UP flag +static void +real_handle_stop(void) +{ + up = 0; + real_update_ifflags(0, IFF_UP | IFF_PROMISC); +} + +// Enabling/disabling multicast support. +static void +real_handle_multiall(int on) +{ + struct packet_mreq req; + + req.mr_ifindex = real_ifindex; + req.mr_type = PACKET_MR_ALLMULTI; + req.mr_alen = 0; + if (setsockopt(ether_fd, SOL_PACKET, on ? PACKET_ADD_MEMBERSHIP : PACKET_DROP_MEMBERSHIP, (void*)&req, sizeof(req)) < 0) { + fprintf(stderr, "rawether (%s): failed to manipulate multicast-all flag, exiting\n", real_devname); + exit(1); + } +} + +// When the application exists make sure that the interface goes down again. + +static void +real_atexit(void) +{ + if (up) { + real_update_ifflags(0, IFF_UP | IFF_PROMISC); + } +} + +static void +real_init(char* devname) +{ + struct sockaddr_ll addr; + struct ifreq request; + + if (strlen(devname) >= IFNAMSIZ) { + snprintf(msg, MSG_SIZE, "Invalid real network device name \"%s\", too long.\n", devname); + report_error(msg); + } + strcpy(real_devname, devname); + + // All ioctl() operations need a socket. We might as well create the + // raw socket immediately and use that. + ether_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); + if (ether_fd < 0) { + snprintf(msg, MSG_SIZE, "Unable to create a raw socket for accessing network device\n" + " Error %s (errno %d)\n", (errno < sys_nerr) ? sys_errlist[errno] : "unknown", errno); + report_error(msg); + } + + strncpy(request.ifr_name, real_devname, IFNAMSIZ); + if (ioctl(ether_fd, SIOCGIFINDEX, &request) < 0) { + snprintf(msg, MSG_SIZE, "Device %s does not correspond to a valid interface.\n" + " Error %s (errno %d)\n", real_devname, (errno < sys_nerr) ? sys_errlist[errno] : "unknown", errno); + report_error(msg); + } + real_ifindex = request.ifr_ifindex; + + // The interface exists. Now check that it is usable. + strncpy(request.ifr_name, real_devname, IFNAMSIZ); + if (ioctl(ether_fd, SIOCGIFFLAGS, &request) < 0) { + snprintf(msg, MSG_SIZE, "Failed to get current interface flags for %s\n" + " Error %s (errno %d)\n", real_devname, (errno < sys_nerr) ? sys_errlist[errno] : "unknown", errno); + report_error(msg); + } + + if (request.ifr_flags & (IFF_UP | IFF_RUNNING)) { + snprintf(msg, MSG_SIZE, "Network device %s is already up and running.\n" + " Exclusive access is required\n", real_devname); + report_error(msg); + } + if (request.ifr_flags & IFF_LOOPBACK) { + report_error("Loopback devices cannot be used for synthetic target ethernet emulation.\n"); + } + if (request.ifr_flags & IFF_POINTOPOINT) { + report_error("Point-to-point devices cannot be used for synthetic target ethernet emulation.\n"); + } + if (request.ifr_flags & IFF_MULTICAST) { + multicast_supported = 1; + } + + // Make sure the interface is down. There is no point in receiving packets just yet. + real_update_ifflags(0, IFF_UP | IFF_PROMISC); + + // The flags look ok. Now get hold of the hardware address. + strncpy(request.ifr_name, real_devname, IFNAMSIZ); + if (ioctl(ether_fd, SIOCGIFHWADDR, &request) < 0) { + snprintf(msg, MSG_SIZE, "Failed to get hardware address for %s\n" + " Error %s (errno %d)\n", real_devname, (errno < sys_nerr) ? sys_errlist[errno] : "unknown", errno); + report_error(msg); + } + if (ARPHRD_ETHER != request.ifr_hwaddr.sa_family) { + snprintf(msg, MSG_SIZE, "Device %s is not an ethernet device.\n", real_devname); + report_error(msg); + } + memcpy(MAC, request.ifr_hwaddr.sa_data, 6); + + // The device is useable. Now just bind the socket to the appropriate address. + addr.sll_family = AF_PACKET; + addr.sll_protocol = htons(ETH_P_ALL); + addr.sll_ifindex = real_ifindex; + if (bind(ether_fd, (struct sockaddr*) &addr, sizeof(addr)) < 0) { + snprintf(msg, MSG_SIZE, "Failed to bind socket for direct hardware address to %s\n" + " Error %s (errno %d)\n", real_devname, (errno < sys_nerr) ? sys_errlist[errno] : "unknown", errno); + report_error(msg); + } + + // Make sure the interface gets shut down when rawether exits. + atexit(real_atexit); + + // And that should be it. +} + +// ---------------------------------------------------------------------------- +// Ethertap device. +// +// See /usr/src/linux-2.x.y/Documentation/networking/tuntap.txt for more +// information on the tun/tap driver. +// +// Basically during initialization this code opens /dev/net/tun, then +// performs a TUNSETIFF ioctl() to initialize it. This causes a +// new network device tap?? to appear. Any ethernet frames written +// by the Linux kernel to this device can be read from the +// dev/net/tun file descriptor, and ethernet frames can be written to +// the same descriptor. The net effect is a virtual ethernet segment +// with one interface managed by the Linux kernel and another +// interface (or, theoretically, several) accessible via the file +// descriptor. +// +// The Linux kernel will invent a MAC address for its interface. An +// additional one is needed for eCos. This is either invented or +// specified in the target definition file. + +static void +tap_handle_tx(unsigned char* buffer, int size) +{ + int result; + + result = write(ether_fd, buffer, size); +#if (DEBUG > 0) + fprintf(stderr, "rawether dbg: tx %d bytes -> %d\n", size, result); +#endif +#if (DEBUG > 1) + fprintf(stderr, " %x:%x:%x:%x:%x:%x %x:%x:%x:%x:%x:%x %x:%x\n", + buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], buffer[5], + buffer[6], buffer[7], buffer[8], buffer[9], buffer[10], buffer[11], + buffer[12], buffer[13]); +#endif +} + +// Receive a single packet from the socket. It is assumed that the +// tuntap code inside the kernel will preserve packet boundaries. +// +// For now it is assumed that all incoming packets are intended for +// eCos. That may not be accurate, and additional filtering in +// software might be appropriate. In promiscuous mode all packets +// should be accepted, obviously. Otherwise all broadcasts should +// be accepted, as should all messages intended for this specific +// interface's MAC address. Multicasts should be accepted only if +// enabled. +static void +tap_handle_rx(void) +{ + int size; + int result; + + // select() has succeeded so this read() should never block. + size = read(ether_fd, rx_buffer + 4, MTU); +#if (DEBUG > 0) + fprintf(stderr, "rawether dbg: rx returned %d, errno %s (%d)\n", size, (errno < sys_nerr) ? sys_errlist[errno] : "", errno); +#endif + + if (size < 0) { + return; // Ignore errors, just go around the main loop again. + } + if ((size < 14) || (size > MTU)) { + return; // Invalid packet size. Discard the packet. + } + +#if (DEBUG > 1) + fprintf(stderr, " %x:%x:%x:%x:%x:%x %x:%x:%x:%x:%x:%x %x:%x\n", + rx_buffer[4], rx_buffer[5], rx_buffer[6], rx_buffer[7], rx_buffer[8], rx_buffer[9], + rx_buffer[10], rx_buffer[11], rx_buffer[12], rx_buffer[13], rx_buffer[14], rx_buffer[15], + rx_buffer[16], rx_buffer[17]); +#endif + + if (!up) { + // eCos is not currently expecting packets, so discard them. + return; + } + + // It looks this packet should get forwarded to eCos. + rx_buffer[0] = SYNTH_ETH_RX; + rx_buffer[1] = 0; + rx_buffer[2] = size & 0x00FF; + rx_buffer[3] = (size >> 8) & 0x00FF; + do { + result = write(1, rx_buffer, 4 + size); + } while ((-1 == result) && (EINTR == errno)); + + if (result != (size + 4)) { + fprintf(stderr, "rawether(%s): failed to send ethernet packet to I/O auxiliary, exiting.\n", real_devname); + exit(1); + } +} + +// Nothing much can be done for start or stop. Just set the flag and +// let the rx and tx code discard packets when appropriate. +// +// For now the device is implicitly promiscuous and accepts all +// multicasts. Given the nature of a tap device it is unlikely that +// any packets will arrive which are not destined here. +// FIXME: this may have to change if bridging is enabled. +static void +tap_handle_start(int promiscuous) +{ + up = 1; +} + +static void +tap_handle_stop(void) +{ + up = 0; +} + +static void +tap_handle_multiall(int on) +{ +} + +static void tap_init(int argc, char** argv) +{ + char* devname = NULL; + struct ifreq ifr; + + // Which device? By default let the system pick one, but the user + // can override this. + if (0 != argc) { + devname = argv[0]; + } + + // Work out the MAC address. By default a random one is generated, + // but the user can specify one to avoid a source of randomness. + // This MAC address is not actually needed by any of the code here, + // but should be returned to eCos. + if (2 == argc) { + unsigned int mac_data[6]; // sscanf() needs unsigned ints + int result = sscanf(argv[1], "%x:%x:%x:%x:%x:%x", + &(mac_data[0]), &(mac_data[1]), &(mac_data[2]), + &(mac_data[3]), &(mac_data[4]), &(mac_data[5])); + if (6 != result) { + snprintf(msg, MSG_SIZE, "Invalid MAC address %s\n", argv[1]); + report_error(msg); + } + MAC[0] = mac_data[0]; + MAC[1] = mac_data[1]; + MAC[2] = mac_data[2]; + MAC[3] = mac_data[3]; + MAC[4] = mac_data[4]; + MAC[5] = mac_data[5]; + } else { + srand(time(NULL)); + MAC[0] = 0; + MAC[1] = 0x0FF; + MAC[2] = rand() & 0x0FF; + MAC[3] = rand() & 0x0FF; + MAC[4] = rand() & 0x0FF; + MAC[5] = rand() & 0x0FF; + } + + ether_fd = open("/dev/net/tun", O_RDWR); + if (ether_fd < 0) { + snprintf(msg, MSG_SIZE, "Failed to open /dev/net/tun, errno %s (%d)\n", (errno < sys_nerr) ? sys_errlist[errno] : "", errno); + report_error(msg); + } + + memset(&ifr, 0, sizeof(ifr)); + ifr.ifr_flags = IFF_TAP | IFF_NO_PI; + if (NULL != devname) { + strncpy(ifr.ifr_name, devname, IFNAMSIZ - 1); + } + if (ioctl(ether_fd, TUNSETIFF, (void*)&ifr) < 0) { + snprintf(msg, MSG_SIZE, "Failed to initialize /dev/net/tun, errno %s (%d)\n", (errno < sys_nerr) ? sys_errlist[errno] : "", errno); + report_error(msg); + } + + // Supporting multicasts is a no-op + multicast_supported = 1; + + // All done. +} + +// ---------------------------------------------------------------------------- +// Receive a single request from ecosynth. This consists of a four-byte +// header, optionally followed by a tx packet. EOF indicates that +// ecosynth has exited, so this process should just exit immediately +// as well. Any problems should be reported to stderr, followed by +// termination. +// +// Currently rawether is single-threaded. Theoretically this could +// cause a deadlock situation where the I/O auxiliary is trying to send +// rawether a request and is blocked on the write, while rawether is trying +// to send data to the I/O auxiliary. In practice the pipes should do +// enough buffering to avoid complications, especially since rawether +// gives priority to requests from the auxiliary. + +static void +handle_ecosynth_request(void) +{ + unsigned char req[4]; + int result; + int code, arg, size; + + result = read(0, req, 4); + if (result == 0) { + // select() succeeded but no data. EOF. So exit + exit(0); + } + if (result < 0) { + // EINTR? EAGAIN? The latter should not happen since the pipe + // has not been put into non-blocking mode. + if ((EINTR == errno) || (EAGAIN == errno)) { + return; + } else { + fprintf(stderr, "rawether: unexpected error reading request from ecosynth\n"); + if (errno < sys_nerr) { + fprintf(stderr, " %s\n", sys_errlist[errno]); + } + exit(1); + } + } + if (result < 4) { + fprintf(stderr, "rawether: unexpected error reading request from ecosynth\n Expected 4 bytes, only received %d\n", result); + exit(1); + } + + code = req[0]; + arg = req[1]; + size = req[2] + (req[3] << 8); + +#if (DEBUG > 1) + fprintf(stderr, "rawether dbg: request %x from auxiliary\n", code); +#endif + + switch(code) { + case SYNTH_ETH_TX: + { + if (size < 14) { + fprintf(stderr, "rawether: attempt to send invalid ethernet packet of only %d bytes\n" + "Ethernet packets should be at least 14 bytes.\n", size); + exit(1); + } + if (size > MTU) { + fprintf(stderr, "rawether: attempt to send invalid ethernet packet of %d bytes\n" + "Only packets of up to %d bytes are supported.\n", size, MTU); + exit(1); + } + do { + result = read(0, tx_buffer, size); + } while ((-1 == result) && (EINTR == errno)); + if (0 == result) { + // EOF, at an inopportune moment + exit(0); + } + if (result < size) { + fprintf(stderr, "rawether: error reading ethernet packet from I/O auxiliary\n" + "Expected %d bytes but only read %d\n", size, result); + exit(1); + } + + if (real_ether) { + real_handle_tx(tx_buffer, size); + } else if (ethertap) { + tap_handle_tx(tx_buffer, size); + } + break; + } + case SYNTH_ETH_START: + { + if (real_ether) { + real_handle_start(arg); + } else if (ethertap) { + tap_handle_start(arg); + } + break; + } + + case SYNTH_ETH_STOP: + { + if (real_ether) { + real_handle_stop(); + } else if (ethertap) { + tap_handle_stop(); + } + break; + } + + case SYNTH_ETH_MULTIALL: + { + if (real_ether) { + real_handle_multiall(arg); + } else if (ethertap) { + tap_handle_multiall(arg); + } + break; + } + + // SYNTH_ETH_RX and SYNTH_ETH_GETPARAMS are handled inside ethernet.tcl + + default: + fprintf(stderr, "rawether: protocol violation, received unknown request %d\n", code); + exit(1); + } +} + +// The main loop. This waits for an event either from ecosynth or from +// the underlying ethernet device, using select. Requests from +// ecosynth are handled, and take priority to prevent the connecting +// pipe from filling up and ecosynth blocking. Incoming ethernet +// frames are forwarded to ecosynth. + +static void +mainloop(void) +{ + fd_set read_set; + struct timeval timeout; + int result; + + for ( ; ; ) { + FD_ZERO(&read_set); + FD_SET(0, &read_set); + FD_SET(ether_fd, &read_set); + timeout.tv_sec = 24 * 60 * 60; + timeout.tv_usec = 0; + + result = select(ether_fd + 1, &read_set, NULL, NULL, &timeout); + if (result <= 0) { + continue; + } + + if (FD_ISSET(0, &read_set)) { + handle_ecosynth_request(); + } else if (FD_ISSET(ether_fd, &read_set)) { + if (real_ether) { + real_handle_rx(); + } else { + tap_handle_rx(); + } + } + } +} + +// ---------------------------------------------------------------------------- + +int +main(int argc, char**argv) +{ + // Ignore incoming ctrl-C's. We are in the same process group as the + // eCos application which may sensibly be ctrl-C'd, but that should + // result in the auxiliary detecting EOF and closing the pipe to + // this process, which in turn causes this process to exit completely. + signal(SIGINT, SIG_IGN); + + if (2 > argc ) { + report_error("Expected at least one argument, \"real\" or \"ethertap\"\n"); + } + if (0 == strcmp("real", argv[1])) { + real_ether = 1; + real_init(argv[2]); + } else if (0 == strcmp("ethertap", argv[1])) { + ethertap = 1; + tap_init(argc - 2, argv + 2); + } else { + snprintf(msg, MSG_SIZE, "Invalid argument %s, expected \"real\" or \"ethertap\"\n", argv[1]); + report_error(msg); + } + + // If the device-specific initialization succeeded we must be set. + report_success(); + + mainloop(); + + return 0; +} + diff --git a/packages/devs/eth/synth/ecosynth/current/host/tonet.xbm b/packages/devs/eth/synth/ecosynth/current/host/tonet.xbm new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/host/tonet.xbm @@ -0,0 +1,4 @@ +#define tonet_width 8 +#define tonet_height 8 +static unsigned char tonet_bits[] = { + 0x00, 0x87, 0x95, 0xa5, 0xfd, 0xa5, 0x95, 0x87}; diff --git a/packages/devs/eth/synth/ecosynth/current/src/protocol.h b/packages/devs/eth/synth/ecosynth/current/src/protocol.h new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/src/protocol.h @@ -0,0 +1,72 @@ +#ifndef CYGONCE_DEVS_ETH_ECOSYNTH_PROTOCOL_H +#define CYGONCE_DEVS_ETH_ECOSYNTH_PROTOCOL_H + +//============================================================================= +// +// protocol.h +// +// Protocol between target-side and host-side ethernet support. +// +//============================================================================= +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 2002 Bart Veer +// +// 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 the +// copyright holder(s). +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//============================================================================= +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors:bartv +// Date: 2002-08-08 +// Purpose: Protocol definitions. +// Usage: #include "protocol.h" +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +// Transmit: no arguments, up to 1514 bytes of outgoing data, no reply expected. +#define SYNTH_ETH_TX 0x01 +// Receive: no arguments or data, the return code indicates whether or not +// there are more packets to follow, and the return data is up to 1514 bytes. +#define SYNTH_ETH_RX 0x02 +// Start: one argument, non-zero -> promiscuous mode. No reply. +#define SYNTH_ETH_START 0x03 +// Stop: no arguments or reply. +#define SYNTH_ETH_STOP 0x04 +// Settings: no arguments or data. The return code holds the interrupt vector. +// The return data is six bytes of MAC address, plus a single byte indicating +// whether or not multicasting is supported. +#define SYNTH_ETH_GETPARAMS 0x05 +// Enable/disable multicasting. One argument, enable/disable. +#define SYNTH_ETH_MULTIALL 0x06 + +#endif // CYGONCE_DEVS_ETH_ECOSYNTH_PROTOCOL.H diff --git a/packages/devs/eth/synth/ecosynth/current/src/syntheth.c b/packages/devs/eth/synth/ecosynth/current/src/syntheth.c new file mode 100644 --- /dev/null +++ b/packages/devs/eth/synth/ecosynth/current/src/syntheth.c @@ -0,0 +1,453 @@ +//========================================================================== +// +// syntheth.c +// +// Network device driver for the synthetic target +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 2002 Bart Veer +// +// 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 the +// copyright holder(s). +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 2002-08-07 +// +//####DESCRIPTIONEND#### +//========================================================================== + +#include + +#include +#include +#include +#include +#include + +#define __ECOS 1 +#include +#include +#include +#include + +#ifdef CYGPKG_NET +# include +#else +# define IFF_PROMISC 0 +#endif + +#include +#include "protocol.h" + +// ---------------------------------------------------------------------------- +// Device instances. The synthetic target ethernet package can support +// up to four ethernet devices, eth0 to eth3. A synth_eth structure +// holds the data that is specific to a given device. Each device +// needs an instance of this structure, followed by ETH_DRV_SC and +// NETDEVTAB_ENTRY macros. Another macro SYNTH_ETH_INSTANCE takes +// care of all that, to avoid unnecessary duplication of code here. +// +// NOTE: unfortunately this involves duplicating the eth_hwr_funs +// structure. This could be eliminated but it would require bypassing +// the ETH_DRV_SC macro. + +#define ETHERNET_MINTU 14 +#define ETHERNET_MAXTU 1514 + + +typedef struct synth_eth { + int synth_id; // Device id within the auxiliary + int up; // Has there been a call to start()? + int in_send; // Detect recursive calls + int tx_done; + unsigned long tx_key; // Allow mbuf's to be freed + volatile int rx_pending; // There is pending data. + int rx_len; // Length of buffered data. + unsigned char MAC[6]; // Obtained from the underlying ethernet device + cyg_vector_t interrupt; // Interrupt number allocated by the auxiliary + int multi_supported; // Does the driver support multicasting? + cyg_handle_t interrupt_handle; // Allow the ISR and DSR to be installed. + cyg_interrupt interrupt_data; + unsigned char tx_data[ETHERNET_MAXTU]; + unsigned char rx_data[ETHERNET_MAXTU]; +} synth_eth; + +#define SYNTH_ETH_INSTANCE( _number_) \ +static synth_eth synth_eth##_number_ = { \ + synth_id: -1, \ + up: 1, \ + in_send: 0, \ + tx_done: 0, \ + tx_key: 0L, \ + rx_pending: 0, \ + rx_len: 0, \ + MAC: { 0, 0, 0, 0, 0, 0 }, \ + interrupt: 0, \ + interrupt_handle: 0 \ +}; \ +ETH_DRV_SC(synth_eth_sc##_number_, \ + (void*) &synth_eth##_number_, \ + "eth" #_number_, \ + synth_eth_start, \ + synth_eth_stop, \ + synth_eth_ioctl, \ + synth_eth_can_send, \ + synth_eth_send, \ + synth_eth_recv, \ + synth_eth_deliver, \ + synth_eth_poll, \ + synth_eth_intvector); \ +NETDEVTAB_ENTRY(synth_eth_netdev##_number_, \ + "synth_eth" #_number_, \ + synth_eth_init, \ + &synth_eth_sc##_number_); + +#ifdef CYGVAR_DEVS_ETH_ECOSYNTH_ETH0 +SYNTH_ETH_INSTANCE(0); +#endif +#ifdef CYGVAR_DEVS_ETH_ECOSYNTH_ETH1 +SYNTH_ETH_INSTANCE(1); +#endif +#ifdef CYGVAR_DEVS_ETH_ECOSYNTH_ETH2 +SYNTH_ETH_INSTANCE(2); +#endif +#ifdef CYGVAR_DEVS_ETH_ECOSYNTH_ETH3 +SYNTH_ETH_INSTANCE(3); +#endif + +// ---------------------------------------------------------------------------- +// Data transmits. +// +// The eCos application will just send the data to the auxiliary, +// which will in turn pass it on to the rawether utility. There is no +// need for any response. Flow control is implicit: if the eCos +// application tries to send ethernet packets too quickly then those +// get passed on to the auxiliary, which in turn will pass them on to +// the rawether process. If rawether is still busy with the previous +// packet then the auxiliary will block on a pipe write, and in turn +// the eCos application will block. As long as rawether manages to +// complete its operations reasonably quickly these blocks should not +// be noticeable to the user. +// +// So can_send() should always return true for an interface that is up +// and running. The send operation needs to take the sg list, turn it +// into a single buffer, and transmit it to the auxiliary. At that +// point the transmission is already complete so eth_drv_dsr() should +// be called to call deliver() and release the buffer. +// +// However there are some complications. The first is polled operation, +// where eth_drv_dsr() is a no-op and should not really be called at +// all because there are no interrupts going off. The second is that +// calling eth_drv_dsr() directly will cause recursive operation: +// send() -> dsr -> can_send()/send() -> ... +// This is a bad idea, so can_send() has to check that we are not +// already inside a send(). Data transmission will proceed merrily +// once the send has returned. + +static int +synth_eth_can_send(struct eth_drv_sc* sc) +{ + synth_eth* eth = (synth_eth*)(sc->driver_private); + return synth_auxiliary_running && eth->up && !eth->in_send && !eth->tx_done; +} + +static void +synth_eth_send(struct eth_drv_sc* sc, + struct eth_drv_sg* sg_list, int sg_len, int total_len, + unsigned long key) +{ + synth_eth* eth = (synth_eth*)(sc->driver_private); + + CYG_PRECONDITION((total_len >= ETHERNET_MINTU) && (total_len <= ETHERNET_MAXTU), "Only normal-sized ethernet packets are supported"); + CYG_PRECONDITION(!eth->in_send && !eth->tx_done, "Ethernet device must not still be in use for transmits"); + + eth->in_send = 1; + eth->tx_key = key; + if (synth_auxiliary_running && eth->up) { + int i; + unsigned char* buf = eth->tx_data; + for (i = 0; i < sg_len; i++) { + memcpy(buf, (void*) sg_list[i].buf, sg_list[i].len); + buf += sg_list[i].len; + CYG_LOOP_INVARIANT(buf <= &(eth->tx_data[ETHERNET_MAXTU]), "sg list must not exceed ethernet MTU"); + } + CYG_POSTCONDITION(buf == &(eth->tx_data[total_len]), "sg list lengths should match total_len"); + + synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_TX, 0, 0, eth->tx_data, total_len, + (void*) 0, (unsigned char*)0, (int*)0, 0); + } + + // The transfer has now completed, one way or another, so inform + // the higher-level code immediately. + eth->tx_done = 1; + eth_drv_dsr(eth->interrupt, 0, (cyg_addrword_t) sc); + eth->in_send = 0; +} + +// ---------------------------------------------------------------------------- +// Receives. +// +// These are rather more complicated because there are real interrupts +// involved, and polling needs to be supported as well. The actual +// transfer of data from auxiliary to eCos happens inside deliver(), +// and the data is buffered up in the synth_eth structure. All that +// needs to be done here is scatter the existing data into the +// sg_list. If higher-level code has run out of space then the +// sg_list may contain null pointers. + +static void +synth_eth_recv(struct eth_drv_sc* sc, struct eth_drv_sg* sg_list, int sg_len) +{ + synth_eth* eth = (synth_eth*)(sc->driver_private); + unsigned char* buf = eth->rx_data; + int len = eth->rx_len; + int i; + + for (i = 0; i < sg_len; i++) { + if (0 == sg_list[i].buf) { + break; + } else if (len <= sg_list[i].len) { + memcpy((void*)sg_list[i].buf, buf, len); + break; + } else { + memcpy((void*)sg_list[i].buf, buf, sg_list[i].len); + buf += sg_list[i].len; + len -= sg_list[i].len; + } + } +} + +// The ISR does not have to do anything, the DSR does the real work. +static cyg_uint32 +synth_eth_isr(cyg_vector_t vector, cyg_addrword_t data) +{ + cyg_drv_interrupt_acknowledge(vector); + return CYG_ISR_CALL_DSR; +} + +// The DSR also does not have to do very much. The data argument is +// actually the eth_drv_sc structure, which must match the vector. +// Interrupts only go off when there are pending receives, so set the +// rx_pending flag and call the generic DSR to do the real work. +static void +synth_eth_dsr(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t data) +{ + struct eth_drv_sc* sc = (struct eth_drv_sc*) data; + synth_eth* eth = (synth_eth*)(sc->driver_private); + CYG_ASSERT(eth->interrupt == vector, "Interrupt vectors cannot change during a run"); + + eth->rx_pending = 1; + eth_drv_dsr(vector, count, data); +} + +// ---------------------------------------------------------------------------- +// Delivery. This is invoked by a thread inside the TCP/IP stack, or by +// the poll function. +static void +synth_eth_deliver(struct eth_drv_sc* sc) +{ + synth_eth* eth = (synth_eth*)(sc->driver_private); + + if (eth->tx_done) { + eth->tx_done = 0; + (*sc->funs->eth_drv->tx_done)(sc, eth->tx_key, 1); + } + while (eth->rx_pending) { + int more = 1; + eth->rx_pending = 0; + + while (more && eth->up && synth_auxiliary_running) { + synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_RX, 0, 0, (void*) 0, 0, + &more, eth->rx_data, &(eth->rx_len), ETHERNET_MAXTU); + CYG_LOOP_INVARIANT(!more || (0 != eth->rx_len), "Auxiliary must send at least one packet if several are available"); + if (eth->rx_len > 0) { + CYG_ASSERT((eth->rx_len >= ETHERNET_MINTU) && (eth->rx_len <= ETHERNET_MAXTU), "Only normal-sized ethernet packets are supported"); + // Inform higher-level code that data is available. + // This should result in a call to recv() with a + // suitable sg_list. If out of memory, recv() + // will see a null pointer. + (*sc->funs->eth_drv->recv)(sc, eth->rx_len); + } + }; + } +} + + +// ---------------------------------------------------------------------------- +// Polling support. Transmits are relatively straightforward because +// all the hard work is handled by send(). Receives are rather more +// complicated because interrupts are disabled so we never know when +// there is really pending data. However deliver() will do the right +// thing even if there is no data, so simply faking up an interrupt +// is enough. This does mean extra traffic between application and +// auxiliary, but polling does rather imply that. +static void +synth_eth_poll(struct eth_drv_sc* sc) +{ + synth_eth* eth = (synth_eth*)(sc->driver_private); + if (synth_auxiliary_running && eth->up) { + eth->rx_pending = 1; + } + synth_eth_deliver(sc); +} + +static int +synth_eth_intvector(struct eth_drv_sc* sc) +{ + synth_eth* eth = (synth_eth*)(sc->driver_private); + return eth->interrupt; +} + +// ---------------------------------------------------------------------------- +// ioctl()'s. +// +// SET_MAC_ADDRESS is not currently implemented, and probably should +// not be implemented because the underlying ethernet device may not +// support it. +// +// SET_MC_ALL is supported if the underlying hardware does. This is +// needed for IPV6 support. More selective multicasting via +// SET_MC_LIST is not supported, because it imposes too heavy a +// requirement on the underlying Linux device. SET_MC_LIST can be +// used to disable multicast support. +// +// GET_IF_STATS_UD and GET_IF_STATS are not currently implemented +static int +synth_eth_ioctl(struct eth_drv_sc* sc, unsigned long key, void* data, int data_length) +{ + synth_eth* eth = (synth_eth*)(sc->driver_private); + int result = EINVAL; + + switch(key) { + case ETH_DRV_SET_MC_ALL: + { + if (eth->multi_supported) { + synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_MULTIALL, 1, 0, (unsigned char*) 0, 0, + (void*)0, (unsigned char*)0, (int*)0, 0); + result = 0; + } + break; + } + case ETH_DRV_SET_MC_LIST: + { + struct eth_drv_mc_list* mcl = (struct eth_drv_mc_list*) data; + if (eth->multi_supported && (0 == mcl->len)) { + synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_MULTIALL, 0, 0, (unsigned char*) 0, 0, + (void*)0, (unsigned char*)0, (int*)0, 0); + result = 0; + } + break; + } + default: + break; + } + + return result; +} + +// ---------------------------------------------------------------------------- +// Starting and stopping an interface. This includes restarting in +// promiscuous mode. +static void +synth_eth_start(struct eth_drv_sc* sc, unsigned char* enaddr, int flags) +{ + synth_eth* eth = (synth_eth*)(sc->driver_private); + + eth->up = 0; + eth->rx_pending = 0; + + if ((-1 != eth->synth_id) && synth_auxiliary_running) { + synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_START, flags & IFF_PROMISC, 0, (void*) 0, 0, + (int*)0, (void*) 0, (int*) 0, 0); + } + eth->up = 1; + if (enaddr != (unsigned char*)0) { + memcpy(enaddr, eth->MAC, 6); + } +} + +static void +synth_eth_stop(struct eth_drv_sc* sc) +{ + synth_eth* eth = (synth_eth*)(sc->driver_private); + + eth->up = 0; + if ((-1 != eth->synth_id) && synth_auxiliary_running) { + synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_STOP, 0, 0, (void*) 0, 0, + (int*) 0, (void*) 0, (int*) 0, 0); + } + eth->rx_pending = 0; +} + + +// ---------------------------------------------------------------------------- +// Initialization. +// +// This requires instantiating a device of class ethernet with a specific +// device name held in the eth_drv_sc structure. No additional device data +// is needed. If a device can be instantiated then the interrupt vector +// and the MAC address can be obtained, and an interrupt handler can be +// installed. +static bool +synth_eth_init(struct cyg_netdevtab_entry* ndp) +{ + bool result = false; + struct eth_drv_sc* sc = (struct eth_drv_sc*)(ndp->device_instance); + struct synth_eth* eth = (struct synth_eth*)(sc->driver_private); + + if (synth_auxiliary_running) { + eth->synth_id = synth_auxiliary_instantiate("devs/eth/synth/ecosynth", SYNTH_MAKESTRING(CYGPKG_DEVS_ETH_ECOSYNTH), "ethernet", + sc->dev_name, (const char*) 0); + + if (-1 != eth->synth_id) { + unsigned char data[7]; + result = true; + synth_auxiliary_xchgmsg(eth->synth_id, SYNTH_ETH_GETPARAMS, 0, 0, (const unsigned char*) 0, 0, + &(eth->interrupt), data, 0, 7); + memcpy(eth->MAC, data, 6); + eth->multi_supported = data[6]; + cyg_drv_interrupt_create(eth->interrupt, + 0, + (CYG_ADDRWORD) sc, + &synth_eth_isr, + &synth_eth_dsr, + &(eth->interrupt_handle), + &(eth->interrupt_data)); + cyg_drv_interrupt_attach(eth->interrupt_handle); + cyg_drv_interrupt_unmask(eth->interrupt); + } + } + (*sc->funs->eth_drv->init)(sc, eth->MAC); + return result; +} diff --git a/packages/devs/watchdog/synth/current/ChangeLog b/packages/devs/watchdog/synth/current/ChangeLog new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/synth/current/ChangeLog @@ -0,0 +1,36 @@ +2002-09-04 Bart Veer + + * Synthetic target watchdog package created + +//=========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 2002 Bart Veer +// +// 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. +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//=========================================================================== + diff --git a/packages/devs/watchdog/synth/current/cdl/synth_watchdog.cdl b/packages/devs/watchdog/synth/current/cdl/synth_watchdog.cdl new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/synth/current/cdl/synth_watchdog.cdl @@ -0,0 +1,108 @@ +# ==================================================================== +# +# synth_watchdog.cdl +# +# Synthetic target watchdog package. +# +# ==================================================================== +#####ECOSGPLCOPYRIGHTBEGIN#### +## ------------------------------------------- +## This file is part of eCos, the Embedded Configurable Operating System. +## Copyright (C) 2002 Bart Veer +## +## 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 the +## copyright holder(s). +## ------------------------------------------- +#####ECOSGPLCOPYRIGHTEND#### +# ==================================================================== +######DESCRIPTIONBEGIN#### +# +# Author(s): bartv +# Original data: bartv +# Contributors: +# Date: 2002-08-07 +# +#####DESCRIPTIONEND#### +# ==================================================================== + +cdl_package CYGPKG_DEVS_WATCHDOG_SYNTH { + display "Synthetic target watchdog support" + description " + The watchdog driver for the eCos synthetic target provides + emulation of a watchdog device: if the eCos application starts + the watchdog and fails to reset it regularly then the host-side + support will detect this and kill the eCos application with a + SIGPWR signal." + + parent CYGPKG_IO_WATCHDOG + implements CYGINT_WATCHDOG_HW_IMPLEMENTATIONS + implements CYGINT_WATCHDOG_RESETS_ON_TIMEOUT + + cdl_option CYGIMP_WATCHDOG_HARDWARE { + parent CYGPKG_IO_WATCHDOG_IMPLEMENTATION + display "use \"hardware\" watchdog" + default_value 1 + implements CYGINT_WATCHDOG_IMPLEMENTATIONS + compile synth_watchdog.cxx + description " + eCos provides several implementations of a watchdog device. + The default is to use the \"hardware\" implementation, which + for the synthetic target involves interacting with a + watchdog.tcl script running inside the I/O auxiliary." + } + + cdl_component CYGPKG_DEVS_WATCHDOG_SYNTH_OPTIONS { + display "Build options" + active_if CYGIMP_WATCHDOG_HARDWARE + flavor none + + description " + Package-specific build options including control over compiler + flags used only in building this package." + + cdl_option CYGPKG_DEVS_WATCHDOG_SYNTH_CFLAGS_ADD { + display "Additional compiler flags" + flavor data + no_define + default_value { "" } + description " + This option modifies the set of compiler flags for + building this package. These flags are used in addition + to the set of global flags." + } + cdl_option CYGPKG_DEVS_WATCHDOG_SYNTH_CFLAGS_REMOVE { + display "Suppressed compiler flags" + flavor data + no_define + default_value { "" } + description " + This option modifies the set of compiler flags for + building this package. These flags are removed from + the set of global flags if present." + } + } +} + diff --git a/packages/devs/watchdog/synth/current/doc/asleep.gif b/packages/devs/watchdog/synth/current/doc/asleep.gif new file mode 100644 index 0000000000000000000000000000000000000000..738290f78f857fe3c8af532d77fb8953216e334f GIT binary patch literal 19131 zc$}qsd0bOx+V;sx0s%r;3=lLdfe66{5-^~36862IRzYYRwy+l2w6(Qu2oZ=x$|gpP z4j{F5ik8I<+vx;|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TXHg76xzKa}CJ$U0#vg(@SNiqv4wD%oVSRNh)#U;C*$h4{9Zd>z9I77W$QgeROhmxcqAs>23Roy#oI>L( z2xhK)hs{PdkEdW9xB{ErK&@)fKlCh;1>Y3~`)Syg8Jb6cz)RSJFV1fN>eIJ=`RTj= X+v4lb&Z2wLfBW(O_Bli%w(kD{-TV-w diff --git a/packages/devs/watchdog/synth/current/doc/awake.gif b/packages/devs/watchdog/synth/current/doc/awake.gif new file mode 100644 index 0000000000000000000000000000000000000000..c3820843539183c6caa6fb62c9f37cb253aa42f9 GIT binary patch literal 18699 zc$}?!d0bO>y8g*ZLP87)OV~7t35!Gtix?I=NeId&vQ&kt7jVS@q=;HATH66cYZcq7UB;QYxxe>&f?e*tfByXI{hT1*C(rY|+c}4& z;Y(xz$-A(>VZZ)2Mj{a{sbr=lm0?AvFlZLDSynbybVn--F2l;!n&HHu&9S#(P`NC+ zBa`aPqT7>+TrSgz%XGH4;@DZ+IC7nwIL@=3ZFxMNr8Uo4K;_S3xUr}r8_GNvri4ou z*)x3|oh2*>S3A34mfa#NjxWb1kjwI8k>?A^5;uy}mE0&+C(cZ_IDVWW7^{^5PZN+mPJwAnF_hsP!Qd&Gb7C0QN=N3>cjiSf+*H=$l~h4I z-8GTokwo=Kpf8HBToh{WpU9Z|9w%7o=CgiGFwkS+;b7?ny{kx7Xwprplnr*9=^7m`yp z(U-@^hptXvx?y`%&R^H2r>@BTAUZogHF?eYjqCk36fN9RzHmo_XYPj!{(2;I*S@v8 zDiR9xYd@%t$ltC0pfdSy)q#4_;xdw_rcho*l2>Be43q)`IY766p8kw`(P@dHW8v=8 z{)RJwrKbaRt$yY0ffen3d%6N@J_{>qT2tH@T6Q|3;&k}#BO#UT5g)cMt8NdiKKpL@ zvG;0D$JMm2u4|93`ZP^fmr-&cy|ih4=|}l{>M|-1udi&$s5+Xq_mlOt$FmQf-P-WU zmXA9&H=o;j=`^9-*Ja~37oRN9@PUoh{&SZvL^uY^Tf4FyI=da&? zeW~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wd4(&>C}n*m3681tfOv?dEW#Azpa7AYA~Q+TaT|ff6`;0Tr`|{nOB& zua5vhP!!VvP+;D4?;mhP{yCq`k2w<0WeuX7N6UXRDpbzDHzZ)Z9hI(tyxUOTK#YLw zfpg}cft+t3?PebEGZ#F-llyGA0k8istw5ctM7)fZrY^0+>uwp|k2;<}BPd5f8iG+b W(}p||jI>)VVj6ziI)y^Ug8m;qr8Ud| diff --git a/packages/devs/watchdog/synth/current/doc/devs-watchdog-synth.html b/packages/devs/watchdog/synth/current/doc/devs-watchdog-synth.html new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/synth/current/doc/devs-watchdog-synth.html @@ -0,0 +1,526 @@ + + + + + + + + +Synthetic Target Watchdog Device +

Synthetic Target Watchdog Device

Name

Synthetic Target Watchdog Device -- Emulate watchdog hardware in the synthetic target

Overview

Some target hardware comes equipped with a watchdog timer. Application +code can start this timer and after a certain period of time, +typically a second, the watchdog will trigger. Usually this causes the +hardware to reboot. The application can prevent this by regularly +resetting the watchdog. An automatic reboot can be very useful when +deploying hardware in the field: a hardware glitch could cause the +unit to hang; or the software could receive an unexpected sequence of +inputs, never seen in the laboratory, causing the system to lock up. +Often the hardware is still functional, and a reboot sorts out the +problem with only a brief interruption in service. +

The synthetic target watchdog package emulates watchdog hardware. +During system initialization watchdog device will be instantiated, +and the watchdog.tcl script will be loaded by the +I/O auxiliary. When the eCos application starts the watchdog device, +the watchdog.tcl script will start checking the +state of the eCos application at one second intervals. A watchdog +reset call simply involves a message to the I/O auxiliary. If the +watchdog.tcl script detects that a second has +elapsed +without a reset then it will send a SIGPWR signal +to the eCos application, causing the latter to terminate. If gdb is +being used to run the application, the user will get a chance to +investigate what is happening. This behaviour is different from real +hardware in that there is no automatic reboot, but the synthetic +target is used only for development purposes, not deployment in the +field: if a reboot is desired then this can be achieved very easily +by using gdb commands to run another instance of the application. +

Installation

Before a synthetic target eCos application can use a watchdog device +it is necessary to build and install host-side support. The relevant +code resides in the host +subdirectory of the synthetic target watchdog package, and building it +involves the standard configure, +make and make install steps. The +implementation of the watchdog support does not require any +executables, just a Tcl script watchdog.tcl and +some support files, so the make step is a no-op. +

There are two main ways of building the host-side software. It is +possible to build both the generic host-side software and all +package-specific host-side software, including the watchdog support, +in a single build tree. This involves using the +configure script at the toplevel of the eCos +repository. For more information on this, see the +README.host file at the top of the repository. +Note that if you have an existing build tree which does not include +the synthetic target watchdog support then it will be necessary to +rerun the toplevel configure script: the search for appropriate +packages happens at configure time. +

The alternative is to build just the host-side for this package. +This requires a separate build directory, building directly in the +source tree is disallowed. The configure options +are much the same as for a build from the toplevel, and the +README.host file can be consulted for more +details. It is essential that the watchdog support be configured with +the same --prefix option as other eCos host-side +software, especially the I/O auxiliary provided by the architectural +synthetic target HAL package, otherwise the I/O auxiliary will be +unable to locate the watchdog support. +

Target-side +Configuration

The watchdog device depends on the generic watchdog support, +CYGPKG_IO_WATCHDOG: if the generic support is +absent then the watchdog device will be inactive. Some templates +include this generic package by default, but not all. If the +configuration does not include the generic package then it can be +added using the eCos configuration tools, for example: +

$ ecosconfig add CYGPKG_IO_WATCHDOG

By default the configuration will use the hardware-specific support, +i.e. this package. However the generic watchdog package contains an +alternative implementation using the kernel alarm facility, and that +implementation can be selected if desired. However usually it will be +better to rely on an external watchdog facility as provided by the I/O +auxiliary and the watchdog.tcl script: if there +are serious problems within the application, for example memory +corruption, then an internal software-only implementation will not be +reliable. +

The watchdog resolution is currently fixed to one second: if the +device does not receive a reset signal at least once a second then +the watchdog will trigger and the eCos application will be terminated +with a SIGPWR signal. The current implementation +does not allow this resolution to be changed. +

On some targets the watchdog device does not perform a hard reset. +Instead the device works more or less via the interrupt subsystem, +allowing application code to install action routines that will be +called when the watchdog triggers. The synthetic target watchdog +support effectively does perform a hard reset, by sending a +SIGPWR signal to the eCos application, and there is +no support for action routines. +

The synthetic target watchdog package provides some configuration +options for manipulating the compiler flags used for building the +target-side code. That code is fairly simple, so for nearly all +applications the default flags will suffice. +

It should be noted that the watchdog device is subject to selective +linking. Unless some code explicitly references the device, for +example by calling the start and reset functions, the watchdog support +will not appear in the final executable. This is desirable because a +watchdog device has no effect until started. +

Wallclock versus Elapsed Time

On real hardware the watchdog device uses wallclock time: if the +device does not receive a reset signal within a set period of time +then the watchdog will trigger. When developing for the synthetic +target this is not always appropriate. There may be other processes +running, using up some or most of the cpu time. For example, the +application may be written such that it will issue a reset after some +calculations which are known to complete within half a second, well +within the one-second resolution of the watchdog device. However if +other Linux processes are running then the synthetic target +application may get timesliced, and half a second of computation may +take several seconds of wallclock time. +

Another problem with using wallclock time is that it interferes with +debugging: if the application hits a breakpoint then it is unlikely +that the user will manage to restart it in less than a second, and the +watchdog will not get reset in time. +

To avoid these problems the synthetic target watchdog normally uses +consumed cpu time rather than wallclock time. If the application is +timesliced or if it is halted inside gdb then it does not consume any +cpu time. The application actually has to spend a whole second's worth +of cpu cycles without issuing a reset before the watchdog triggers. +

However using consumed cpu time is not a perfect solution either. If +the application makes blocking system calls then it is not using cpu +time. Interaction with the I/O auxiliary involves system calls, but +these should take only a short amount of time so their effects can be +ignored. If the application makes direct system calls such as +cyg_hal_sys_read then the system behaviour +becomes undefined. In addition by default the idle thread will make +blocking select system calls, effectively waiting +until an interrupt occurs. If an application spends much of its time +idle then the watchdog device may take much longer to trigger than +expected. It may be desirable to enable the synthetic target HAL +configuration option CYGIMP_HAL_IDLE_THREAD_SPIN, +causing the idle thread to spin rather than block, at the cost of +wasted cpu cycles. +

The default is to use consumed cpu time, but this can be changed in +the target definition file: +

synth_device watchdog {
+    use wallclock_time
+    …
+}

User Interface

When the synthetic target is run in graphical mode the watchdog device +extends the user interface in two ways. The Help +menu is extended with an entry for the watchdog-specific +documentation. There is also a graphical display of the current state +of the watchdog. Initially the watchdog is asleep: +

When application code starts the device the watchdog will begin to +keep an eye on things (or occasionally both eyes). +

If the watchdog triggers the display will change again, and optionally +the user can receive an audible alert. The location of the watchdog +display within the I/O auxiliary's window can be controlled via +a watchdog_pack entry in the target definition +file. For example the following can be used to put the watchdog +display to the right of the central text window: +

synth_device watchdog {
+    watchdog_pack -in .main.e -side top
+    …
+}

The user interface section of the generic synthetic target HAL +documentation can be consulted for more information on window packing. +

By default the watchdog support will not generate an audible alert +when the watchdog triggers, to avoid annoying colleagues. Sound can be +enabled in the target definition file, and two suitable files +sound1.au and sound2.au are +supplied as standard: +

synth_device watchdog {
+    sound sound1.au
+    …
+}

An absolute path can be specified if desired: +

synth_device watchdog {
+    sound /usr/share/emacs/site-lisp/emacspeak/sounds/default-8k/alarm.au
+    …
+}

Sound facilities are not built into the I/O auxiliary itself, instead +an external program is used. The default player is +play, a front-end to the +sox application shipped with some Linux +distributions. If another player should be used then this can be +specified in the target definition file: +

synth_device watchdog {
+    …
+    sound_player my_sound_player

The specified program will be run in the background with a single +argument, the sound file. +

Command Line Arguments

The watchdog support does not use any command line arguments. All +configuration is handled through the target definition file. +

Hooks

The watchdog support does not provide any hooks for use by other +scripts. There is rarely any need for customizing the system's +behaviour when a watchdog triggers because those should be rare +events, even during application development. +

Additional Tcl Procedures

The watchdog support does not provide any additional Tcl procedures or +variables for use by other scripts. +

\ No newline at end of file diff --git a/packages/devs/watchdog/synth/current/doc/makefile b/packages/devs/watchdog/synth/current/doc/makefile new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/synth/current/doc/makefile @@ -0,0 +1,34 @@ +#============================================================================= +# +# makefile +# +# For building the synthetic target watchdog package documentation +# +#============================================================================= +#####COPYRIGHTBEGIN#### +# +# =============================================================== +# Copyright (C) 2002 Bart Veer +# This material may be distributed only subject to the terms +# and conditions set forth in the Open Publication License, v1.0 +# or later (the latest version is presently available at +# http://www.opencontent.org/openpub/) +# =============================================================== +# +#####COPYRIGHTEND#### +#============================================================================= +#####DESCRIPTIONBEGIN#### +# +# Author(s): bartv +# Date: 2002-09-09 +#####DESCRIPTIONEND#### +#============================================================================= + +TOPLEVEL := ../../../../.. +MAIN_SGML := synth_watchdog.sgml +MAIN_HTML := devs-watchdog-synth.html +MAIN_PDF := devs-watchdog-synth.pdf +OTHER_SGML := +PICTURES := + +include $(TOPLEVEL)/pkgconf/rules.doc diff --git a/packages/devs/watchdog/synth/current/doc/synth_watchdog.sgml b/packages/devs/watchdog/synth/current/doc/synth_watchdog.sgml new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/synth/current/doc/synth_watchdog.sgml @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Synthetic Target Watchdog Device + + + Synthetic Target Watchdog Device + Emulate watchdog hardware in the synthetic target + + + Overview + +Some target hardware comes equipped with a watchdog timer. Application +code can start this timer and after a certain period of time, +typically a second, the watchdog will trigger. Usually this causes the +hardware to reboot. The application can prevent this by regularly +resetting the watchdog. An automatic reboot can be very useful when +deploying hardware in the field: a hardware glitch could cause the +unit to hang; or the software could receive an unexpected sequence of +inputs, never seen in the laboratory, causing the system to lock up. +Often the hardware is still functional, and a reboot sorts out the +problem with only a brief interruption in service. + + +The synthetic target watchdog package emulates watchdog hardware. +During system initialization watchdog device will be instantiated, +and the watchdog.tcl script will be loaded by the +I/O auxiliary. When the eCos application starts the watchdog device, +the watchdog.tcl script will start checking the +state of the eCos application at one second intervals. A watchdog +reset call simply involves a message to the I/O auxiliary. If the +watchdog.tcl script detects that a second has +elapsed +without a reset then it will send a SIGPWR signal +to the eCos application, causing the latter to terminate. If gdb is +being used to run the application, the user will get a chance to +investigate what is happening. This behaviour is different from real +hardware in that there is no automatic reboot, but the synthetic +target is used only for development purposes, not deployment in the +field: if a reboot is desired then this can be achieved very easily +by using gdb commands to run another instance of the application. + + + + Installation + +Before a synthetic target eCos application can use a watchdog device +it is necessary to build and install host-side support. The relevant +code resides in the host +subdirectory of the synthetic target watchdog package, and building it +involves the standard configure, +make and make install steps. The +implementation of the watchdog support does not require any +executables, just a Tcl script watchdog.tcl and +some support files, so the make step is a no-op. + + +There are two main ways of building the host-side software. It is +possible to build both the generic host-side software and all +package-specific host-side software, including the watchdog support, +in a single build tree. This involves using the +configure script at the toplevel of the eCos +repository. For more information on this, see the +README.host file at the top of the repository. +Note that if you have an existing build tree which does not include +the synthetic target watchdog support then it will be necessary to +rerun the toplevel configure script: the search for appropriate +packages happens at configure time. + + +The alternative is to build just the host-side for this package. +This requires a separate build directory, building directly in the +source tree is disallowed. The configure options +are much the same as for a build from the toplevel, and the +README.host file can be consulted for more +details. It is essential that the watchdog support be configured with +the same option as other eCos host-side +software, especially the I/O auxiliary provided by the architectural +synthetic target HAL package, otherwise the I/O auxiliary will be +unable to locate the watchdog support. + + + + Target-side +Configuration + +The watchdog device depends on the generic watchdog support, +CYGPKG_IO_WATCHDOG: if the generic support is +absent then the watchdog device will be inactive. Some templates +include this generic package by default, but not all. If the +configuration does not include the generic package then it can be +added using the eCos configuration tools, for example: + + +$ ecosconfig add CYGPKG_IO_WATCHDOG + + +By default the configuration will use the hardware-specific support, +i.e. this package. However the generic watchdog package contains an +alternative implementation using the kernel alarm facility, and that +implementation can be selected if desired. However usually it will be +better to rely on an external watchdog facility as provided by the I/O +auxiliary and the watchdog.tcl script: if there +are serious problems within the application, for example memory +corruption, then an internal software-only implementation will not be +reliable. + + +The watchdog resolution is currently fixed to one second: if the +device does not receive a reset signal at least once a second then +the watchdog will trigger and the eCos application will be terminated +with a SIGPWR signal. The current implementation +does not allow this resolution to be changed. + + +On some targets the watchdog device does not perform a hard reset. +Instead the device works more or less via the interrupt subsystem, +allowing application code to install action routines that will be +called when the watchdog triggers. The synthetic target watchdog +support effectively does perform a hard reset, by sending a +SIGPWR signal to the eCos application, and there is +no support for action routines. + + +The synthetic target watchdog package provides some configuration +options for manipulating the compiler flags used for building the +target-side code. That code is fairly simple, so for nearly all +applications the default flags will suffice. + + +It should be noted that the watchdog device is subject to selective +linking. Unless some code explicitly references the device, for +example by calling the start and reset functions, the watchdog support +will not appear in the final executable. This is desirable because a +watchdog device has no effect until started. + + + + Wallclock versus Elapsed Time + +On real hardware the watchdog device uses wallclock time: if the +device does not receive a reset signal within a set period of time +then the watchdog will trigger. When developing for the synthetic +target this is not always appropriate. There may be other processes +running, using up some or most of the cpu time. For example, the +application may be written such that it will issue a reset after some +calculations which are known to complete within half a second, well +within the one-second resolution of the watchdog device. However if +other Linux processes are running then the synthetic target +application may get timesliced, and half a second of computation may +take several seconds of wallclock time. + + +Another problem with using wallclock time is that it interferes with +debugging: if the application hits a breakpoint then it is unlikely +that the user will manage to restart it in less than a second, and the +watchdog will not get reset in time. + + +To avoid these problems the synthetic target watchdog normally uses +consumed cpu time rather than wallclock time. If the application is +timesliced or if it is halted inside gdb then it does not consume any +cpu time. The application actually has to spend a whole second's worth +of cpu cycles without issuing a reset before the watchdog triggers. + + +However using consumed cpu time is not a perfect solution either. If +the application makes blocking system calls then it is not using cpu +time. Interaction with the I/O auxiliary involves system calls, but +these should take only a short amount of time so their effects can be +ignored. If the application makes direct system calls such as +cyg_hal_sys_read then the system behaviour +becomes undefined. In addition by default the idle thread will make +blocking select system calls, effectively waiting +until an interrupt occurs. If an application spends much of its time +idle then the watchdog device may take much longer to trigger than +expected. It may be desirable to enable the synthetic target HAL +configuration option CYGIMP_HAL_IDLE_THREAD_SPIN, +causing the idle thread to spin rather than block, at the cost of +wasted cpu cycles. + + +The default is to use consumed cpu time, but this can be changed in +the target definition file: + + +synth_device watchdog { + use wallclock_time + … +} + + + + User Interface + +When the synthetic target is run in graphical mode the watchdog device +extends the user interface in two ways. The Help +menu is extended with an entry for the watchdog-specific +documentation. There is also a graphical display of the current state +of the watchdog. Initially the watchdog is asleep: + + + + + + + + + +When application code starts the device the watchdog will begin to +keep an eye on things (or occasionally both eyes). + + + + + + + + + +If the watchdog triggers the display will change again, and optionally +the user can receive an audible alert. The location of the watchdog +display within the I/O auxiliary's window can be controlled via +a watchdog_pack entry in the target definition +file. For example the following can be used to put the watchdog +display to the right of the central text window: + + +synth_device watchdog { + watchdog_pack -in .main.e -side top + … +} + + +The user interface section of the generic synthetic target HAL +documentation can be consulted for more information on window packing. + + +By default the watchdog support will not generate an audible alert +when the watchdog triggers, to avoid annoying colleagues. Sound can be +enabled in the target definition file, and two suitable files +sound1.au and sound2.au are +supplied as standard: + + +synth_device watchdog { + sound sound1.au + … +} + + +An absolute path can be specified if desired: + + +synth_device watchdog { + sound /usr/share/emacs/site-lisp/emacspeak/sounds/default-8k/alarm.au + … +} + + +Sound facilities are not built into the I/O auxiliary itself, instead +an external program is used. The default player is +play, a front-end to the +sox application shipped with some Linux +distributions. If another player should be used then this can be +specified in the target definition file: + + +synth_device watchdog { + … + sound_player my_sound_player + + +The specified program will be run in the background with a single +argument, the sound file. + + + + Command Line Arguments + +The watchdog support does not use any command line arguments. All +configuration is handled through the target definition file. + + + + Hooks + +The watchdog support does not provide any hooks for use by other +scripts. There is rarely any need for customizing the system's +behaviour when a watchdog triggers because those should be rare +events, even during application development. + + + + Additional Tcl Procedures + +The watchdog support does not provide any additional Tcl procedures or +variables for use by other scripts. + + + + diff --git a/packages/devs/watchdog/synth/current/host/Makefile.am b/packages/devs/watchdog/synth/current/host/Makefile.am new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/synth/current/host/Makefile.am @@ -0,0 +1,61 @@ +## Process this file with automake to produce Makefile.in +## ===================================================================== +## +## Makefile.am +## +## Build support for the host-side synthetic target support, +## the watchdog package +## +## ===================================================================== +######COPYRIGHTBEGIN#### +# +# ---------------------------------------------------------------------------- +# Copyright (C) 2002 Bart Veer +# +# This file is part of the eCos synthetic target ethernet support. +# +# This program 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 of the License, or (at your option) +# any later version. +# +# This program 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 +# this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# ---------------------------------------------------------------------------- +# +######COPYRIGHTEND#### +## ===================================================================== +#######DESCRIPTIONBEGIN#### +## +## Author(s): bartv +## Contact(s): bartv +## Date: 2002/09/04 +## Version: 0.01 +## +######DESCRIPTIONEND#### +## ===================================================================== + +AUTOMAKE_OPTIONS = 1.3 foreign + +## Only some platforms are supported. Having the configure script throw +## an error when attempting to configure on an unsupported platform +## would be a mistake, since that would prevent any configury from +## the toplevel on unsupported platforms. Instead an automake conditional +## is used, leading to null makefiles on unsupported platforms. + +if SUPPORTED + +## The only thing that needs to be installed is a Tcl script and some +## data files. +watchdogdir = $(libexecdir)/ecos/@PACKAGE_INSTALL@ +watchdog_DATA = watchdog.tcl \ + watchdog.tdf \ + alarm.gif doghouse.gif eye.gif asleep.gif \ + sound1.au sound2.au +endif diff --git a/packages/devs/watchdog/synth/current/host/Makefile.in b/packages/devs/watchdog/synth/current/host/Makefile.in new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/synth/current/host/Makefile.in @@ -0,0 +1,288 @@ +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +######COPYRIGHTBEGIN#### +# +# ---------------------------------------------------------------------------- +# Copyright (C) 2002 Bart Veer +# +# This file is part of the eCos synthetic target ethernet support. +# +# This program 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 of the License, or (at your option) +# any later version. +# +# This program 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 +# this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# ---------------------------------------------------------------------------- +# +######COPYRIGHTEND#### +#######DESCRIPTIONBEGIN#### +######DESCRIPTIONEND#### + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +CC = @CC@ +CXX = @CXX@ +ECOS_REPOSITORY = @ECOS_REPOSITORY@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MSVC_SRCDIR = @MSVC_SRCDIR@ +PACKAGE = @PACKAGE@ +PACKAGE_DIR = @PACKAGE_DIR@ +PACKAGE_INSTALL = @PACKAGE_INSTALL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +VERSION = @VERSION@ +ecos_CFLAGS = @ecos_CFLAGS@ +ecos_CXXFLAGS = @ecos_CXXFLAGS@ +ecos_INCLUDES = @ecos_INCLUDES@ +ecos_LDADD = @ecos_LDADD@ +ecos_LIBS = @ecos_LIBS@ +ecos_infra_incdir = @ecos_infra_incdir@ +ecos_infra_libdir = @ecos_infra_libdir@ +ecos_libcdl_incdir = @ecos_libcdl_incdir@ +ecos_libcdl_libdir = @ecos_libcdl_libdir@ +ecos_tk_libs = @ecos_tk_libs@ + +AUTOMAKE_OPTIONS = 1.3 foreign + +@SUPPORTED_TRUE@watchdogdir = @SUPPORTED_TRUE@$(libexecdir)/ecos/@PACKAGE_INSTALL@ +@SUPPORTED_TRUE@watchdog_DATA = @SUPPORTED_TRUE@watchdog.tcl \ +@SUPPORTED_TRUE@ watchdog.tdf \ +@SUPPORTED_TRUE@ alarm.gif doghouse.gif eye.gif asleep.gif \ +@SUPPORTED_TRUE@ sound1.au sound2.au +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../../../../../../acsupport/mkinstalldirs +CONFIG_CLEAN_FILES = +DATA = $(watchdog_DATA) + +DIST_COMMON = Makefile.am Makefile.in acinclude.m4 aclocal.m4 configure \ +configure.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 + cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +install-watchdogDATA: $(watchdog_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(watchdogdir) + @list='$(watchdog_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(watchdogdir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(watchdogdir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(watchdogdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(watchdogdir)/$$p; \ + fi; fi; \ + done + +uninstall-watchdogDATA: + @$(NORMAL_UNINSTALL) + list='$(watchdog_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(watchdogdir)/$$p; \ + done +tags: TAGS +TAGS: + + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-watchdogDATA +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-watchdogDATA +uninstall: uninstall-am +all-am: Makefile $(DATA) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(watchdogdir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + +distclean: distclean-am + -rm -f config.status + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + -rm -f config.status + +.PHONY: uninstall-watchdogDATA install-watchdogDATA tags distdir info-am \ +info dvi-am dvi check check-am installcheck-am installcheck \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/packages/devs/watchdog/synth/current/host/acinclude.m4 b/packages/devs/watchdog/synth/current/host/acinclude.m4 new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/synth/current/host/acinclude.m4 @@ -0,0 +1,45 @@ +dnl Process this file with aclocal to get an aclocal.m4 file. Then +dnl process that with autoconf. +dnl ==================================================================== +dnl +dnl acinclude.m4 +dnl +dnl ==================================================================== +dnl####COPYRIGHTBEGIN#### +dnl +dnl ---------------------------------------------------------------------------- +dnl Copyright (C) 2002 Bart Veer +dnl +dnl This file is part of the eCos host tools. +dnl +dnl This program is free software; you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License as published by the Free +dnl Software Foundation; either version 2 of the License, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but WITHOUT +dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +dnl more details. +dnl +dnl You should have received a copy of the GNU General Public License along with +dnl this program; if not, write to the Free Software Foundation, Inc., +dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +dnl ---------------------------------------------------------------------------- +dnl +dnl####COPYRIGHTEND#### +dnl ==================================================================== +dnl#####DESCRIPTIONBEGIN#### +dnl +dnl Author(s): bartv +dnl Contact(s): bartv +dnl Date: 2002/09/04 +dnl Version: 0.01 +dnl +dnl####DESCRIPTIONEND#### +dnl ==================================================================== + +dnl Access shared macros. +dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not +dnl incorporate the macro into aclocal.m4 +sinclude(../../../../../../acsupport/acinclude.m4) diff --git a/packages/devs/watchdog/synth/current/host/aclocal.m4 b/packages/devs/watchdog/synth/current/host/aclocal.m4 new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/synth/current/host/aclocal.m4 @@ -0,0 +1,183 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4-p5 + +dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl Process this file with aclocal to get an aclocal.m4 file. Then +dnl process that with autoconf. +dnl ==================================================================== +dnl +dnl acinclude.m4 +dnl +dnl ==================================================================== +dnl####COPYRIGHTBEGIN#### +dnl +dnl ---------------------------------------------------------------------------- +dnl Copyright (C) 2002 Bart Veer +dnl +dnl This file is part of the eCos host tools. +dnl +dnl This program is free software; you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License as published by the Free +dnl Software Foundation; either version 2 of the License, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but WITHOUT +dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +dnl more details. +dnl +dnl You should have received a copy of the GNU General Public License along with +dnl this program; if not, write to the Free Software Foundation, Inc., +dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +dnl ---------------------------------------------------------------------------- +dnl +dnl####COPYRIGHTEND#### +dnl ==================================================================== +dnl#####DESCRIPTIONBEGIN#### +dnl +dnl Author(s): bartv +dnl Contact(s): bartv +dnl Date: 2002/09/04 +dnl Version: 0.01 +dnl +dnl####DESCRIPTIONEND#### +dnl ==================================================================== + +dnl Access shared macros. +dnl AM_CONDITIONAL needs to be mentioned here or else aclocal does not +dnl incorporate the macro into aclocal.m4 +sinclude(../../../../../../acsupport/acinclude.m4) + +# Define a conditional. + +AC_DEFUN([AM_CONDITIONAL], +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN([AM_MISSING_PROG], +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + diff --git a/packages/devs/watchdog/synth/current/host/alarm.gif b/packages/devs/watchdog/synth/current/host/alarm.gif new file mode 100644 index 0000000000000000000000000000000000000000..2c8c318b2c41a65e390e5dea1ff5d35fbb875f65 GIT binary patch literal 5083 zc$~$UTWlQF8OPV&I1Vw{HD&FytarWmvOD&iGhUBR;+&bRo!EqUy~IoEIQH(?9?v#b zS|vrj7#wI-bwVJ7Brn`rXrzjZpiqfI3qopmXvM9(R8_^LsA?sIsumvdQdN~&q@>?D zGwZ$j0;b|yYv=6joZtMv%lXc%$HosZEuZr2^Za|!1BRL!+L{}?S{t?2?K``C{qfcV zt&I~s&Eq@$<7#Ls=}+siqjGR*SNQw8Z=4xzJ2)yI8ttAts2&?{IdM3AduGS-k*3>o zt=5EmA}b%yv88$WPAjr}R9-&Hma^%S$5SW2Iko)l{HaXn!mRJ^+zk)RwVk>tcK4ig z_E_-2+k!t`3fy-*e)cx~%y;_kyMsM+2Y%?TJ>KQsQsS>weEnO~g$-jffWc>1xs zes%HdFFkqZ(--gk`BM+S{Oq|)zr6VB%g?>`g8kbU&%gf4qpx53**kCi2)q#$Njm^Xa)}Z z+7p5GNNd_`=dO;0#o4at;NG(HpCkLj{lg23Gi{@@n~c%n(Ej;3`AKIJQM3@d-A10KN z-3wpqxVCd&$rl^SJ}MZDdm1qXQw|>O+FFk`u7FR+vWl^cu?pj6pAL$st;(s+ty{Nm zjKm=t%+fT<58S$aJ(LE8q`qj>-?%;q7z$yO6SONfT`|coQ5<);irTwvb(9DMyvH!r zlC;udem{v5F~ng?TE24Ywl8ap(ZwM;8# z8vR6cgcy=x70GP~t=ra+$9&dgaE(JEFUA+<6=&Kgrg zD=n~Ekd85Pc1E!uYdCG0g{doP{aP$$$t|SP4s*mPl%MImmWaP3)xIr*FcDgoS_gb-qP$3sJz>OV$JEWct2kd zqOjp$Wp6!L*?f@h^nJ9eY`@^X^(w5eUErY^P~|#$6mYK=V54VWNoR!@iK!mAl zG+I=B8#uE!pmL`*#xw_n_==9VmtMNDUwrUf3VlJ;DN_oyPt?kXq79MY(VrIutMQ0YV@>;GiwFYMnf Ir#yT92hmnM(f|Me diff --git a/packages/devs/watchdog/synth/current/host/asleep.gif b/packages/devs/watchdog/synth/current/host/asleep.gif new file mode 100644 index 0000000000000000000000000000000000000000..24f4382d3bbea37fc4b6c8270e9a153519fa42cb GIT binary patch literal 283 zc${O#^#V#M9ctkeR%-#PVG>qj;Sfl40I6}A0aVk#$qZ7H08*pmBLULRA*|*j z0g@6@&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=watchdog.tcl + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../../../../../acsupport $srcdir/../../../../../../acsupport; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../../../../../acsupport $srcdir/../../../../../../acsupport" 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + + + echo $ac_n "checking that a separate build tree is being used""... $ac_c" 1>&6 +echo "configure:551: checking that a separate build tree is being used" >&5 + ecos_cwd=`/bin/pwd` + if test "${srcdir}" = "." ; then + srcdir=${ecos_cwd} + fi + if test "${ecos_cwd}" = "${srcdir}" ; then + echo "$ac_t""no" 1>&6 + { echo "configure: error: This configure script should not be run inside the source tree. Instead please use a separate build tree" 1>&2; exit 1; } + else + echo "$ac_t""yes" 1>&6 + fi + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:570: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:602: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:655: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:712: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=eCos_synthetic_target_watchdog + +VERSION=0.1 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi + + + +missing_dir=`cd $ac_aux_dir && pwd` +echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 +echo "configure:751: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:764: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:777: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:790: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:803: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:817: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +case "${host}" in + i[34567]86-*-linux-gnu* ) SUPPORTED="yes";; + * ) SUPPORTED="no" +esac + + +if test "${SUPPORTED}" = "yes"; then + SUPPORTED_TRUE= + SUPPORTED_FALSE='#' +else + SUPPORTED_TRUE='#' + SUPPORTED_FALSE= +fi + +if test "${SUPPORTED}" = "yes" ; then + + + package_dir=`cd ${srcdir} && /bin/pwd` + PACKAGE_VERSION=`dirname ${package_dir}` + PACKAGE_VERSION=`basename ${PACKAGE_VERSION}` + + package_dir=`dirname ${package_dir}` + package_dir=`dirname ${package_dir}` + + possibles="${package_dir}/.. ${package_dir}/../.. ${package_dir}/../../.. ${package_dir}/../../../.." + possibles="${possibles} ${package_dir}/../../../../.. ${package_dir}/../../../../../.." + + repository_root="" + for i in ${possibles}; do + if test -d "$i/"acsupport""; then + repository_root=$i + break + fi + done + + if test "${repository_root}" = "" ; then + { echo "configure: error: Failed to identify this package's position within the eCos repository" 1>&2; exit 1; } + fi + ECOS_REPOSITORY=`cd "${repository_root}/packages/pkgconf/.." && /bin/pwd` + + PACKAGE_DIR=`echo ${package_dir} | sed -e "s:${ECOS_REPOSITORY}/::"` + + PACKAGE_INSTALL="${PACKAGE_DIR}/${PACKAGE_VERSION}" + + + + + + +fi + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile:Makefile.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g +s%@SUPPORTED_TRUE@%$SUPPORTED_TRUE%g +s%@SUPPORTED_FALSE@%$SUPPORTED_FALSE%g +s%@ECOS_REPOSITORY@%$ECOS_REPOSITORY%g +s%@PACKAGE_DIR@%$PACKAGE_DIR%g +s%@PACKAGE_VERSION@%$PACKAGE_VERSION%g +s%@PACKAGE_INSTALL@%$PACKAGE_INSTALL%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/packages/devs/watchdog/synth/current/host/configure.in b/packages/devs/watchdog/synth/current/host/configure.in new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/synth/current/host/configure.in @@ -0,0 +1,73 @@ +dnl Process this file with autoconf to produce a configure script. +dnl ==================================================================== +dnl +dnl configure.in +dnl +dnl configure script for eCos synthetic target watchdog +dnl host-side support +dnl +dnl ==================================================================== +dnl####COPYRIGHTBEGIN#### +dnl +dnl ---------------------------------------------------------------------------- +dnl Copyright (C) 2002 Bart Veer +dnl +dnl This file is part of the eCos synthetic target support. +dnl +dnl This program is free software; you can redistribute it and/or modify it +dnl under the terms of the GNU General Public License as published by the Free +dnl Software Foundation; either version 2 of the License, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but WITHOUT +dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +dnl more details. +dnl +dnl You should have received a copy of the GNU General Public License along with +dnl this program; if not, write to the Free Software Foundation, Inc., +dnl 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +dnl ---------------------------------------------------------------------------- +dnl +dnl####COPYRIGHTEND#### +dnl ==================================================================== +dnl#####DESCRIPTIONBEGIN#### +dnl +dnl Author(s): bartv +dnl Contact(s): bartv +dnl Date: 2002/09/04 +dnl Version: 0.01 +dnl +dnl####DESCRIPTIONEND#### +dnl ==================================================================== + + +AC_INIT(watchdog.tcl) + +dnl Pick up the support files from the top-level acsupport directory. +AC_CONFIG_AUX_DIR(../../../../../../acsupport) + +ECOS_CHECK_BUILD_ne_SRC +AC_CANONICAL_HOST +AM_INIT_AUTOMAKE(eCos_synthetic_target_watchdog,0.1,0) +AM_MAINTAINER_MODE + +dnl The current version of the synthetic target is implemented only for +dnl x86 Linux platforms, so a test is appropriate here. However +dnl it is not a good idea for the configure script to report an error: +dnl that would prevent any top-level configury working for other +dnl platforms. Instead an automake conditional is used to suppress adding +dnl targets to the build. +case "${host}" in + i[[34567]]86-*-linux-gnu* ) SUPPORTED="yes";; + * ) SUPPORTED="no" +esac +AM_CONDITIONAL(SUPPORTED, test "${SUPPORTED}" = "yes") + +dnl The watchdog host-side support only involves a Tcl +dnl script and data files, so nothing needs to be compiled +if test "${SUPPORTED}" = "yes" ; then + ECOS_PACKAGE_DIRS +fi + +AC_OUTPUT(Makefile:Makefile.in) diff --git a/packages/devs/watchdog/synth/current/host/doghouse.gif b/packages/devs/watchdog/synth/current/host/doghouse.gif new file mode 100644 index 0000000000000000000000000000000000000000..a9ba8a6ef4628fdc1a0f5efb93fa6d471743082a GIT binary patch literal 14853 zc${r}eO#1fy8kn;jKe?!;y6xZkBIDqNCS;X=5c2b2PA5dkkHIC0LW3xN8=udO1y9Wyjc&$&bfd3jQdjp!ygZd%2Cfr4~$u(wmher`=V-r zJw9l0O4QGuek{M_;hg7^AB(hGr!UD?FLlh$`nl@oFRJn~4Dl8#XzA zyY;b3<%?A+TfH*6^1!^R_vY1hS!>>3=z24yrgQ15T?HF={d~u}8`=(~dz#C)t7|)t zwEXVBUjLnU&+*>w)BR^Jd^+QMr9l71&_BdUQ2T7tw_g1E?kfx5I``-A{_nRxCG-6& z3;*-LnH#s)AA6(Z!^<#Np8W8_m+R)g@#Ndgl)QcUw(Hmxdhg{E&$2K4*Pp)m$N&7_ zZ@GD8;h(-?yS#PoAOG|HZ$HAGc#+I^vfq5P>Q`^yxU*rw^aB^a{{H2KV|W+w;_(N5 z#SpG=pl3Vxe*J0jhtJ$zulQ=+QCtLF%d_-7LKw$`Iroq6fbb^((R=44^nkySIdJj9 z?RE1X_}Q5ocV0fR>fA-VcVZQGxw~P(1HP?ifHV)xj(u4&@5&Qz9~&{$1PA4`jTR5x8#??wdaVWJquMc{20hdH?F`yOOsyECAAtyBi1)@C)92lJJgR?p%Ltq~yaD zL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OO}xi^KswV?(kr$l>G9@mMFZng(alkKqB)y<&ANf4mbr_3Bs5u>(afEPpn; zHG|@w8fic(cBQrfu!+qFV{$4D@?PP&GN(HFsuBI{xpT}fonK9Tdd9-ZI zv9S&PD#dYUG?=jp38apdvC{@`mI1esqD#-)XP&HLfgC>QjBgu>Mj+ur?eBi{B#^>- zbis7Pz$~j4Dbc@2VupDH4h3vZbYtLO%a1VFr*IKdby3^BP%(H?H5-HrotA0oQETZ3 zFo6}`LTgOZNHkTP*;k9us^@1-iyuBcsPA&eZ;eo7lf(lQS4W?Fdfui7|%wm*i8rZPG$;5`X{8~ z4+FX4KcX5ob5F8lhqwMpL-)aggKNMSWQ8&2rzK3KO;MGs1Xqo1rnYl_X3{W zE6a_ill+nW@d#x1icZVEDe7+0rWD9~2zHJXEu$c%wafRXv!d3;P{d*{bb6R`s8Wd#j{t1D=LVD}AT&($n~C-;wM#=8?>d(iH8rjtZb;sDDe ziZPQEI+e;0G&#t%#VQ>Y0!YQx#AFNB1&90dvzrEIAwevS%L>M~wv2m{{$MNF(>~bv zrX0U38~7wkbrbNsHKWKdrB0!~;G{~2tfK@W@=b%$l0>_YIihe;Qa>c4F)P+HAJkAHQ=DB`)8x z@84zOK0_&k&Hg3+;YAx?f1D*Gbzd*3;u$p;Eb14%iO)DK24{QuS?TBY{^XOC6TcHR d{Oo>zAopSKqQm|`_5hcV|M2bz!HdFU{~y53vef_p diff --git a/packages/devs/watchdog/synth/current/host/doghouse.pov b/packages/devs/watchdog/synth/current/host/doghouse.pov new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/synth/current/host/doghouse.pov @@ -0,0 +1,161 @@ +// A simple "doghouse" picture, used for the synthetic target +// watchdog device host-side. +// +// This file is normally built using the following command line: +// +// x-povray +Idoghouse.pov +W128 +H128 +D +Q9 +AM2 +A0.9 +FP + +#include "consts.inc" +#include "colors.inc" +#include "shapes.inc" +#include "textures.inc" +#include "skies.inc" +#include "woods.inc" + +camera { + location <4.5, 2.2, -5> + look_at <2, 2, 2> +} + +light_source { + <7, 4, -1.5> + color White +} + +sky_sphere { S_Cloud2 scale 2 } +background { colour LightBlue } + +plane { + y 0 + texture { + pigment { color red 0.5 green 0.98 blue 0 turbulence 0.5} + normal { bumps 0.4 scale 0.1 } + } +} + +fog { + distance 40 + fog_type Ground_Fog + fog_offset 1 + fog_alt 1 + colour rgbf<0, 0.2, 0.2, 0.3> + turbulence 0.2 +} + +// A plank is a 1x1x0.1 block with a corner at the origin. The edges are +// slightly rounded, to make sure that the plank boundaries are just +// about visible. +#declare Plank = + superellipsoid { <0.03,0.03> scale <0.5,0.5,0.05> translate <0.5,0.5,0.05> texture { T_Wood10 } } + +// A variant, for the roof +#declare RoofPlank = + superellipsoid { <0.05,0.05> scale <0.5,0.5,0.05> translate <0.5,0.5,0.05> texture { T_Wood14 } } + +// The front and back, a rectangle with a triangle on top. +// Going clockwise from the bottom left, the coordinates are: +// <0,0> <0,3.2>, <2.4.5>, <4,3.2>, <4.0> +// Each is made from five horizontal planks. +// +// Note: this doghouse is not intended to be an example of good +// woodworking. For example, butt joints for the walls are a bad idea. +// Most importantly the roof should involve lapped joints with a +// sensible ridge, the current construction is not going to keep the +// rain out. +#declare RoofAngle = degrees(atan2(1.3,2)); +#declare RoofAngleR = atan2(1.3,2); + +#declare FrontBack = + difference { + union { + object { Plank scale <4,1,1> translate <0,0,0> } + object { Plank scale <4,1,1> translate <0,1,0> } + object { Plank scale <4,1,1> translate <0,2,0> } + object { Plank scale <4,1,1> translate <0,3,0> } + object { Plank scale <4,1,1> translate <0,4,0> } + } + union { + box { <0,0,0> <4,4,1> rotate <0,0,RoofAngle> translate <0,3.2,-0.5> } + box { <0,0,0> <4,4,1> rotate <0,0, -1 * RoofAngle> translate <2,4.5,-0.5> } + pigment { Black } + } + } + +// The front also has some text to name the dog, and a +// cutout for the opening. +object { + difference { + object { FrontBack } + union { + text { + ttf "cyrvetic.ttf" "FIFI" 0.1 0 + translate <1.2, 2.8, -0.05> + } + box { <1,0,-0.5> <3,2.2,0.5> } + object { + cylinder { <0,0,0> <0,0,1> 1 } + scale <1,0.33,1> + translate <2,2.2,-0.5> + } + pigment { Black } + } + } +} + +// The back, nothing fancy needed here. The doghouse is twice +// as deep as it is wide. +object { FrontBack translate <0,0,8> } + +// A floor, to prevent any bright grass showing inside +box { <0.05,0,0.05> <3.95,0.05,7.95> texture { T_Wood3 } } + +// LHS +object { Plank scale <8,1,1> rotate <0,-90,0> translate <0,0,0.1> } +object { Plank scale <8,1,1> rotate <0,-90,0> translate <0,1,0.1> } +object { Plank scale <8,1,1> rotate <0,-90,0> translate <0,2,0.1> } + +// RHS +object { Plank scale <8,1,1> rotate <0,-90,0> translate <4,0,0.1> } +object { Plank scale <8,1,1> rotate <0,-90,0> translate <4,1,0.1> } +object { Plank scale <8,1,1> rotate <0,-90,0> translate <4,2,0.1> } + +// Now for the roof. The top of the roof is at <2,4.5,0>, and the +// corners are at <0,3.2,0> and <4,3.2,0>. The planks are 0.1 units +// thick. + +#declare RoofPlank = + superellipsoid { <0.05,0.05> scale <0.5,0.5,0.05> translate <0.5,0.5,0.05> texture { T_Wood14 } } + +#declare RoofPlank_L = object { + RoofPlank + rotate <0, -90, RoofAngle - 90> + scale<1,1,8.5> +} + +#declare RoofPlank_R = object { + RoofPlank + rotate <0, -90, -90 - RoofAngle> + scale<1,1,8.5> +} + +object { RoofPlank_L translate<2 - (1 * cos(RoofAngleR)), 4.5 - (1 * sin(RoofAngleR)), -0.25> } +object { RoofPlank_L translate<2 - (2 * cos(RoofAngleR)), 4.5 - (2 * sin(RoofAngleR)), -0.25> } +object { RoofPlank_L translate<2 - (3 * cos(RoofAngleR)), 4.5 - (3 * sin(RoofAngleR)), -0.25> } + +object { RoofPlank_R translate<2 + (-0.1 * cos(RoofAngleR)), 4.5 - (-0.1 * sin(RoofAngleR)), -0.25> } +object { RoofPlank_R translate<2 + (0.9 * cos(RoofAngleR)), 4.5 - (0.9 * sin(RoofAngleR)), -0.25> } +object { RoofPlank_R translate<2 + (1.9 * cos(RoofAngleR)), 4.5 - (1.9 * sin(RoofAngleR)), -0.25> } + +// And just for fun, a dog bowl. +object { + merge { + difference { + torus { 1.0 0.5 } + box { <-1,-1,-1> <1,0,1> pigment { Black } } + } + cylinder { <0,0,0> <0,0.2,0> 0.9 } + } + scale <0.5,0.5,0.5> + translate <-0.5,0,-0.7> + pigment { Yellow } +} diff --git a/packages/devs/watchdog/synth/current/host/eye.gif b/packages/devs/watchdog/synth/current/host/eye.gif new file mode 100644 index 0000000000000000000000000000000000000000..520f5eabc40df6b37eaaf51e48d422ed743c6da9 GIT binary patch literal 93 zc${=iP@An`~G Vr?8q2kZ}lu;nd10?8eGq4FIMp8CC!Q diff --git a/packages/devs/watchdog/synth/current/host/sound1.au b/packages/devs/watchdog/synth/current/host/sound1.au new file mode 100644 index 0000000000000000000000000000000000000000..156af9a52f4a7c717f5f0dc75ee3c3b59877e43a GIT binary patch literal 4464 zc%1FlS67n>0>*Lne$Ux6=j`l^IuI$r5K@6ONCinF1w;}EDRhWHK#{THx7b}r2Pr}j zQVHqhO#lrEY4kuKpvX`~bX;tMy0hP6FSz>OJy*}g57D8hOGrpaPDuEU|7ZV_knp$O z|Fx$2S~H@$Ga;d?L84I9-Tl<@bA3g5>jzQY?)&Xyfj}mbwTkMV#~0S?x0nC;cyuSW zCu=(V%KSDFn)b`MwVccAZLj>x@7`YC54N^FZ@D4AB-}3|#@(UtTCqqiXmX<6p!e~ybX(d-;q@s%Hr5!}S zd7X>oo2&;o+LWD=EjbvEGrglwkVmUB6L4A;0hh}U2dv2urE6;Hid!9mAg5-m9cQtF zW5t+R!+;A!v4s$4FKR|984l&Bm^*?>S-eQ1Q9zsEk%ky+7N7L&&lhp$h;31A-yAzZ=Ftn1B=IAx0p9Ok+bQncr*Pj1Q*DcaS zK*r(pzl-_{IW5NiyO8g}|L#c?K7!}#lhPmRQ;d&giD#%izXE0rkCc~)R_;d2&*v^W zG-D0`c$1kSJNCeSobEOfp^SkC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D~qDPk$*np;c~^RnPj^-X-3n|6wOKqw|2g(5T4 zibPV?p+tEpmMQLXsSN5B4b7xr4$`kL3Yc^>3K10^nGltL#FO{b(!Hxqkz9l#X6#?l zk0^Q4Rgpw;s%BuA2qX%P!Np-x@~K!NRU`keup*Uo@1FTB=VWbDE|VS<-K0IRBq|k4 zN2cHy`Kj_E>XGVfOMjvrE5-=cbgblUdGwg9hFER(D6x$M2ZqC zD@<2t?vk%>u=G?qjzJ<2v#DCm*?l_wAe)5BBK$YFvFSJY+bWjys`!MJ#!y_PU>MA- zJ8hx-QhvUt&}i=O?;hAJlaNfyA<437>SHaFA-|=lX(}!C==h#he6P8n<*H68#rG^4 zg@!_*QXY~anMl(XF*L_gnN)eNRny6L4|k}C8dgS8&M}QZB&8s+s0Tt##gbSjS)`ro z&4&v4?Lx^=qUeWt%G;~-qb;cgC#o`%QGzN)eK4c<2@{g{`#RMXr zLN7j-Q%Jc~B88fKOjG1gRS&{td$*^OQ+a_TBlq<7fJM(z/stat to obtain + # timing information. Strictly speaking _ppid is not exported by + # the I/O auxiliary. + if { ! [info exists synth::_ppid] } { + synth::report_error "Watchdog initialization failed, _ppid variable required" + return "" + } + variable ecos_pid $synth::_ppid + + # Resolution, i.e. how long to go between checks. Currently this is hard-wired + # to one second, or 1000 ms. This may become configurable, either on the + # target-side via CDL or on the host-side via the target definition file. + # Note that currently the watchdog device and the GUI get updated via the + # same timer. If the resolution is changed to e.g. 10 seconds then it might + # be a good idea to update the GUI more frequently, although there are + # arguments for keeping the animation in step with the real work. + variable resolution 1000 + + # Options from the target definition file + variable use_wallclock 0 + variable window_pack "-in .main.n -side right" + variable sound_file "" + variable sound_player "play" + + if { [synth::tdf_has_device "watchdog"] } { + if { [synth::tdf_has_option "watchdog" "use"] } { + set _use [synth::tdf_get_option "watchdog" "use"] + if { "wallclock_time" == $_use } { + set watchdog::use_wallclock 1 + } elseif { "consumed_cpu_time" == $_use } { + set watchdog::use_wallclock 0 + } else { + synth::report_error "Invalid entry in target definition file $synth::target_definition\n\ + \ Device watchdog, option \"use\" should be \"wallclock_time\" or \"consumed_cpu_time\"\n" + } + unset _use + } + if { [synth::tdf_has_option "watchdog" "watchdog_pack"] } { + set watchdog::window_pack [synth::tdf_get_option "watchdog" "watchdog_pack"] + # Too complicated to validate here, instead leave it to a catch statement + # when the window actually gets packed + } + if { [synth::tdf_has_option "watchdog" "sound"] } { + set _sound_file [synth::tdf_get_option "watchdog" "sound"] + # Look for this sound file in the install tree first, then absolute or relative + if { [file exists [file join $synth::device_install_dir $_sound_file] ] } { + set _sound_file [file join $synth::device_install_dir $_sound_file] + } + if { ![file exists $_sound_file] } { + synth::report_error "Invalid entry in target definition file $synth::target_definition\n\ + \ Device watchdog, option \"sound\", failed to find $_sound_file\n" + } elseif { ! [file readable $_sound_file] } { + synth::report_error "Invalid entry in target definition file $synth::target_definition\n\ + \ Device watchdog, option \"sound\", no read access to file $_sound_file\n" + } else { + set watchdog::sound_file $_sound_file + } + unset _sound_file + } + if { [synth::tdf_has_option "watchdog" "sound_player"] } { + set watchdog::sound_player [synth::tdf_get_option "watchdog" "sound_player"] + } + } + + # There is no point in creating the watchdog window if any of the image files are missing + if { $synth::flag_gui } { + foreach _image [list "doghouse.gif" "alarm.gif" "eye.gif" "asleep.gif"] { + variable image_[file rootname $_image] + if { ! [synth::load_image "watchdog::image_[file rootname $_image]" [file join $synth::device_install_dir $_image]] } { + synth::report_error "Watchdog device, unable to load image $_image\n\ + \ This file should have been installed in $synth::device_install_dir\n" + set watchdog::init_ok 0 + } + } + } + if { $synth::flag_gui && $watchdog::init_ok } { + canvas .watchdog -width [image width $image_doghouse] -height [image height $image_doghouse] \ + -borderwidth 0 + variable background [.watchdog create image 0 0 -anchor nw -image $image_doghouse] + + # Eye positions inside the doghouse. The eye is an 8x10 gif, + # mostly white but transparent around the corners + variable left_eye_x 48 + variable left_eye_y 70 + variable right_eye_x 58 + variable right_eye_y 70 + + # Pupil positions relative to the eye. The pupils are 3x3 rectangles. + # The dog can look in one of nine different directions, with both eyes + # looking in the same direction (if visible) + variable pupil_positions { { 1 6 } { 1 5 } { 1 3 } { 3 1 } { 3 4 } { 3 6 } { 4 3 } { 4 5 } { 4 6 } } + + # Which eyes are currently visible: none, left, right or both + variable eyes "none" + # What is the current pupil position? + variable pupils 4 + + variable left_eye [.watchdog create image $left_eye_x $left_eye_y -anchor nw -image $image_eye] + variable right_eye [.watchdog create image $right_eye_x $right_eye_y -anchor nw -image $image_eye] + + variable left_pupil \ + [.watchdog create rectangle \ + [expr $left_eye_x + [lindex [lindex $pupil_positions $pupils] 0]] \ + [expr $left_eye_y + [lindex [lindex $pupil_positions $pupils] 1]] \ + [expr $left_eye_x + [lindex [lindex $pupil_positions $pupils] 0] + 2] \ + [expr $left_eye_y + [lindex [lindex $pupil_positions $pupils] 1] + 2] \ + -fill black] + variable right_pupil \ + [.watchdog create rectangle \ + [expr $right_eye_x + [lindex [lindex $pupil_positions $pupils] 0]] \ + [expr $right_eye_y + [lindex [lindex $pupil_positions $pupils] 1]] \ + [expr $right_eye_x + [lindex [lindex $pupil_positions $pupils] 0] + 2] \ + [expr $right_eye_y + [lindex [lindex $pupil_positions $pupils] 1] + 2] \ + -fill black] + + + # The dog is asleep until the eCos application activates the watchdog device + .watchdog lower $left_eye $background + .watchdog lower $right_eye $background + .watchdog lower $left_pupil $background + .watchdog lower $right_pupil $background + + # Prepare for an alarm, but obviously the alarm picture should be hidden for now. + variable alarm [.watchdog create image 30 56 -anchor nw -image $image_alarm] + .watchdog lower $alarm $background + + # Start asleep + variable asleep [.watchdog create image 48 70 -anchor nw -image $image_asleep] + + # Now try to pack the watchdog window using the option provided by the + # user. If that fails, report the error and pack in a default window. + if { [catch { eval pack .watchdog $watchdog::window_pack } message] } { + synth::report_error "Watchdog device, failed to pack window in $watchdog::window_pack\n $message" + pack .watchdog -in .main.n -side right + } + + # Updating the display. This happens once a second. + # If neither eye is visible, choose randomly between + # left-only, right-only or both. Otherwise there is + # a one in eight chance of blinking, probably switching + # to one of the other eye modes + # + # Also, the visible pupil(s) will move every second, to one + # of nine positions + proc gui_update { } { + + if { "none" == $watchdog::eyes} { + set rand [expr int(3 * rand())] + if { 0 == $rand } { + set watchdog::eyes "left" + .watchdog raise $watchdog::left_eye $watchdog::background + .watchdog raise $watchdog::left_pupil $watchdog::left_eye + } elseif { 1 == $rand } { + set watchdog::eyes "right" + .watchdog raise $watchdog::right_eye $watchdog::background + .watchdog raise $watchdog::right_pupil $watchdog::right_eye + } else { + set watchdog::eyes "both" + .watchdog raise $watchdog::left_eye $watchdog::background + .watchdog raise $watchdog::left_pupil $watchdog::left_eye + .watchdog raise $watchdog::right_eye $watchdog::background + .watchdog raise $watchdog::right_pupil $watchdog::right_eye + } + } else { + if { 0 == [expr int(8 * rand())] } { + set watchdog::eyes "none" + .watchdog lower $watchdog::left_eye $watchdog::background + .watchdog lower $watchdog::right_eye $watchdog::background + .watchdog lower $watchdog::left_pupil $watchdog::background + .watchdog lower $watchdog::right_pupil $watchdog::background + + # There is no point in moving the pupils if both eyes are shut + return + } + } + + set watchdog::pupils [expr int(9 * rand())] + set new_pupil_x [lindex [lindex $watchdog::pupil_positions $watchdog::pupils] 0] + set new_pupil_y [lindex [lindex $watchdog::pupil_positions $watchdog::pupils] 1] + + if { ("left" == $watchdog::eyes) || ("both" == $watchdog::eyes) } { + .watchdog coords $watchdog::left_pupil \ + [expr $watchdog::left_eye_x + $new_pupil_x] \ + [expr $watchdog::left_eye_y + $new_pupil_y] \ + [expr $watchdog::left_eye_x + $new_pupil_x + 2] \ + [expr $watchdog::left_eye_y + $new_pupil_y + 2] + } + if { ("right" == $watchdog::eyes) || ("both" == $watchdog::eyes) } { + .watchdog coords $watchdog::right_pupil \ + [expr $watchdog::right_eye_x + $new_pupil_x] \ + [expr $watchdog::right_eye_y + $new_pupil_y] \ + [expr $watchdog::right_eye_x + $new_pupil_x + 2] \ + [expr $watchdog::right_eye_y + $new_pupil_y + 2] + } + } + + # Cancel the gui display when the eCos application has exited. + # The watchdog is allowed to go back to sleep. If the application + # exited because of the watchdog then of course the alarm picture + # should remain visible, otherwise it would be just a flash. + proc gui_cancel { } { + .watchdog lower $watchdog::left_eye $watchdog::background + .watchdog lower $watchdog::right_eye $watchdog::background + .watchdog lower $watchdog::left_pupil $watchdog::background + .watchdog lower $watchdog::right_pupil $watchdog::background + if { ! $watchdog::alarm_triggered } { + .watchdog raise $watchdog::asleep $watchdog::background + } + } + + # Raise the alarm. This involves hiding the eyes and raising + # the alarm picture. If sound is enabled, the sound player + # should be invoked + proc gui_alarm { } { + .watchdog lower $watchdog::asleep $watchdog::background + .watchdog lower $watchdog::left_eye $watchdog::background + .watchdog lower $watchdog::right_eye $watchdog::background + .watchdog lower $watchdog::left_pupil $watchdog::background + .watchdog lower $watchdog::right_pupil $watchdog::background + .watchdog raise $watchdog::alarm $watchdog::background + + if { "" != $watchdog::sound_file } { + # Catch errors on the actual exec, e.g. if the sound player is + # invalid, but play the sound in the background. If there are + # problems actually playing the sound then the user should + # still see a message on stderr. Blocking the entire auxiliary + # for a few seconds is not acceptable. + if { [catch { eval exec -- $watchdog::sound_player $watchdog::sound_file & } message] } { + synth::report_warning "Watchdog device, failed to play alarm sound file\n $message\n" + } + } + } + + set _watchdog_help [file join $synth::device_src_dir "doc" "devs-watchdog-synth.html"] + if { ![file readable $_watchdog_help] } { + synth::report_warning "Failed to locate synthetic watchdog documentation $_watchdog_help\n\ + \ Help->Watchdog target menu option disabled.\n" + set _watchdog_help "" + } + if { "" == $_watchdog_help } { + .menubar.help add command -label "Watchdog" -state disabled + } else { + .menubar.help add command -label "Watchdog" -command [list synth::handle_help "file://$_watchdog_help"] + } + } + + # Now for the real work. By default the watchdog is asleep. The eCos + # application can activate it with a start message, which results + # in an "after" timer. That runs once a second to check whether or not + # the watchdog should trigger, and also updates the GUI. + # + # The target-side code should perform a watchdog reset at least once + # a second, which involves another message to this script and the + # setting of the reset_received flag. + # + # The update handler gets information about the eCos application using + # /proc//stat (see man 5 proc). The "state" field is important: + # a state of T indicates that the application is stopped, probably + # inside gdb, so cannot reset the watchdog. The other important field + # is utime, the total number of jiffies (0.01 seconds) executed in + # user space. The code maintains an open file handle to the /proc file. + + variable reset_received 0 + variable after_id "" + variable proc_stat "" + variable last_jiffies 0 + + set _filename "/proc/[set watchdog::ecos_pid]/stat" + if { [catch { open $_filename "r" } proc_stat ] } { + synth::report_error "Watchdog device, failed to open $_filename\n $proc_stat\n" + set watchdog::init_ok 0 + } + unset _filename + + proc update { } { + set watchdog::after_id [after $watchdog::resolution watchdog::update] + if { $synth::flag_gui } { + watchdog::gui_update + } + seek $watchdog::proc_stat 0 "start" + set line [gets $watchdog::proc_stat] + scan $line "%*d %*s %s %*d %*d %*d %*d %*d %*lu %*lu %*lu %*lu %*lu %lu" state jiffies + + # In theory it is possible to examine the state field (the third argument). + # If set to T then that indicates the eCos application is traced or + # stopped, probably inside gdb, and it would make sense to act as if + # the application had sent a reset. Unfortunately the state also appears + # to be set to T if the application is blocked in a system call while + # being debugged - including the idle select(), making the test useless. + # FIXME: figure out how to distinguish between being blocked inside gdb + # and being in a system call. + #if { "T" == $state } { + # set watchdog::reset_received 1 + # return + #} + + # If there has been a recent reset the eCos application can continue to run for a bit longer. + if { $watchdog::reset_received } { + set watchdog::last_jiffies $jiffies + set watchdog::reset_received 0 + return + } + + # We have not received a reset. If the watchdog is using wallclock time then + # that is serious. If the watchdog is using elapsed cpu time then the eCos + # application may not actually have consumed a whole second of cpu time yet. + if { $watchdog::use_wallclock || (($jiffies - $watchdog::last_jiffies) > ($watchdog::resolution / 10)) } { + set watchdog::alarm_triggered 1 + # Report the situation via the main text window + synth::report "Watchdog device: the eCos application has not sent a recent reset\n Raising SIGPWR signal.\n" + # Then kill off the eCos application + exec kill -PWR $watchdog::ecos_pid + # There is no point in another run of the timer + after cancel $watchdog::after_id + # And if the GUI is running, raise the alarm visually + if { $synth::flag_gui } { + watchdog::gui_alarm + } + } + } + + # When the eCos application has exited, cancel the timer and + # clean-up the GUI. Also get rid of the open file since the + # /proc//stat file is no longer meaningful + proc exit_hook { arg_list } { + if { "" != $watchdog::after_id } { + after cancel $watchdog::after_id + } + if { $synth::flag_gui } { + watchdog::gui_cancel + } + close $watchdog::proc_stat + } + synth::hook_add "ecos_exit" watchdog::exit_hook + + proc handle_request { id reqcode arg1 arg2 reqdata reqlen reply_len } { + if { 0x01 == $reqcode } { + # A "start" request. If the watchdog has already started, + # this request is a no-op. Otherwise a timer is enabled. + # This is made to run almost immediately, so that the + # GUI gets a quick update. Setting the reset_received flag + # ensures that the watchdog will not trigger immediately + set watchdog::reset_received 1 + if { "" == $watchdog::after_id } { + set watchdog::after_id [after 1 watchdog::update] + } + if { $synth::flag_gui } { + .watchdog lower $watchdog::asleep $watchdog::background + } + } elseif { 0x02 == $reqcode } { + # A "reset" request. Just set a flag, the update handler + # will detect this next time it runs. + set watchdog::reset_received 1 + } + } + + proc instantiate { id name data } { + return watchdog::handle_request + } +} + +if { $watchdog::init_ok } { + return watchdog::instantiate +} else { + synth::report "Watchdog cannot be instantiated, initialization failed.\n" + return "" +} diff --git a/packages/devs/watchdog/synth/current/host/watchdog.tdf b/packages/devs/watchdog/synth/current/host/watchdog.tdf new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/synth/current/host/watchdog.tdf @@ -0,0 +1,63 @@ +synth_device watchdog { + + ## How should the watchdog device decide that the watchdog has + ## triggered, assuming the eCos application has failed to + ## reset the device in time. There are two options: wallclock + ## time, where the watchdog will trigger after a second + ## irrespective of what the eCos application has been doing; + ## or consumed cpu time, where the watchdog will only trigger + ## if the eCos application has actually run for a whole second. + ## + ## Using wallclock time matches most real hardware, + ## but can give spurious results if there are other processes + ## running and consuming cpu cycles. Also, if the user has + ## halted the application in gdb then the watchdog will trigger + ## even though the application has no chance to reset the + ## watchdog. + ## + ## Using consumed cpu cycles avoids these problems. + ## However the default implementation of the idle thread action + ## is to block in a select() system call, so if the eCos + ## application spends most of its time idling but not resetting + ## the watchdog then the device will not trigger. The + ## configuration option CYGIMP_HAL_IDLE_THREAD_SPIN can be used + ## to change the synthetic target HAL's implementation of the + ## idle thread action. + ## + ## The default is to use consumed_cpu_time. Wallclock time can + ## be selected by uncommenting the next line. + # use wallclock_time + # use consumed_cpu_time + + ## When running in GUI mode there will be a small window showing + ## the current state of the watchdog: asleep, watching, or giving + ## the alarm. This window can be packed as desired, using one + ## of the container frames .main.nw .main.n .main.ne .main.w + ## .main.e .main.sw .main.s or .main.se, and with a position of + ## left, right, top or bottom. The default is to pack inside the + ## .main.n frame, on the right, thus causing the watchdog to + ## appear above the central text window. + # watchdog_pack -in .main.n -side right + + ## If running in GUI mode, when the watchdog triggers and resets + ## the eCos application this will be shown in the display. + ## Optionally the watchdog device can also give an audible alert + ## when this happens. This is disabled by default to avoid + ## annoying co-workers, but can be enabled by specifying a suitable + ## sound file. Two such files, sound1.au and sound2.au, are supplied + ## with the watchdog device itself. Alternatively the user can + ## specify a different sound file using a suitable path + # sound sound1.au + # sound sound2.au + # sound ~/sounds/my_watchdog_alert.au + + ## If sound is enabled then the watchdog device needs some way to + ## access the host's sound hardware. Rather than accessing + ## /dev/audio or /dev/dsp directly the watchdog.tcl script will + ## run an external program. This can avoid complications with + ## different sound file formats etc. The default program is + ## "play", a front-end to the sox utility, but a different + ## program or script can be specified if desired. It will be run + ## simply as " &" + # sound_player play +} diff --git a/packages/devs/watchdog/synth/current/src/synth_watchdog.cxx b/packages/devs/watchdog/synth/current/src/synth_watchdog.cxx new file mode 100644 --- /dev/null +++ b/packages/devs/watchdog/synth/current/src/synth_watchdog.cxx @@ -0,0 +1,159 @@ +//========================================================================== +// +// synth_watchdog.cxx +// +// Watchdog driver for the synthetic target +// +//========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 2002 Bart Veer +// +// 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 the +// copyright holder(s). +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//========================================================================== +//#####DESCRIPTIONBEGIN#### +// +// Author(s): bartv +// Contributors: bartv +// Date: 2002-09-04 +// +//####DESCRIPTIONEND#### +//========================================================================== + +#include +#include + +#ifdef CYGIMP_WATCHDOG_HARDWARE + +#include +#include +#include +#include +#include + +// FIXME: right now the generic watchdog header depends on the +// kernel. That should be fixed in the watchdog code, but will +// affect some device drivers as well +#include +#include + +// Protocol between host and target +#define SYNTH_WATCHDOG_START 0x01 +#define SYNTH_WATCHDOG_RESET 0x02 + +// The synthetic target's watchdog implementation involves interaction +// with a watchdog.tcl script running in the I/O auxiliary. The device +// must be instantiated during system initialization, preferably via +// a prioritized C++ static constructor. The generic watchdog package +// does have a static object, but it is not prioritized. If +// CYGSEM_HAL_STOP_CONSTRUCTORS_ON_FLAG is enabled then that object's +// constructor would get called too late. +// +// Instead a private class is defined here, and once instance is created. +// That instance gets referenced by the Cyg_Watchdog members, so +// selective linking does not get in the way. Instantiation happens inside +// the constructor, and the main Cyg_Watchdog::start() and reset() functions +// involve passing a message to the host-side. +// +// There is an open issue re. resolution. Usually the hardware imposes +// limits on what resolutions are valid, in fact there may be only one. +// With the synthetic target it would be possible to configure the +// desired resolution either on the target-side using a CDL option, or +// on the host-side using the target definition file. The resolution +// would have to be fairly coarse, probably at least 0.1 seconds, +// to allow for communication overheads. It is not clear whether +// target-side or host-side configuration is more appropriate, so for +// now a fixed resolution of one second is used. + +class _Synth_Watchdog { + public: + _Synth_Watchdog(); + ~_Synth_Watchdog() { } + + cyg_uint64 resolution; +}; + +// A static instance of the _Synth_Watchdog class, whose constructor will +// be called at the right time to instantiate host-side support. +static _Synth_Watchdog _synth_watchdog_object CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_DRIVERS); + +// Id for communicating with the watchdog instance in the auxiliary +static int aux_id = -1; + +_Synth_Watchdog::_Synth_Watchdog() +{ + // SIGPWR is disabled by default. It has to be reenabled. + struct cyg_hal_sys_sigset_t blocked; + CYG_HAL_SYS_SIGEMPTYSET(&blocked); + CYG_HAL_SYS_SIGADDSET(&blocked, CYG_HAL_SYS_SIGPWR); + cyg_hal_sys_sigprocmask(CYG_HAL_SYS_SIG_UNBLOCK, &blocked, (cyg_hal_sys_sigset_t*) 0); + + resolution = 1000000000LL; + if (synth_auxiliary_running) { + aux_id = synth_auxiliary_instantiate("devs/watchdog/synth", + SYNTH_MAKESTRING(CYGPKG_DEVS_WATCHDOG_SYNTH), + "watchdog", + (const char*) 0, + (const char*) 0); + } +} + +// Hardware initialization. This has already happened in the +// _Synth_Watchdog constructor, all that is needed here is to +// propagate the resolution. +void +Cyg_Watchdog::init_hw(void) +{ + resolution = _synth_watchdog_object.resolution; +} + +void +Cyg_Watchdog::start(void) +{ + if (synth_auxiliary_running && (-1 != aux_id)) { + synth_auxiliary_xchgmsg(aux_id, SYNTH_WATCHDOG_START, 0, 0, + (const unsigned char*)0, 0, + (int *) 0, + (unsigned char*) 0, (int*) 0, 0); + } +} + +void +Cyg_Watchdog::reset() +{ + if (synth_auxiliary_running && (-1 != aux_id)) { + synth_auxiliary_xchgmsg(aux_id, SYNTH_WATCHDOG_RESET, 0, 0, + (const unsigned char*)0, 0, + (int *) 0, + (unsigned char*) 0, (int*) 0, 0); + } +} + +#endif // CYGIMP_WATCHDOG_HARDWARE diff --git a/packages/ecos.db b/packages/ecos.db --- a/packages/ecos.db +++ b/packages/ecos.db @@ -1321,6 +1321,14 @@ package CYGPKG_DEVS_ETH_MCF5272 { } +package CYGPKG_DEVS_ETH_ECOSYNTH { + alias { "Synthetic target ethernet driver" ecosyntheth ecosynth_eth_driver } + directory devs/eth/synth/ecosynth + script syntheth.cdl + hardware + description "Ethernet driver for the synthetic target" +} + package CYGPKG_IO_PCI { alias { "PCI configuration library" io_pci } directory io/pci @@ -1479,6 +1487,16 @@ package CYGPKG_DEVICES_WATCHDOG_H8300_H8 Hitachi H8/300H chip." } +package CYGPKG_DEVS_WATCHDOG_SYNTH { + alias { "Watchdog driver for the synthetic target" devices_watchdog_synth device_watchdog_synth } + directory devs/watchdog/synth + script synth_watchdog.cdl + hardware + description " + This package provides a watchdog driver for the eCos + synthetic target." +} + package CYGPKG_IO_WATCHDOG { alias { "Watchdog IO device" watchdog io_watchdog } directory io/watchdog @@ -3460,6 +3478,8 @@ target linux { packages { CYGPKG_HAL_SYNTH CYGPKG_HAL_SYNTH_I386 CYGPKG_DEVS_FLASH_SYNTH + CYGPKG_DEVS_ETH_ECOSYNTH + CYGPKG_DEVS_WATCHDOG_SYNTH } description " The linux target provides the diff --git a/packages/hal/synth/arch/current/ChangeLog b/packages/hal/synth/arch/current/ChangeLog --- a/packages/hal/synth/arch/current/ChangeLog +++ b/packages/hal/synth/arch/current/ChangeLog @@ -1,3 +1,13 @@ +2002-09-15 Bart Veer + + * include/hal_io.h + cdl/hal_synth.cdl + src/synth_entry.c, src/synth_intr.c, src/synth_diag.c, + src/synth_protocol.h + doc/* + host/* + Add support for I/O via an I/O auxiliary + 2002-08-04 Bart Veer * include/hal_io.h: added argv/argv/environ definitions diff --git a/packages/hal/synth/arch/current/cdl/hal_synth.cdl b/packages/hal/synth/arch/current/cdl/hal_synth.cdl --- a/packages/hal/synth/arch/current/cdl/hal_synth.cdl +++ b/packages/hal/synth/arch/current/cdl/hal_synth.cdl @@ -98,9 +98,29 @@ cdl_package CYGPKG_HAL_SYNTH { cdl_option CYGNUM_HAL_RTC_PERIOD { display "Real-time clock period" flavor data - calculated 10000 + calculated 10000 } } + # What to do when idling + cdl_option CYGIMP_HAL_IDLE_THREAD_SPIN { + display "Spin when idle" + default_value CYGIMP_IDLE_THREAD_YIELD + description " + By default, whenever the eCos application enters the idle thread + the synthetic target HAL will make a select() system call. Effectively + this causes the application to block until an interrupt occurs, + without consuming any cpu resources, as if the hardware supported + some sort of IDLE instruction. Usually this behaviour is desirable. + However it interferes with the emulation of some hardware. For + example the synthetic watchdog timer device can use consumed cpu time + rather than wallclock time to determine whether or not the watchdog + has triggered, and if the process is spending nearly all its time + blocked in select() then the watchdog will not trigger when it should. + There are also some kernel configurations which require that the idle + thread does not block." + } + requires { CYGIMP_IDLE_THREAD_YIELD implies CYGIMP_HAL_IDLE_THREAD_SPIN } + cdl_option CYGBLD_LINKER_SCRIPT { display "Linker script" flavor data diff --git a/packages/hal/synth/arch/current/doc/filters.gif b/packages/hal/synth/arch/current/doc/filters.gif new file mode 100644 index 0000000000000000000000000000000000000000..ff5d88faeae05276e75a29294bcc9add4af9db06 GIT binary patch literal 21329 zc%1BbQ*$MZ^YjT%yvfG4ZEIuOwr!ic!N#_2+qP}n8=U-~-=}zQ-kzJTxtXq->8h@g zkP_$OHWCNp06zu%4~U3}sHmt|SXcl65dgr%!Oq0Z$->LcCLkaH00;p9asYrL0N^Mn zs3|CDDk%6L@f8;2{UyXFE+#A~E+Qo*E+Z?gpeU~-FQup`udc49q4{5FXliQc=x7`2 zsu}5PnHj2^80ngu8d;hf+gh4fSy?*UnL0bzxH;Q+x>&lnIQ#qi0|0>m0r3F=X#oLw z0Rd$J0c`;ReF1@fmch~K06;o5ApMtZkdITazvnjq@GS=T4hZPKEF=2mWqmusqPD_kRNQ_TSPfSnwo0XoJm6e&B zms^;fT#%byl$Tyvl2cq_wJv=-(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`KA|FsAOVJf?twC^5B=fHW zp{orbaA-i%0Z}p=Uy=r6lDjz42R+gOXOaPH@)~z?1$$Dr9FY-O@&f*UGXH||8ILjr zgYq5EVkmF1DDBZCVbUP8kQkSe1e5Z%;y?~HB_gS^0k_gvoHAdsas-QjAun(oI}$8+ zM3mGbF6(0~hw&^w0xr92{^)WQk?bptGAwJ2BdE>R;LSJoQWxz~E(_CG7BeHQ@&O&u zwd!#o0W*}ELNMQLN76DMgQ+t42qfUrBL_9pgu)@sqJi)U;!;``W)D&+MKm8LtEA%(@5&`QsQLn{wKk8>h5 z)ElwX0<|~y^gU0MhJY|m9Rv=3(M#(S zO!xFnLo!T1B2RrWAlU#!cO(qCljI7ON@ufD542wV{gUjHMU@a$)l}5d0^>jw^FUAsvcLLpPil1!(aT^8bx%lD5MPE*UM5%Xumx;j2r_j$ z0QFW5G)E(_b(|1VyYN7vbx+T6!Yoxh6LnfIbz5aoQI!Qyp(9qAH5cEIT7$(~cQILI zLtM?ZT`zJ6)s+g@fVQ+X0_)XX^ABA&P$iMiL+BMF?iCIlBw!yE95M0-(-aH=_85T$ zS_xKQF+v$Nr41;y4RXf~D7K8ssA4&m4LsIk)nEZO1-4vMynCI?J3mSi2$r{ad)Ie!)d={+dW!%FiU51{ z#0ZW6c60Z2Yxi|ycXd}cbx&6bP&fX4*Eb1T*L77FbJp8h@m)$k9dfE*ov!ohqZW%xwwmW_=a&9jKg>X!q|o{ zfQ)OHjB_{xa#)PJSd2G7jd7TbX&8%l_=lmmh^4rRGoS*hIEr8RkEghasW_0WIFN}L z0aRE35MTft`H=+xk_BLrAAA{-2OyFwIg>Ftk~i6rIoXpbnUg=ck|(*8O}UgWS(Hs# zlSMg|JvozM`I2Q>mPc8VNg0+gIh8y4lqWd=LRpo0IhcJ}m;=C& rjk%bcxtX2WnWLGRk=dG|*_eCznWb5qpLv?Wd78U - - - @@ -16,7 +13,7 @@ >

The Console Device

Name

The console device  -- Show output from the eCos application

Description

The eCos application can generate text output in a variety of ways, +including calling printf or +diag_printf. When the I/O auxiliary is enabled +the eCos startup code will instantiate a console device to process all +such output. If operating in text mode the output will simply go to +standard output, or to a logfile if the -l command +line option is specified. If operating in graphical mode the output +will go to the central text window, and optionally to a logfile as +well. In addition it is possible to control the appearance of the main +text via the target definition file, and to install extra filters for +certain types of text. +

It should be noted that the console device is line-oriented, not +character-oriented. This means that outputting partial lines is not +supported, and some functions such as fflush and +setvbuf will not operate as expected. This +limitation prevents much possible confusion when using filters to +control the appearance of the text window, and has some performance +benefits - especially when the eCos application generates a great deal +of output such as when tracing is enabled. For most applications this +is not a problem, but it is something that developers should be aware +of. +

The console device is output-only, it does not provide any support for +keyboard input. If the application requires keyboard input then that +should be handled by a separate eCos device package and matching +host-side code. +

Installation

The eCos side of the console device is implemented by the +architectural HAL itself, in the source file +synth_diag.c, rather than in a separate device +package. Similarly the host-side implementation, +console.tcl, is part of the architectural HAL's +host-side support. It gets installed automatically alongside the I/O +auxiliary itself, so no separate installation procedure is required. +

Target Definition File

The target definition file +can contain a number of entries related to the console device. These +are all optional, they only control the appearance of text output. If +such control is desired then the relevant options should appear in the +body of a synth_device entry: +

synth_device console {
+    …
+}

The first option is appearance, used to control the +appearance of any text generated by the eCos application that does not +match one of the installed filters. This option takes the same +argument as any other filter, for example: +

synth_device console {
+    appearance -foreground white -background black
+    …
+}

Any number of additional filters can be created with a +filter option, for example: +

synth_device console {
+    …
+    filter trace {^TRACE:.*} -foreground HotPink1 -hide 1
+    …
+}

The first argument gives the new filter a name which will be used in +the filters dialog. Filter names +should be unique. The second argument is a Tcl regular expression. The +console support will match each line of eCos output against this +regular expression, and if a match is found then the filter will be +used for this line of text. The above example matches any line of +output that begins with TRACE:, which corresponds +to the eCos infrastructure's tracing facilities. The remaining options +control the desired appearance for matched text. If some eCos output +matches the regular expressions for several different filters then +only the first match will be used. +

Target-side + Configuration Options

There are no target-side configuration options related to the console +device. +

Command Line Arguments

The console device does not use any command-line arguments. +

Hooks

The console device does not provide any hooks. +

Additional Tcl Procedures

The console device does not provide any additional Tcl procedures that +can be used by other scripts. +


PrevHomeNext
The I/O Auxiliary's User Interface System Calls
\ No newline at end of file diff --git a/packages/hal/synth/arch/current/doc/synth-gui.html b/packages/hal/synth/arch/current/doc/synth-gui.html new file mode 100644 --- /dev/null +++ b/packages/hal/synth/arch/current/doc/synth-gui.html @@ -0,0 +1,738 @@ + + + + + + + + +The I/O Auxiliary's User Interface +
eCos Synthetic Target
PrevNext

The I/O Auxiliary's User Interface

Name

User Interface -- Controlling the I/O Auxiliary

Description

The synthetic target auxiliary is designed to support both extensions +and user customization. Support for the desired devices is dynamically +loaded, and each device can extend the user interface. For example it +is possible for a device to add menu options, place new buttons on the +toolbar, create its own sub-window within the overall layout, or even +create entire new toplevel windows. These subwindows or toplevels +could show graphs of activity such as interrupts or packets being +transferred. They could also allow users to interact with the eCos +application, for example by showing a number of buttons which will be +mapped on to digital inputs in the eCos application. Different +applications will have their own I/O requirements, changing the +host-side support files that get loaded and that may modify the user +interface. The I/O auxiliary also reads in user configuration scripts +which can enhance the interface in the same way. Therefore the exact +user interface will depend on the user and on the eCos application +being run. However the overall layout is likely to remain the same. +

The title bar identifies the window as belonging to an eCos synthetic +target application and lists both the application name and its process +id. The latter is especially useful if the application was started +directly from a shell prompt and the user now wants to attach a gdb +session. The window has a conventional menu bar with the usual +entries, plus a toolbar with buttons for common operations such as cut +and paste. Balloon help is supported. +

There is a central text window, +possibly surrounded by various sub-windows for various devices. For +example there could be a row of emulated LED's above the text window, +and monitors of ethernet traffic and interrupt activity on the right. +At the bottom of the window is a status line, including a small +animation that shows whether or not the eCos application is still +running. +

Menus and the Toolbar

Usually there will be four menus on the menu bar: +File, Edit, +View and Help. +

On the File menu there are three entries related to +saving the current contents of the central text window. +Save is used to save the currently visible +contents of the text window. Any text that is hidden because of +filters will not be written to the savefile. If there has been a +previous Save or Save +As operation then the existing savefile will be re-used, +otherwise the user will be asked to select a suitable file. +Save As also saves just the currently +visible contents but will always prompt the user for a filename. +Save All can be used to save the full +contents of the text window, including any text that is currently +hidden. It will always prompt for a new filename, to avoid confusion +with partial savefiles. +

Usually the eCos application will be run from inside gdb or from a +shell prompt. Killing off the application while it is being debugged +in a gdb session is not a good idea, it would be better to use gdb's +own kill command. Alternatively the eCos +application itself can use the CYG_TEST_EXIT or +cyg_hal_sys_exit functionality. However it is +possible to terminate the application from the I/O auxiliary using +Kill eCos. A clean shutdown will be +attempted, but that can fail if the application is currently halted +inside gdb or if it has crashed completely. As a last resort +SIGKILL will be used. +

When operating in graphical mode the I/O auxiliary will normally +continue to run even after the eCos application has exited. This +allows the user to examine the last few lines of output, and perhaps +perform actions such as saving the output to a file. The +Exit menu item can be used to shut down the +auxiliary. Note that this behaviour can be changed with command line +arguments --exit and +--no-exit. +

If Exit is used while the eCos application +is still running then the I/O auxiliary will first attempt to +terminate the application cleanly, and then exit. +

The Edit menu contains the usual entries for +text manipulation: Cut, +Copy, Paste, +Clear and Select +All. These all operate on the central text window. By +default this window cannot be edited so the cut, paste and clear +operations are disabled. If the user wants to edit the contents of the +text window then the Read Only checkbutton +should be toggled. +

The Preferences menu item brings up a +miscellaneous preferences dialog. One of the preferences relates to +online help: the I/O auxiliary does not currently have a built-in html +viewer; instead it will execute an external browser of some sort. With +the example settings shown, the I/O auxiliary will first attempt to +interact with an existing mozilla session. If that fails it will try +to run a new mozilla instance, or as a last result use the Gnome help +viewer. +

The View menu contains the System +Filters entry, used to edit the settings for the current +filters. +

The Help menu can be used to activate online help +for eCos generally, for the synthetic target as a whole, and for +specific devices supported by the generic target. The Preferences +dialog can be used to select the browser that will be used. +

The Main Text Window

The central text window holds the console output from the eCos +application: the screen shot above shows DHCP initialization data from +the TCP/IP stack, and some output from the main +thread at the bottom. Some devices can insert text of their own, for +example the ethernet device support can be configured to show details +of incoming and outgoing packets. Mixing the output from the eCos +application and the various devices can make it easier to understand +the order in which events occur. +

The appearance of text from different sources can be controlled by +means of filters, and it is also possible to hide some of the text. +For example, if tracing is enabled in the eCos configuration then the +trace output can be given its own colour scheme, making it stand out +from the rest of the output. In addition the trace output is generally +voluminous so it can be hidden by default, made visible only to find +out more about what was happening when a particular problem occurred. +Similarly the ethernet device support can output details of the +various packets being transferred, and using a different background +colour for this output again makes it easier to distinguish from +console output. +

The default appearance for most filters is controlled via the +target definition file. An +example entry might be: +

  filter trace {^TRACE:.*} -foreground HotPink1 -hide 1

The various colours and the hide flag for each filter can be changed +at run-time, using the System Filters item +on the View menu. This will bring up a dialog like +the following: +

It should be noted that the text window is line-oriented, not +character-oriented. If an eCos application sends a partial line of +text then that will remain buffered until a newline character is +received, rather than being displayed immediately. This avoids +confusion when there is concurrent output from several sources. +

By default the text window is read-only. This means it will not allow +cut, paste and clear operations, and keyboard input will be ignored. +The Edit menu has a checkbutton Read +Only which can be toggled to allow write operations. For +example, a user could type in a reminder of what was happening at this +time, or paste in part of a gdb session. Such keyboard input does not +get forwarded to the eCos application: if the latter requires keyboard +input then that should happen via a separate keyboard device. +

Positioning Optional Windows

Some devices may create their own subwindows, for example to monitor +ethernet traffic or to provide additional I/O facilities such as +emulated LED's or buttons. Usually the target definition file can be +used to control the layout of +these windows. This requires an understanding of the overall layout of +the display. +

Subwindows are generally packed in one of eight frames surrounding the +central text window: .main.nw, +.main.n, .main.ne, +.main.w, .main.e, +.main.sw, .main.s, and +.main.se. To position a row of LED's above the text +window and towards the left, a target definition file could contain an +entry such as: +

synth_device led {
+    pack -in .main.n -side left
+    …
+}

Similarly, to put a traffic monitor window on the right of the text +window would involve something like: +

    …
+    monitor_pack -in .main.e -side bottom
+    …

Often it will be sufficient to specify a container frame and one of +left, right, +top or bottom. Full control +over the positioning requires an understanding of Tcl/Tk and in +particular the packing algorithm, and an appropriate reference work +should be consulted. +

Global Settings

Note: This section still to be written - it should document the interaction +between X resources and ecosynth, and how users can control settings +such as the main foreground and background colours. +


PrevHomeNext
Running a Synthetic Target Application The Console Device
\ No newline at end of file diff --git a/packages/hal/synth/arch/current/doc/synth-install.html b/packages/hal/synth/arch/current/doc/synth-install.html new file mode 100644 --- /dev/null +++ b/packages/hal/synth/arch/current/doc/synth-install.html @@ -0,0 +1,404 @@ + + + + + + + + +Installation +
eCos Synthetic Target
PrevNext

Installation

Name

Installation -- Preparing to use the synthetic target

Host-side Software

To get the full functionality of the synthetic target, users must +build and install the I/O auxiliary ecosynth and various support +files. It is possible to develop applications for the synthetic target +without the auxiliary, but only limited I/O facilities will be +available. The relevant code resides in the host subdirectory of the synthetic target +architectural HAL package, and building it involves the standard +configure, make, and +make install steps. +

There are two main ways of building the host-side software. It is +possible to build both the generic host-side software and all +package-specific host-side software, including the I/O auxiliary. in a +single build tree. This involves using the +configure script at the toplevel of the eCos +repository, which will automatically search the packages hierarchy for host-side +software. For more information on this, see the +README.host file at the top of the repository. +Note that if you have an existing build tree which does not include +the synthetic target architectural HAL package then it will be +necessary to rerun the toplevel configure script: the search for +appropriate packages happens at configure time. +

The alternative is to build just the host-side for this package. +This involves creating a suitable build directory and running the +configure script. Note that building directly in +the source tree is not allowed. +

$ cd <somewhere suitable>
+$ mkdir synth_build
+$ cd synth_build
+$ <repo<>/packages/hal/synth/arch/<version>/host/configure <options>
+$ make
+$ make install

The code makes extensive use of Tcl/TK and requires version 8.3 or +later. This is checked by the configure script. By +default it will use the system's Tcl installation in /usr. If a different, more recent Tcl +installation should be used then its location can be specified using +the options --with-tcl=<path>, +--with-tcl-header=<path> and +--with-tcl-lib=<path>. For more information on these options +see the README.host file at the toplevel of the +eCos repository. +

Some users may also want to specify the install location using a +--prefix=<path> option. The default install +location is /usr/local. It is +essential that the bin +subdirectory of the install location is on the user's search +PATH, otherwise the eCos application will be unable to +locate and execute the I/O auxiliary ecosynth. +

Because ecosynth is run automatically by an eCos application rather +than explicitly by the user, it is not installed in the bin subdirectory itself. Instead it is +installed below libexec, +together with various support files such as images. At configure time +it is usually possible to specify an alternative location for +libexec using +--exec-prefix=<path> or +--libexecdir=<path>. These options should not +be used for this package because the eCos application is built +completely separately and does not know how the host-side was +configured. +

Toolchain

When developing eCos applications for a normal embedded target it is +necessary to use a suitable cross-compiler and related tools such as +the linker. Developing for the synthetic target is easier because you +can just use the standard GNU tools (gcc, g++, ld, …) which +were provided with your Linux distribution, or which you used to build +your own Linux setup. Any reasonably recent version of the tools, for +example gcc 2.96(Red Hat) as shipped with Red Hat Linux 7, should be +sufficient. +

There is one important limitation when using these tools: current gdb +will not support debugging of eCos threads on the synthetic target. As +far as gdb is concerned a synthetic target application is +indistinguishable from a normal Linux application, so it assumes that +any threads will be created by calls to the Linux +pthread_create function provided by the C +library. Obviously this is not the case since the application is never +linked with that library. Therefore gdb never notices the eCos thread +mechanisms and assumes the application is single-threaded. Fixing this +is possible but would involve non-trivial changes to gdb. +

Theoretically it is possible to develop synthetic target applications +on, for example, a PC running Windows and then run the resulting +executables on another machine that runs Linux. This is rarely useful: +if a Linux machine is available then usually that machine will also be +used for building ecos and the application. However, if for some +reason it is necessary or desirable to build on another machine then +this requires a suitable cross-compiler and related tools. If the +application will be running on a typical PC with an x86 processor then +a suitable configure triplet would be +i686-pc-linux-gnu. The installation +instructions for the various GNU tools should be consulted for further +information. +

Hardware Preparation

Preparing a real embedded target for eCos development can be tricky. +Often the first step is to install suitable firmware, usually RedBoot. +This means creating and building a special configuration for eCos with +the RedBoot template, then somehow updating the target's flash chips +with the resulting RedBoot image. Typically it will also be necessary +to get a working serial connection, and possibly set up ethernet as +well. Although usually none of the individual steps are particularly +complicated, there are plenty of ways in which things can go wrong and +it can be hard to figure out what is actually happening. Of course +some board manufacturers make life easier for their developers by +shipping hardware with RedBoot preinstalled, but even then it is still +necessary to set up communication between host and target. +

None of this is applicable to the synthetic target. Instead you can +just build a normal eCos configuration, link your application with the +resulting libraries, and you end up with an executable that you can +run directly on your Linux machine or via gdb. A useful side effect of +this is that application development can start before any real +embedded hardware is actually available. +

Typically the memory map for a synthetic target application will be +set up such that there is a read-only ROM region containing all the +code and constant data, and a read-write RAM region for the data. The +default locations and sizes of these regions depend on the specific +platform being used for development. Note that the application always +executes out of ROM: on a real embedded target much of the development +would involve running RedBoot firmware there, with application code +and data loaded into RAM; usually this would change for the final +system; the firmware would be replaced by the eCos application itself, +configured for ROM bootstrap, and it would perform the appropriate +hardware initialization. Therefore the synthetic target actually +emulates the behaviour of a final system, not of a development +environment. In practice this is rarely significant, although having +the code in read-only memory can help catch some problems in +application code. +


PrevHomeNext
Overview Running a Synthetic Target Application
\ No newline at end of file diff --git a/packages/hal/synth/arch/current/doc/synth-new-host.html b/packages/hal/synth/arch/current/doc/synth-new-host.html new file mode 100644 --- /dev/null +++ b/packages/hal/synth/arch/current/doc/synth-new-host.html @@ -0,0 +1,1734 @@ + + + + + + + + +Writing New Devices - host +
eCos Synthetic Target
PrevNext

Writing New Devices - host

Name

Writing New Devices -- extending the synthetic target, host-side

Description

On the host-side adding a new device means writing a Tcl/Tk script +that will handle instantiation and subsequent requests from the +target-side. These scripts all run in the same full interpreter, +extended with various commands provided by the main I/O auxiliary +code, and running in an overall GUI framework. Some knowledge of +programming with Tcl/Tk is required to implement host-side device +support. +

Some devices can be implemented entirely using a Tcl/Tk script. For +example, if the final system will have some buttons then those can be +emulated in the synthetic target using a few Tk widgets. A simple +emulation could just have the right number of buttons in a row. A more +advanced emulation could organize the buttons with the right layout, +perhaps even matching the colour scheme, the shapes, and the relative +sizes. With other devices it may be necessary for the Tcl script to +interact with an external program, because the required functionality +cannot easily be accessed from a Tcl script. For example interacting +with a raw ethernet device involves some ioctl +calls, which is easier to do in a C program. Therefore the +ethernet.tcl script which implements the +host-side ethernet support spawns a separate program +rawether, written in C, that performs the +low-level I/O. Raw ethernet access usually also requires root +privileges, and running a small program rawether +with such privileges is somewhat less of a security risk than the +whole eCos application, the I/O auxiliary, and various dynamically +loaded Tcl scripts. +

Because all scripts run in a single interpreter, some care has +to be taken to avoid accidental sharing of global variables. The best +way to avoid problems is to have each script create its own Tcl +namespace, so for example the ethernet.tcl script +creates a namespace ethernet:: and all variables +and procedures reside in this namespace. Similarly the I/O auxiliary +itself makes use of a synth:: namespace. +

Building and Installation

When an eCos device driver or application code instantiates a device, +the I/O auxiliary will attempt to load a matching Tcl script. The +third argument to synth_auxiliary_instantiate +specifies the type of device, for example ethernet, +and the I/O auxiliary will append a .tcl suffix +and look for a script ethernet.tcl. +

If the device being instantiated is application-specific rather than +part of an eCos package, the I/O auxiliary will look first in the +current directory, then in ~/.ecos/synth. If it is part of an eCos +package then the auxiliary will expect to find the Tcl script and any +support files below libexec/ecos in the install tree - note +that the same install tree must be used for the I/O auxiliary itself +and for any device driver support. The directory hierarchy below +libexec/ecos matches the +structure of the eCos repository, allowing multiple versions of a +package to be installed to allow for incompatible protocol changes. +

The preferred way to build host-side software is to use +autoconf and automake. Usually +this involves little more than copying the +acinclude.m4, configure.in +and Makefile.am files from an existing package, +for example the synthetic target ethernet driver, and then making +minor edits. In acinclude.m4 it may be necessary +to adjust the path to the root of the repository. +configure.in may require a similar change, and +the AC_INIT macro invocation will have to be +changed to match one of the files in the new package. A critical macro +in this file is ECOS_PACKAGE_DIRS which will set +up the correct install directory. Makefile.am may +require some more changes, for example to specify the data files that +should be installed (including the Tcl script). These files should +then be processed using aclocal, +autoconf and automake in that +order. Actually building the software then just involves +configure, make and +make install, as per the instructions in the +toplevel README.host file. +

To assist developers, if the environment variable +ECOSYNTH_DEVEL is set then a slightly different +algorithm is used for locating device Tcl scripts. Instead of looking +only in the install tree the I/O auxiliary will also look in the +source tree, and if the script there is more recent than the installed +version it will be used in preference. This allows developers to +modify the master copy without having to run make +install all the time. +

If a script needs to know where it has been installed it can examine +the Tcl variable synth::device_install_dir . This +variable gets updated whenever a script is loaded, so if the +value may be needed later it should be saved away in a device-specific +variable. +

Instantiation

The I/O auxiliary will source the device-specific +Tcl script when the eCos application first attempts to instantiate a +device of that type. The script should return a procedure that will be +invoked to instantiate a device. +

namespace eval ethernet {
+    …
+    proc instantiate { id instance data } {
+        …
+        return ethernet::handle_request
+    }
+}
+return ethernet::instantiate

The id argument is a unique identifier for this +device instance. It will also be supplied on subsequent calls to the +request handler, and will match the return value of +synth_auxiliary_instantiate on the target side. A +common use for this value is as an array index to support multiple +instances of this types of device. The instance and +data arguments match the corresponding arguments to +synth_auxiliary_instantiate on the target side, so +a typical value for instance would be +eth0, and data is used to pass +arbitrary initialization parameters from target to host. +

The actual work done by the instantiation procedure is obviously +device-specific. It may involve allocating an interrupt vector, adding a +device-specific subwindow to the display, opening a real Linux device, +establishing a socket connection to some server, spawning a separate +process to handle the actual I/O, or a combination of some or all of +the above. +

If the device is successfully instantiated then the return value +should be a handler for subsequent I/O requests. Otherwise the return +value should be an empty string, and on the target-side the +synth_auxiliary_instantiate call will return +-1. The script is responsible for providing +diagnostics explaining +why the device could not be instantiated. +

Handling Requests

When the target-side calls +synth_auxiliary_xchgmsg, the I/O auxiliary will +end up calling the request handler for the appropriate device instance +returned during instantiation: +

namespace eval ethernet {
+    …
+    proc handle_request { id request arg1 arg2 txdata txlen max_rxlen } {
+        …
+        if { <some condition> } {
+            synth::send_reply <error code> 0 ""
+            return
+        }
+        …
+        synth::send_reply <reply code> $packet_len $packet
+    }
+    …
+}

The id argument is the same device id that was +passed to the instantiate function, and is typically used as an array +index to access per-device data. The request, +arg1, arg2, and +max_rxlen are the same values that were passed to +synth_auxiliary_xchgmsg on the target-side, +although since this is a Tcl script obviously the numbers have been +converted to strings. The txdata buffer is raw data +as transmitted by the target, or an empty string if the I/O operation +does not involve any additional data. The Tcl procedures +binary scan, string index and +string range may be found especially useful when +manipulating this buffer. txlen is provided for +convenience, although string length $txdata would +give the same information. +

The code for actually processing the request is of course device +specific. If the target does not expect a reply then the request +handler should just return when finished. If a reply is expected then +there should be a call to synth::send_reply. The +first argument is the reply code, and will be turned into a 32-bit +integer on the target side. The second argument specifies the length +of the reply data, and the third argument is the reply data itself. +For some devices the Tcl procedure binary format +may prove useful. If the reply involves just a code and no additional +data, the second and third arguments should be 0 +and an empty string respectively. +

Attempts to send a reply when none is expected, fail to send a reply +when one is expected, or send a reply that is larger than the +target-side expects, will all be detected by the I/O auxiliary and +result in run-time error messages. +

It is not possible for the host-side code to send unsolicited messages +to the target. If host-side code needs attention from the target, for +example because some I/O operation has completed, then an interrupt +should be raised. +

Interrupts

The I/O auxiliary provides a number of procedures for interrupt +handling. +

synth::interrupt_allocate <name>
+synth::interrupt_get_max
+synth::interrupt_get_devicename <vector>
+synth::interrupt_raise <vector>

synth::interrupt_allocate is normally called during +device instantiation, and returns the next free interrupt vector. This +can be passed on to the target-side device driver in response to a +suitable request, and it can then install an interrupt handler on that +vector. Interrupt vector 0 is used within the +target-side code for the real-time clock, so the allocated vectors +will start at 1. The argument identifies the +device, for example eth0. This is not actually used +internally, but can be accessed by user-initialization scripts that +provide some sort of interrupt monitoring facility (typically via the +interrupt hook). It is possible for a +single device to allocate multiple interrupt vectors, but the +synthetic target supports a maximum of 32 such vectors. +

synth::interrupt_get_max returns the highest +interrupt vector that has been allocated, or 0 if +there have been no calls to +synth::interrupt_allocate. +synth::interrupt_get_devicename returns the string +that was passed to synth::interrupt_allocate when +the vector was allocated. +

synth::interrupt_raise can be called any time after +initialization. The argument should be the vector returned by +synth::interrupt_allocate for this device. It will +activate the normal eCos interrupt handling mechanism so, subject to +interrupts being enabled and this particular interrupt not being +masked out, the appropriate ISR will run. +

Note: At this time it is not possible for a device to allocate a specific +interrupt vector. The order in which interrupt vectors are assigned to +devices effectively depends on the order in which the eCos devices get +initialized, and that may change if the eCos application is rebuilt. A +future extension may allow devices to allocate specific vectors, thus +making things more deterministic. However that will introduce new +problems, in particular the code will have to start worrying about +requests for vectors that have already been allocated. +

Flags and Command Line Arguments

The generic I/O auxiliary code will process the standard command line +arguments, and will set various flag variables accordingly. Some of +these should be checked by device-specific scripts. +

synth::flag_gui

This is set when the I/O auxiliary is operating in graphical mode +rather than text mode. Some functionality such as filters and the GUI +layout are only available in graphical mode. +

    if { $synth::flag_gui } {
+        …
+    }
synth::flag_verbose

The user has requested additional information during startup. Each +device driver can decide how much additional information, if any, +should be produced. +

synth::flag_keep_going

The user has specified -k or +--keep-going, so even if an error occurs the I/O +auxiliary and the various device driver scripts should continue running +if at all possible. Diagnostics should still be generated. +

Some scripts may want to support additional command line arguments. +This facility should be used with care since there is no way to +prevent two different scripts from trying to use the same argument. +The following Tcl procedures are available: +

synth::argv_defined <name>
+synth::argv_get_value <name>

synth::argv_defined returns a boolean to indicate +whether or not a particular argument is present. If the argument is +the name part of a name/value pair, an = character +should be appended. Typical uses might be: +

    if { [synth::argv_defined "-o13"] } {
+        …
+    }
+
+    if { [synth::argv_defined "-mark="] } {
+        …
+    }

The first call checks for a flag -o13 or +--o13 - the code treats options with single and +double hyphens interchangeably. The second call checks for an argument +of the form -mark=<value> or a pair of +arguments -mark <value>. The value part of a +name/value pair can be obtained using +synth::argv_get_value; +

    variable speed 1
+    if { [synth::argv_defined "-mark="] } {
+        set mark [synth::argv_get_value "-mark="]
+        if { ![string is integer $mark] || ($mark < 1) || ($mark > 9) } {
+            <issue diagnostic>
+        } else {
+            set speed $mark
+        }
+    }

synth::argv_get_value should only be used after a +successful call to synth::argv_defined. +At present there is no support for some advanced forms of command line +argument processing. For example it is not possible to repeat a +certain option such as -v or +--verbose, with each occurrence increasing the level +of verbosity. +

If a script is going to have its own set of command-line arguments +then it should give appropriate details if the user specifies +--help. This involves a hook function: +

namespace eval my_device {
+    proc help_hook { } {
+        puts " -o13          : activate the omega 13 device"
+        puts " -mark <speed> : set speed. Valid values are 1 to 9."
+    }
+
+    synth::hook_add "help" my_device::help_hook
+}

The Target Definition File

Most device scripts will want to check entries in the target +definition file for run-time configuration information. The Tcl +procedures for this are as follows: +

synth::tdf_has_device <name>
+synth::tdf_get_devices
+synth::tdf_has_option <devname> <option>
+synth::tdf_get_option <devname> <option>
+synth::tdf_get_options <devname> <option>
+synth::tdf_get_all_options <devname>

synth::tdf_has_device can be used to check whether +or not the target definition file had an entry +synth_device <name>. Usually the name +will match the type of device, so the +console.tcl script will look for a target +definition file entry console. +synth::tdf_get_devices returns a list of all +device entries in the target definition file. +

Once it is known that the target definition file has an entry for a +certain device, it is possible to check for options within the entry. +synth::tdf_has_option just checks for the presence, +returning a boolean: +

    if { [synth::tdf_has_option "console" "appearance"] } {
+        …
+    }

synth::tdf_get_option returns a list of all the +arguments for a given option. For example, if the target definition +file contains an entry: +

synth_device console {
+    appearance -foreground white -background black
+    filter trace {^TRACE:.*} -foreground HotPink1 -hide 1
+    filter xyzzy {.*xyzzy.*} -foreground PapayaWhip
+}

A call +synth::tdf_get_option console appearance +will return the list {-foreground white -background +black}. This list can be manipulated using standard Tcl routines +such as llength and lindex. Some +options can occur multiple times in one entry, for example +filter in the console entry. +synth::tdf_get_options returns a list of lists, +with one entry for each option occurrence. +synth::tdf_get_all_options returns a list of lists +of all options. This time each entry will include the option name as +well. +

The I/O auxiliary will not issue warnings about entries in the target +definition file for devices which were not loaded, unless the +-v or --verbose command line +argument was used. This makes it easier to use a single target +definition file for different applications. However the auxiliary will +issue warnings about options within an entry that were ignored, +because often these indicate a typing mistake of some sort. Hence a +script should always call synth::tdf_has_option, +synth:;tdf_get_option or +synth::tdf_get_options for all valid options, even +if some of the options preclude the use of others. +

Hooks

Some scripts may want to take action when particular events occur, for +example when the eCos application has exited and there is no need for +further I/O. This is supported using hooks: +

namespace eval my_device {
+    …
+    proc handle_ecos_exit { arg_list } {
+        …
+    }
+    synth::hook_add "ecos_exit" my_device::handle_ecos_exit
+}

It is possible for device scripts to add their own hooks and call all +functions registered for those hooks. A typical use for this is by +user initialization scripts that want to monitor some types of I/O. +The available Tcl procedures for manipulating hooks are: +

synth::hook_define <name>
+synth::hook_defined <name>
+synth::hook_add <name> <function>
+synth::hook_call <name> <args>

synth::hook_define creates a new hook with the +specified name. This hook must not already exist. +synth::hook_defined can be used to check for the +existence of a hook. synth::hook_add allows other +scripts to register a callback function for this hook, and +synth::hook_call allows the owner script to invoke +all such callback functions. A hook must already be defined before a +callback can be attached. Therefore typically device scripts will only +use standard hooks and their own hooks, not hooks created by some +other device, because the order of device initialization is not +sufficiently defined. User scripts run from +mainrc.tcl can use any hooks that have been +defined. +

synth::hook_call takes an arbitrary list of +arguments, for example: +

    synth::hook_call "ethernet_rx" "eth0" $packet

The callback function will always be invoked with a single argument, +a list of the arguments that were passed to +synth::hook_call: +

    proc rx_callback { arg_list } {
+        set device [lindex $arg_list 0]
+        set packet [lindex $arg_list 1]
+    }

Although it might seem more appropriate to use Tcl's +eval procedure and have the callback functions +invoked with the right number of arguments rather than a single list, +that would cause serious problems if any of the data contained special +characters such as [ or $. The +current implementation of hooks avoids such problems, at the cost of +minor inconvenience when writing callbacks. +

A number of hooks are defined as standard. Some devices will add +additional hooks, and the device-specific documentation should be +consulted for those. User scripts can add their own hooks if desired. +

exit

This hook is called just before the I/O auxiliary exits. Hence it +provides much the same functionality as atexit in +C programs. The argument list passed to the callback function will be +empty. +

ecos_exit

This hook is called when the eCos application has exited. It is used +mainly to shut down I/O operations: if the application is no longer +running then there is no point in raising interrupts or storing +incoming packets. The callback argument list will be empty. +

ecos_initialized

The synthetic target HAL will send a request to the I/O auxiliary once +the static constructors have been run. All devices should now have been +instantiated. A script could now check how many instances there are of +a given type of device, for example ethernet devices, and create a +little monitor window showing traffic on all the devices. The +ecos_initialized callbacks will be run just before +the user's mainrc.tcl script. The callback +argument list will be empty. +

help

This hook is also invoked once static constructors have been run, but +only if the user specified -h or +--help. Any scripts that add their own command line +arguments should add a callback to this hook which outputs details of +the additional arguments. The callback argument list will be empty. +

interrupt

Whenever a device calls synth::interrupt_raise the +interrupt hook will be called with a single +argument, the interrupt vector. The main use for this is to allow +user scripts to monitor interrupt traffic. +

Output and Filters

Scripts can use conventional facilities for sending text output to the +user, for example calling puts or directly +manipulating the central text widget +.main.centre.text. However in nearly all cases it +is better to use output facilities provided by the I/O auxiliary +itself: +

synth::report <msg>
+synth::report_warning <msg>
+synth::report_error <msg>
+synth::internal_error <msg>
+synth::output <msg> <filter>

synth::report is intended for messages related to +the operation of the I/O auxiliary itself, especially additional +output resulting from -v or +--verbose. If running in text mode the output will go +to standard output. If running in graphical mode the output will go to +the central text window. In both modes, use of -l or +--logfile will modify the behaviour. +

synth::report_warning, +synth::report_error and +synth::internal_error have the obvious meaning, +including prepending strings such as Warning: and +Error:. When the eCos application informs the I/O +auxiliary that all static constructors have run, if at that point +there have been any calls to synth::error then the +I/O auxiliary will exit. This can be suppressed with command line +arguments -k or --keep-going. +synth::internal_error will output some information +about the current state of the I/O auxiliary and then exit +immediately. Of course it should never be necessary to call this +function. +

synth::output is the main routine for outputting +text. The second argument identifies a filter. If running in text mode +the filter is ignored, but if running in graphical mode the filter can +be used to control the appearance of this output. A typical use would +be: +

    synth::output $line "console"

This outputs a single line of text using the +console filter. If running in graphical mode the +default appearance of this text can be modified with the +appearance option in the +synth_device console entry of the target +definition file. The System filters menu +option can be used to change the appearance at run-time. +

Filters should be created before they are used. The procedures +available for this are: +

synth::filter_exists <name>
+synth::filter_get_list
+synth::filter_add <name> [options]
+synth::filter_parse_options <options> <parsed_options> <message>
+synth::filter_add_parsed <name> <parsed_options>

synth::filter_exists can be used to check whether +or not a particular filter already exists: creating two filters with +the same name is not allowed. +synth::filter_get_list returns a list of the +current known filters. synth::filter_add can be +used to create a new filter. The first argument names the new filter, +and the remaining arguments control the initial appearance. A typical +use might be: +

    synth::filter_add "my_device_tx" -foreground yellow -hide 1

It is assumed that the supplied arguments are valid, which typically +means that they are hard-wired in the script. If instead the data +comes out of a configuration file and hence may be invalid, the +I/O auxiliary provides a parsing utility. Typical usage would be: +

    array set parsed_options [list]
+    set message ""
+    if { ![synth::filter_parse_options $console_appearance parsed_options message] } {
+        synth::report_error \
+	        "Invalid entry in target definition file $synth::target_definition\
+	         \n  synth_device \"console\", entry \"appearance\"\n$message"
+    } else {
+        synth::filter_add_parsed "console" parsed_options
+    }

On success parsed_options will be updated with an +internal representation of the desired appearance, which can then be +used in a call to synth::filter_add_parsed. On +failure message will be updated with details of the +parsing error that occurred. +

The Graphical Interface

When the I/O auxiliary is running in graphical mode, many scripts will +want to update the user interface in some way. This may be as simple +as adding another entry to the help menu for the device, or adding a +new button to the toolbar. It may also involve adding new subwindows, +or even creating entire new toplevel windows. These may be simple +monitor windows, displaying additional information about what is going +on in the system in a graphical format. Alternatively they may emulate +actual I/O operations, for example button widgets could be used to +emulate real physical buttons. +

The I/O auxiliary does not provide many procedures related to the +graphical interface. Instead it is expected that scripts will just +update the widget hierarchy directly. +

So adding a new item to the Help menu involves a +.menubar.help add operation with suitable +arguments. Adding a new button to the toolbar involves creating a +child window in .toolbar and packing it +appropriately. Scripts can create their own subwindows and then pack +it into one of .main.nw, +.main.n, .main.ne, +.main.w, .main.e, +.main.sw, .main.s or +.main.se. Normally the user should be allowed to +control this via the target +definition file. The central window .main.centre +should normally be left alone by other scripts since it gets used for +text output. +

The following graphics-related utilities may be found useful: +

synth::load_image <image name> <filename>
+synth::register_ballon_help <widget> <message>
+synth::handle_help <URL>

synth::load_image can be used to add a new image to +the current interpreter. If the specified file has a +.xbm extension then the image will be a +monochrome bitmap, otherwise it will be a colour image of some sort. +A boolean will be returned to indicate success or failure, and +suitable diagnostics will be generated if necessary. +

synth::register_balloon_help provides balloon help +for a specific widget, usually a button on the toolbar. +

synth::handle_help is a utility routine that can be +installed as the command for displaying online help, for example: +

    .menubar.help add command -label "my device" -command \
+        [list synth::handle_help "file://$path"]

PrevHomeNext
Writing New Devices - target Porting
\ No newline at end of file diff --git a/packages/hal/synth/arch/current/doc/synth-new-target.html b/packages/hal/synth/arch/current/doc/synth-new-target.html new file mode 100644 --- /dev/null +++ b/packages/hal/synth/arch/current/doc/synth-new-target.html @@ -0,0 +1,823 @@ + + + + + + + + +Writing New Devices - target +
eCos Synthetic Target
PrevNext

Writing New Devices - target

Name

Writing New Devices -- extending the synthetic target, target-side

Description

In some ways writing a device driver for the synthetic target is very +similar to writing one for a real target. Obviously it has to provide +the standard interface for that class of device, so for example an +ethernet device has to provide can_send, +send, recv and similar +functions. Many devices will involve interrupts, so the driver +contains ISR and DSR functions and will call +cyg_drv_interrupt_create, +cyg_drv_interrupt_acknowledge, and related +functions. +

In other ways writing a device driver for the synthetic target is very +different. Usually the driver will not have any direct access to the +underlying hardware. In fact for some devices the I/O may not involve +real hardware, instead everything is emulated by widgets on the +graphical display. Therefore the driver cannot just peek and poke +device registers, instead it must interact with host-side code by +exchanging message. The synthetic target HAL provides a function +synth_auxiliary_xchgmsg for this purpose. +

Initialization of a synthetic target device driver is also very +different. On real targets the device hardware already exists when the +driver's initialization routine runs. On the synthetic target it is +first necessary to instantiate the device inside the I/O auxiliary, by +a call to synth_auxiliary_instantiate. That +function performs a special message exchange with the I/O auxiliary, +causing it to load a Tcl script for the desired type of device and run +an instantiation procedure within that script. +

Use of the I/O auxiliary is optional: if the user does not specify +--io on the command line then the auxiliary will not +be started and hence most I/O operations will not be possible. Device +drivers should allow for this possibility, for example by just +discarding any data that gets written. The HAL exports a flag +synth_auxiliary_running which should be checked. +

Instantiating a Device

Device instantiation should happen during the C++ prioritized static +constructor phase of system initialization, before control switches to +cyg_user_start and general application code. This +ensures that there is a clearly defined point at which the I/O +auxiliary knows that all required devices have been loaded. It can +then perform various consistency checks and clean-ups, run the user's +mainrc.tcl script, and make the main window +visible. +

For standard devices generic eCos I/O code will call the device +initialization routines at the right time, iterating through the +DEVTAB table in a static constructor. The same +holds for network devices and file systems. For more custom devices +code like the following can be used: +

#include <cyg/infra/cyg_type.h>
+class mydev_init {
+  public:
+    mydev_init() {
+        …
+    }
+};
+static mydev_init mydev_init_object CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_IO);

Some care has to be taken because the object +mydev_init_object will typically not be referenced +by other code, and hence may get eliminated at link-time. If the code +is part of an eCos package then problems can be avoided by putting the +relevant file in libextras.a: +

cdl_package CYGPKG_DEVS_MINE {
+    …
+    compile -library=libextras.a init.cxx
+}

For devices inside application code the same can be achieved by +linking the relevant module as a .o file rather +than putting it in a .a library. +

In the device initialization routine the main operation is a call to +synth_auxiliary_instantiate. This takes five +arguments, all of which should be strings: +

package

For device drivers which are eCos packages this should be a directory +path relative to the eCos repository, for example +devs/eth/synth/ecosynth. This will allow the I/O +auxiliary to find the various host-side support files for this package +within the install tree. If the device is application-specific and not +part of an eCos package then a NULL pointer can be used, causing the +I/O auxiliary to search for the support files in the current directory +and then in ~/.ecos/synth +instead. +

version

For eCos packages this argument should be the version of the package +that is being used, for example current. A simple +way to get this version is to use the +SYNTH_MAKESTRING macro on the package name. +If the device is application-specific then a NULL pointer should be +used. +

device

This argument specifies the type of device being instantiated, for +example ethernet. More specifically the I/O +auxiliary will append a .tcl suffix, giving +the name of a Tcl script that will handle all I/O requests for the +device. If the application requires several instances of a type +of device then the script will only be loaded once, but the script +will contain an instantiation procedure that will be called for each +device instance. +

instance

If it is possible to have multiple instances of a device then this +argument identifies the particular instance, for example +eth0 or eth1. Otherwise a NULL +pointer can be used. +

data

This argument can be used to pass additional initialization data from +eCos to the host-side support. This is useful for devices where eCos +configury must control certain aspects of the device, rather than +host-side configury such as the target definition file, because eCos +has compile-time dependencies on some or all of the relevant options. +An example might be an emulated frame buffer where eCos has been +statically configured for a particular screen size, orientation and +depth. There is no fixed format for this string, it will be +interpreted only by the device-specific host-side Tcl script. However +the string length should be limited to a couple of hundred bytes to +avoid possible buffer overflow problems. +

Typical usage would look like: +

    if (!synth_auxiliary_running) {
+      return;
+    }
+    id = synth_auxiliary_instantiate("devs/eth/synth/ecosynth",
+             SYNTH_MAKESTRING(CYGPKG_DEVS_ETH_ECOSYNTH),
+             "ethernet",
+             "eth0",
+             (const char*) 0);

The return value will be a device identifier which can be used for +subsequent calls to synth_auxiliary_xchgmsg. If +the device could not be instantiated then -1 will +be returned. It is the responsibility of the host-side software to +issue suitable diagnostics explaining what went wrong, so normally the +target-side code should fail silently. +

Once the desired device has been instantiated, often it will be +necessary to do some additional initialization by a message exchange. +For example an ethernet device might need information from the +host-side about the MAC address, the interrupt vector, and +whether or not multicasting is supported. +

Communicating with a Device

Once a device has been instantiated it is possible to perform I/O by +sending messages to the appropriate Tcl script running inside the +auxiliary, and optionally getting back replies. I/O operations are +always initiated by the eCos target-side, it is not possible for the +host-side software to initiate data transfers. However the host-side +can raise interrupts, and the interrupt handler inside the target can +then exchange one or more messages with the host. +

There is a single function to perform I/O operations, +synth_auxiliary_xchgmsg. This takes the following +arguments: +

device_id

This should be one of the identifiers returned by a previous +call to synth_auxiliary_instantiate, specifying the +particular device which should perform some I/O. +

request

Request are just signed 32-bit integers that identify the particular +I/O operation being requested. There is no fixed set of codes, instead +each type of device can define its own. +

arg1, arg2

For some requests it is convenient to pass one or two additional +parameters alongside the request code. For example an ethernet device +could define a multicast-all request, with arg1 +controlling whether this mode should be enabled or disabled. Both +arg1 and arg2 should be signed +32-bit integers, and their values are interpreted only by the +device-specific Tcl script. +

txdata, txlen

Some I/O operations may involve sending additional data, for example +an ethernet packet. Alternatively a control operation may require many +more parameters than can easily be encoded in arg1 +and arg2, so those parameters have to be placed in +a suitable buffer and extracted at the other end. +txdata is an arbitrary buffer of +txlen bytes that should be sent to the host-side. +There is no specific upper bound on the number of bytes that can be +sent, but usually it is a good idea to allocate the transmit buffer +statically and keep transfers down to at most several kilobytes. +

reply

If the host-side is expected to send a reply message then +reply should be a pointer to an integer variable +and will be updated with a reply code, a simple 32-bit integer. The +synthetic target HAL code assumes that the host-side and target-side +agree on the protocol being used: if the host-side will not send a +reply to this message then the reply argument +should be a NULL pointer; otherwise the host-side must always send +a reply code and the reply argument must be valid. +

rxdata, rxlen

Some operations may involve additional data coming from the host-side, +for example an incoming ethernet packet. rxdata +should be a suitably-sized buffer, and rxlen a +pointer to an integer variable that will end up containing the number +of bytes that were actually received. These arguments will only be +used if the host-side is expected to send a reply and hence the +reply argument was not NULL. +

max_rxlen

If a reply to this message is expected and that reply may involve +additional data, max_rxlen limits the size of that +reply. In other words, it corresponds to the size of the +rxdata buffer. +

Most I/O operations involve only some of the arguments. For example +transmitting an ethernet packet would use the +request, txdata and +txlen fields (in addition to +device_id which is always required), but would not +involve arg1 or arg2 and no +reply would be expected. Receiving an ethernet packet would involve +request, rxdata, +rxlen and max_rxlen; in addition +reply is needed to get any reply from the host-side +at all, and could be used to indicate whether or not any more packets +are buffered up. A control operation such as enabling multicast mode +would involve request and arg1, +but none of the remaining arguments. +

Interrupt Handling

Interrupt handling in the synthetic target is much the same as on a +real target. An interrupt object is created using +cyg_drv_interrupt_create, attached, and unmasked. +The emulated device - in other words the Tcl script running inside the +I/O auxiliary - can raise an interrupt. Subject to interrupts being +disabled and the appropriate vector being masked, the system will +invoke the specified ISR function. The synthetic target HAL +implementation does have some limitations: there is no support for +nested interrupts, interrupt priorities, or a separate interrupt +stack. Supporting those might be appropriate when targetting a +simulator that attempts to model real hardware accurately, but not for +the simple emulation provided by the synthetic target. +

Of course the actual implementation of the ISR and DSR functions will +be rather different for a synthetic target device driver. For real +hardware the device driver will interact with the device by reading +and writing device registers, managing DMA engines, and the like. A +synthetic target driver will instead call +synth_auxiliary_xchgmsg to perform the I/O +operations. +

There is one other significant difference between interrupt handling +on the synthetic target and on real hardware. Usually the eCos code +will know which interrupt vectors are used for which devices. That +information is fixed when the target hardware is designed. With the +synthetic target interrupt vectors are assigned to devices on the host +side, either via the target definition file or dynamically when the +device is instantiated. Therefore the initialization code for a +target-side device driver will need to request interrupt vector +information from the host-side, via a message exchange. Such interrupt +vectors will be in the range 1 to 31 inclusive, with interrupt 0 being +reserved for the real-time clock. +


PrevHomeNext
System Calls Writing New Devices - host
\ No newline at end of file diff --git a/packages/hal/synth/arch/current/doc/synth-porting.html b/packages/hal/synth/arch/current/doc/synth-porting.html --- a/packages/hal/synth/arch/current/doc/synth-porting.html +++ b/packages/hal/synth/arch/current/doc/synth-porting.html @@ -3,9 +3,6 @@ - - - @@ -16,14 +13,14 @@ >