summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/i386ex
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/i386/i386ex')
-rw-r--r--c/src/lib/libbsp/i386/i386ex/.cvsignore8
-rw-r--r--c/src/lib/libbsp/i386/i386ex/ChangeLog747
-rw-r--r--c/src/lib/libbsp/i386/i386ex/Makefile.am83
-rw-r--r--c/src/lib/libbsp/i386/i386ex/README27
-rw-r--r--c/src/lib/libbsp/i386/i386ex/bsp_specs10
-rw-r--r--c/src/lib/libbsp/i386/i386ex/clock/ckinit.c133
-rw-r--r--c/src/lib/libbsp/i386/i386ex/configure.ac30
-rw-r--r--c/src/lib/libbsp/i386/i386ex/console/console.c302
-rw-r--r--c/src/lib/libbsp/i386/i386ex/include/.cvsignore4
-rw-r--r--c/src/lib/libbsp/i386/i386ex/include/bsp.h67
-rw-r--r--c/src/lib/libbsp/i386/i386ex/include/coverhd.h102
-rw-r--r--c/src/lib/libbsp/i386/i386ex/include/tm27.h34
-rw-r--r--c/src/lib/libbsp/i386/i386ex/make/custom/i386ex.cfg25
-rw-r--r--c/src/lib/libbsp/i386/i386ex/network/netexterns.h18
-rw-r--r--c/src/lib/libbsp/i386/i386ex/network/network.c2724
-rw-r--r--c/src/lib/libbsp/i386/i386ex/network/uti596.h284
-rw-r--r--c/src/lib/libbsp/i386/i386ex/preinstall.am91
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/80386ex.h252
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/80386ex.inc252
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/macros.inc115
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/start.S480
-rw-r--r--c/src/lib/libbsp/i386/i386ex/startup/README17
-rw-r--r--c/src/lib/libbsp/i386/i386ex/startup/bspstart.c39
-rw-r--r--c/src/lib/libbsp/i386/i386ex/startup/linkcmds210
-rw-r--r--c/src/lib/libbsp/i386/i386ex/timer/timer.c129
-rw-r--r--c/src/lib/libbsp/i386/i386ex/timer/timerisr.S39
26 files changed, 0 insertions, 6222 deletions
diff --git a/c/src/lib/libbsp/i386/i386ex/.cvsignore b/c/src/lib/libbsp/i386/i386ex/.cvsignore
deleted file mode 100644
index baba64eafa..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-aclocal.m4
-autom4te*.cache
-config.cache
-config.log
-config.status
-configure
-Makefile
-Makefile.in
diff --git a/c/src/lib/libbsp/i386/i386ex/ChangeLog b/c/src/lib/libbsp/i386/i386ex/ChangeLog
deleted file mode 100644
index e4f06c89b0..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/ChangeLog
+++ /dev/null
@@ -1,747 +0,0 @@
-2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * include/bsp.h, include/tm27.h, network/network.c:
- Use "__asm__" instead of "asm" for improved c99-compliance.
-
-2011-02-09 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * timer/timer.c: Include <rtems/btimer.h>.
- Fix benchmark_timer_read() definition.
-
-2011-02-02 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * configure.ac: Require autoconf-2.68, automake-1.11.1.
-
-2011-01-28 Joel Sherrill <joel.sherrilL@OARcorp.com>
-
- * console/console.c: Fix typo where license said found in found in.
-
-2010-05-21 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * Makefile.am: Add bspreset.c
-
-2010-04-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
-
- * Makefile.am, preinstall.am: Update for generic interrupt support
- changes.
-
-2009-12-10 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * console/console.c: Eliminate casts.
-
-2009-11-06 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * clock/ckinit.c: Fix Clock_isr prototype.
- * network/network.c: Use PRI*32 to print uint32_t's.
-
-2009-10-21 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * make/custom/i386ex.cfg: Remove RTEMS_BSP_FAMILY.
-
-2009-10-20 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * configure.ac: Don't add -ansi -fasm to CFLAGS.
-
-2009-10-15 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * make/custom/i386ex.cfg: New (relocated from /make/custom).
-
-2009-09-30 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * console/console.c: Reflect termios_baud_to_number having been
- renamed to rtems_termios_baud_to_number.
-
-2009-09-15 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * configure.ac: Remove RTEMS_BSP_BOOTCARD_OPTIONS.
-
-2009-08-06 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * startup/setvec.c: Removed.
-
-2009-08-06 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * include/tm27.h: Remove references to rtems_interrupt_catch since this
- archiecture does not use Simple Vectored Interrupt model.
-
-2009-07-16 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * configure.ac: Rename BSP_BOOTCARD_OPTIONS to
- RTEMS_BSP_BOOTCARD_OPTIONS. Add RTEMS_BSP_CLEANUP_OPTIONS so all BSPs
- have the same options.
-
-2009-07-01 Sebastian Huber <sebastian.huber@embedded-brains.de>
-
- * Makefile.am, preinstall.am: Update for generic interrupt support.
-
-2009-04-28 Chris Johns <chrisj@rtems.org>
-
- * start/start.S: Update for boot_card command line change.
-
-2009-02-10 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * clock/ckinit.c, startup/bspstart.c: Add prototypes.
-
-2008-12-04 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * bsp_specs: Move -e start from *link to *startfile to avoid warning
- for undefined entry symbol when linking relocatables with binutils
- 2.19.
-
-2008-09-30 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * timer/timer.c: Eliminate uses of old benchmark timer names.
-
-2008-09-30 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * Makefile.am: Eliminate bsp.am. Build startup files as side-effect
- of building libbspstart.a, using automake-rules.
-
-2008-09-29 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * Makefile.am: Eliminate *_SOURCES.
-
-2008-09-29 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * Makefile.am: Move noinst_LIBRARIES = libbsp.a before its
- components.
-
-2008-09-26 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * Makefile.am: Cleanup ../../shared/include/bootcard.h handling.
-
-2008-09-23 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * configure.ac: Make letting boot_card() handle work area allocation
- mandatory. Rename RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION to
- BSP_BOOTCARD_OPTIONS.
-
-2008-09-18 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * Makefile.am: Add use of shared bsppost.c
-
-2008-09-18 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * Makefile.am, configure.ac, startup/bspstart.c, startup/linkcmds: Use
- top level shared bsp_get_work_area() implementation.
-
-2008-09-18 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * include/bsp.h: Remove unnecessary variables and EXTERN magic.
-
-2008-09-18 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * include/bsp.h: Remove unnecessary boilerplate comments.
-
-2008-09-16 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * clock/ckinit.c, startup/bspstart.c: Remove unnecessary includes of
- rtems/libcsupport.h and rtems/libio.h.
-
-2008-09-05 Joel Sherrill <joel.sherrill@OARcorp.com>
-
- * clock/ckinit.c: The Shared Memory Driver no longer requires the
- special IOCTL in Clock_control. This was a hack which has existed
- since before the Classic API Timer Manager was implemented. All
- implementations of and references to Clock_control were removed.
-
-2008-09-05 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * timer/timer.c: Convert to "bool".
-
-2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * timer/timer.c: Eliminate empty function from every benchmark timer
- driver. Fix spelling.
-
-2008-08-31 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * timer/timer.c: Rename timer driver methods to follow RTEMS
- programming conventions.
-
-2008-08-16 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * timer/timer.c: Add missing prototypes.
-
-2008-05-23 Joel Sherrill <joel.sherrill@OARcorp.com>
-
- * console/console.c: Eliminate copies of switches to convert termios
- Bxxx constants to xxx as an integer. Use the shared
- termios_baud_to_number() routine to do the same conversion.
-
-2008-05-15 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * network/network.c: Eliminate patterns that look like CVS conflict
- markers.
-
-2008-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
-
- * startup/bspstart.c: Add capability for bootcard.c BSP Initialization
- Framework to ask the BSP where it has memory for the RTEMS Workspace
- and C Program Heap. These collectively are referred to as work area.
- If the BSP supports this, then it does not have to include code to
- split the available memory between the two areas. This reduces the
- amount of code in the BSP specific bspstart.c file. Additionally, the
- shared framework can initialize the C Library, call
- rtems_debug_enable(), and dirty the work area memory. Until most/all
- BSPs support this new capability, if the BSP supports this, it should
- call RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION from its configure.ac.
- When the transition is complete, this autoconf macro can be removed.
-
-2008-05-14 Joel Sherrill <joel.sherrill@OARcorp.com>
-
- * Makefile.am: Rework to avoid .rel files.
-
-2008-05-12 Joel Sherrill <joel.sherrill@OARcorp.com>
-
- * startup/bspstart.c: Refactored and renamed initialization routines to
- rtems_initialize_data_structures, rtems_initialize_before_drivers,
- rtems_initialize_device_drivers, and
- rtems_initialize_start_multitasking. This opened the sequence up so
- that bootcard() could provide a more robust and flexible framework
- which is easier to explain and understand. This also lays the
- groundwork for sharing the division of available memory between the
- RTEMS workspace and heap and the C library initialization across all
- BSPs.
-
-2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
-
- * startup/linkcmds: Add wildcard to gcc_except_table section so
- programs compiled with gcc 4.3.x can link.
-
-2007-12-11 Joel Sherrill <joel.sherrill@OARcorp.com>
-
- * clock/ckinit.c, include/bsp.h, startup/bspstart.c: Eliminate copies
- of the Configuration Table. Use the RTEMS provided accessor macros to
- obtain configuration fields.
-
-2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>
-
- * include/bsp.h, startup/bspstart.c: Move interrupt_stack_size field
- from CPU Table to Configuration Table. Eliminate CPU Table from all
- ports. Delete references to CPU Table in all forms.
-
-2007-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>
-
- * Makefile.am, startup/bspstart.c: Moved most of the remaining CPU
- Table fields to the Configuration Table. This included
- pretasking_hook, predriver_hook, postdriver_hook, idle_task,
- do_zero_of_workspace, extra_mpci_receive_server_stack,
- stack_allocate_hook, and stack_free_hook. As a side-effect of this
- effort some multiprocessing code was made conditional and some style
- clean up occurred.
-
-2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * startup/bspstart.c: Eliminate the interrupt_table_segment and
- interrupt_table_offset fields in the i386 CPU Table since they are
- never read.
-
-2007-05-03 Joel Sherrill <joel@OARcorp.com>
-
- * startup/linkcmds: Handle .data.* sections
-
-2007-04-12 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * bsp_specs: Remove qrtems_debug.
-
-2006-12-15 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * network/network.c (uti596_ioctl): Use ioctl_command_t.
-
-2006-12-02 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * configure.ac: New BUG-REPORT address.
-
-2006-11-15 Joel Sherrill <joel@OARcorp.com>
-
- * Makefile.am: Merge c_rtems_main() into boot_card(). This eliminated a
- file and simplified initialization.
-
-2006-10-17 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * Makefile.am: Remove superfluous -DASM.
-
-2006-10-17 Ralf Corsépius <ralf.corsepius@rtems.org>
-
- * configure.ac: Require autoconf-2.60. Require automake-1.10.
-
-2006-01-11 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * configure.ac: Remove explicit ampolish3 support (now in
- RTEMS_BSP_CONFIGURE).
-
-2006-01-10 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * configure.ac: Add ampolish3 support.
- * Makefile.am: Add preinstall.am.
-
-2005-10-17 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * Makefile.am: Add pci.rel.
-
-2005-10-17 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * Makefile.am: Install/preinstall headers from ../../i386/shared.
-
-2005-09-19 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * network/network.c: Remove #define KERNEL.
- Include <errno.h>.
- * Makefile.am: Add -D_KERNEL to network_CPPFLAGS.
-
-2005-05-26 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * include/bsp.h: New header guard.
-
-2005-05-06 Jennifer Averett <jennifer.averett@oarcorp.com>
-
- * clock/ckinit.c, console/console.c, include/bsp.h, startup/bspstart.c:
- Moved irq.h to bsp subdirectory.
-
-2005-05-03 Jennifer Averett <jennifer.averett@oarcorp.com>
-
- * clock/ckinit.c, console/console.c: Added support for
- addition of parameter to ISRs.
- * network/network.c: Modified parameter list to remove
- warnings.
-
-2005-04-15 Joel Sherrill <joel@OARcorp.com>
-
- * network/network.c: Fix warnings.
-
-2005-01-07 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * Makefile.am: Eliminate CFLAGS_OPTIMIZE_V.
-
-2005-01-02 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * Makefile.am: Remove build-variant support.
-
-2004-09-24 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * configure.ac: Require automake > 1.9.
-
-2004-07-28 Joel Sherrill <joel@OARcorp.com>
-
- * startup/linkcmds: Add gnu.linkonce.d and gcc_except_table sections.
-
-2004-07-25 Joel Sherrill <joel@OARcorp.com>
-
- * Makefile.am: Add -D__INSIDE_RTEMS_BSD_TCPIP_STACK__ for network.
-
-2004-04-23 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- PR 610/bsps
- * Makefile.am: Add include/tm27.h, Cosmetics.
- * include/tm27.h: Final cosmetics.
-
-2004-04-22 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * include/bsp.h: Split out tmtest27 support.
- * include/tm27.h: New.
-
-2004-04-21 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- PR 613/bsps
- * include/bsp.h: Remove MAX_LONG_TEST_DURATION.
-
-2004-04-21 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- PR 614/bsps
- * include/bsp.h: Remove MAX_SHORT_TEST_DURATION (Unused).
-
-2004-04-02 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * start/start.S: Include <rtems/asm.h> instead of <asm.h>.
- * timer/timerisr.S: Include <rtems/asm.h> instead of <asm.h>.
-
-2004-04-01 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * network/network.c: Include <rtems/asm.h> instead of <asm.h>.
- * include/bsp.h: Include <rtems/clockdrv.h> instead of <clockdrv.h>.
- * include/bsp.h: Include <rtems/console.h> instead of <console.h>.
- * include/bsp.h: Include <rtems/iosupp.h> instead of <iosupp.h>.
-
-2004-03-31 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * clock/ckinit.c, include/bsp.h, startup/bspstart.c, timer/timer.c:
- Convert to using c99 fixed size types.
-
-2004-02-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Reflect changes to bsp.am.
- Preinstall dist_project_lib*.
-
-2004-02-14 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Reflect changes to bsp.am.
-
-2004-02-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Use CPPASCOMPILE instead of CCASCOMPILE.
-
-2004-02-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Pickup files from ../../i386/shared instead of
- ../shared. Reformat.
-
-2004-01-30 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Merge-in clock/Makefile.am, console/Makefile.am,
- network/Makefile.am, startup/Makefile.am, timer/Makefile.am,
- wrapup/Makefile.am. Use automake compilation rules.
- * clock/Makefile.am, console/Makefile.am, network/Makefile.am,
- startup/Makefile.am, timer/Makefile.am, wrapup/Makefile.am: Remove.
- * configure.ac: Reflect changes above.
-
-2004-01-28 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * configure.ac: Add nostdinc to AUTOMAKE_OPTIONS.
- Add RTEMS_PROG_CCAS.
-
-2004-01-21 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Add PREINSTALL_DIRS.
- * wrapup/Makefile.am: Reflect changes to libcpu.
-
-2004-01-14 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Re-add dirstamps to PRE/TMPINSTALL_FILES.
- Add PRE/TMPINSTALL_FILES to CLEANFILES.
- * startup/Makefile.am: Ditto.
-
-2004-01-07 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * start/Makefile.am: Remove.
- * Makefile.am: Merge-in start/Makefile.am.
- * configure.ac: Reflect changes above.
-
-2004-01-05 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * wrapup/Makefile.am: Eliminate $(LIB).
- Use noinst_DATA to trigger building libbsp.a.
-
-2003-12-13 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * start/Makefile.am: s,${PROJECT_RELEASE}/lib,$(PROJECT_LIB),g.
- * startup/Makefile.am: s,${PROJECT_RELEASE}/lib,$(PROJECT_LIB),g.
-
-2003-12-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * start/Makefile.am: Use mkdir_p. Remove dirs from PRE/TMPINSTALL_FILES.
- * startup/Makefile.am: Use mkdir_p. Remove dirs from PRE/TMPINSTALL_FILES.
-
-2003-12-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * configure.ac: Require automake >= 1.8, autoconf >= 2.59.
-
-2003-12-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * wrapup/Makefile.am: Cosmetics.
-
-2003-12-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * start/Makefile.am: Misc cleanups and fixes.
- * startup/Makefile.am: Misc cleanups and fixes.
- * wrapup/Makefile.am: Misc cleanups and fixes.
-
-2003-12-02 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Add preinstallation dirstamp support.
- * clock/Makefile.am: Cosmetics.
- * console/Makefile.am: Cosmetics.
- * network/Makefile.am: Cosmetics.
- * startup/Makefile.am: Cosmetics.
- * timer/Makefile.am: Cosmetics.
- * wrapup/Makefile.am: Cosmetics
-
-2003-12-02 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * clock/Makefile.am: Remove all-local: $(ARCH).
- * console/Makefile.am: Remove all-local: $(ARCH).
- * network/Makefile.am: Remove all-local: $(ARCH).
- * start/Makefile.am: Remove all-local: $(ARCH).
- * startup/Makefile.am: Remove all-local: $(ARCH).
- * timer/Makefile.am: Remove all-local: $(ARCH).
- * wrapup/Makefile.am: Remove all-local: $(ARCH).
-
-2003-09-29 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Merge-in include/Makefile.am.
- Reflect changes to bsp.am.
- * include/Makefile.am: Remove.
- * configure.ac: Reflect changes above.
-
-2003-09-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * bsp_specs: Remove *lib:.
-
-2003-09-04 Joel Sherrill <joel@OARcorp.com>
-
- * clock/ckinit.c, console/console.c, include/bsp.h, include/coverhd.h,
- start/80386ex.h, start/80386ex.inc, start/macros.inc, start/start.S,
- startup/bspstart.c, startup/linkcmds, startup/setvec.c,
- timer/timer.c, timer/timerisr.S: URL for license changed.
-
-2003-08-18 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Reflect having moved aclocal/.
-
-2003-08-16 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Reflect having moved automake/.
- * clock/Makefile.am: Reflect having moved automake/.
- * console/Makefile.am: Reflect having moved automake/.
- * include/Makefile.am: Reflect having moved automake/.
- * network/Makefile.am: Reflect having moved automake/.
- * start/Makefile.am: Reflect having moved automake/.
- * startup/Makefile.am: Reflect having moved automake/.
- * timer/Makefile.am: Reflect having moved automake/.
- * wrapup/Makefile.am: Reflect having moved automake/.
-
-2003-08-13 Joel Sherrill <joel@OARcorp.com>
-
- PR 451/bsps
- * startup/Makefile.am: Include shared i386 TTY driver in these BSPs.
-
-2003-08-11 Joel Sherrill <joel@OARcorp.com>
-
- PR 450/make_build
- * startup/linkcmds: Added .eh_frame
-
-2003-08-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * configure.ac: Use rtems-bugs@rtems.com as bug report email address.
-
-2003-08-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- PR 445/bsps
- * bsp_specs: Remove -D__embedded__ -Asystem(embedded) from cpp.
- Remove cpp, old_cpp (now unused).
-
-2003-05-15 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * startup/Makefile.am: Remove -DBSP_IS_I386EX=1 (unused).
-
-2003-03-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * configure.ac: Remove AC_CONFIG_AUX_DIR.
-
-2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * configure.ac: AM_INIT_AUTOMAKE([1.7.2]).
-
-2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * configure.ac: AC_PREREQ(2.57).
-
-2003-01-20 Joel Sherrill <joel@OARcorp.com>
-
- * startup/linkcmds: Add FreeBSD SYSCTL() sections for networking.
-
-2002-12-19 Joel Sherrill <joel@OARcorp.com>
-
- * console/console.c: Removed __assert() which conflicts with newlib.
-
-2002-12-17 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * clock/Makefile.am: Don't include @RTEMS_BSP@.cfg.
- * console/Makefile.am: Don't include @RTEMS_BSP@.cfg.
- * network/Makefile.am: Don't include @RTEMS_BSP@.cfg.
- * start/Makefile.am: Don't include @RTEMS_BSP@.cfg.
- * startup/Makefile.am: Don't include @RTEMS_BSP@.cfg.
- * timer/Makefile.am: Don't include @RTEMS_BSP@.cfg.
-
-2002-12-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * start/Makefile.am: Use install-data-local to install startfile.
-
-2002-12-10 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * wrapup/Makefile.am: Don't include @RTEMS_BSP@.cfg.
-
-2002-11-04 Joel Sherrill <joel@OARcorp.com>
-
- * network/network.c: Removed warnings.
-
-2002-11-04 Joel Sherrill <joel@OARcorp.com>
-
- * console/console.c, network/network.c: Removed warnings.
-
-2002-11-01 Joel Sherrill <joel@OARcorp.com>
-
- * startup/bspstart.c: Removed warnings.
-
-2002-10-21 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * .cvsignore: Reformat.
- Add autom4te*cache.
- Remove autom4te.cache.
-
-2002-09-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * configure.ac: Remove duplicate timer/Makefile in AC_CONFIG_FILES.
-
-2002-08-21 Joel Sherrill <joel@OARcorp.com>
-
- * bsp_specs: Added support for -nostdlibs.
-
-2002-08-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * clock/Makefile.am: Use .$(OBJEXT) instead of .o.
- * console/Makefile.am: Use .$(OBJEXT) instead of .o.
- * network/Makefile.am: Use .$(OBJEXT) instead of .o.
- * start/Makefile.am: Use .$(OBJEXT) instead of .o.
- * startup/Makefile.am: Use .$(OBJEXT) instead of .o.
- * timer/Makefile.am: Use .$(OBJEXT) instead of .o.
- * wrapup/Makefile.am: Use .$(OBJEXT) instead of .o.
-
-2002-07-22 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * startup/bspstart.c: Per PR252 removed hack that tripled size of
- RTEMS Workspace when POSIX is configured. This was probably done to
- account for confdefs.h missing some application requirements.
-
-2002-07-20 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * start/Makefile.am: Eliminate PGM.
- Add bsplib_DATA = $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o.
-
-2002-07-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * startup/Makefile.am: Add bsplib_DATA = linkcmds.
-
-2002-07-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * wrapup/Makefile.am: Eliminate TMPINSTALL_FILES.
- Remove $(OBJS) from all-local.
-
-2002-06-29 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * wrapup/Makefile.am: Remove preinstallation of libbsp.a,
-
-2001-05-09 Joel Sherrill <joel@OARcorp.com>
-
- * startup/linkcmds: In support of gcc 3.1, added one of more
- of the sections .jcr, .rodata*, .data.*, .gnu.linkonce.s2.*,
- .gnu.linkonce.sb2.*, and .gnu.linkonce.s.*. Spacing corrections
- and direction of segments to memory regions may also have been
- addressed. This was a sweep across all BSPs.
-
-2002-03-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * include/bsp.h: include <libcpu/cpu.h>.
-
-2002-03-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * configure.ac:
- AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS).
- AM_INIT_AUTOMAKE([no-define foreign 1.6]).
- * clock/Makefile.am: Remove AUTOMAKE_OPTIONS.
- * Makefile.am: Remove AUTOMAKE_OPTIONS.
- * console/Makefile.am: Remove AUTOMAKE_OPTIONS.
- * include/Makefile.am: Remove AUTOMAKE_OPTIONS.
- * network/Makefile.am: Remove AUTOMAKE_OPTIONS.
- * start/Makefile.am: Remove AUTOMAKE_OPTIONS.
- * startup/Makefile.am: Remove AUTOMAKE_OPTIONS.
- * timer/Makefile.am: Remove AUTOMAKE_OPTIONS.
- * wrapup/Makefile.am: Remove AUTOMAKE_OPTIONS.
-
-2002-03-16 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * configure.ac: Remove stray ';', PR 139.
-
-2002-01-03 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * include/bsp.h: Include rtems/bspIo.h instead of bspIo.h.
-
-2001-12-22 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * bsp_specs: Replace -lrtemsall with -lrtemsbsp -lrtemscpu,
- replace -lrtemsall_g with -lrtemsbsp_g -lrtemscpu_g.
-
-2001-11-30 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * configure.ac: Introduce RTEMS_BSP_CONFIGURE.
-
-2001-10-25 Joel Sherrill <joel@OARcorp.com>
-
- * startup/linkcmds: Added _init and _fini.
-
-2001-10-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * .cvsignore: Add autom4te.cache for autoconf > 2.52.
- * configure.in: Remove.
- * configure.ac: New file, generated from configure.in by autoupdate.
-
-2001-09-27 Joel Sherrill <joel@OARcorp.com>
-
- * include/bsp.h: Renamed delay() to rtems_bsp_delay().
-
-2001-09-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * include/Makefile.am: Use 'PREINSTALL_FILES ='.
-
-2001-05-22 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * configure.in: Add bspopts.h.
- * include/bsp.h: Include bspopts.h.
- * include/.cvsignore: Add bspopts.h*, stamp-h*.
- * include/Makefile.am: Use *_HEADERS instead of *H_FILES.
- * start/Makefile.am: Dito.
- * network/Makefile.am: Dito.
-
-2001-05-10 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * configure.in: Use RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]).
-
-2000-11-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS.
-
-2000-11-02 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal.
-
-2000-11-01 Joel Sherrill <joel@OARcorp.com>
-
- * startup/bspstart.c: assoc.h, error.h, libio_.h, libio.h,
- and libcsupport.h moved from libc to lib/include/rtems and
- now must be referenced as <rtems/XXX.h>. Header file order
- was cleaned up while doing this.
-
-2000-10-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros.
- Switch to GNU canonicalization.
-
-2000-10-20 Joel Sherrill <joel@OARcorp.com>
-
- * console/console.c: Invoke BSP_uart_init() with enough arguments
- now that more communication parameters are settable.
-
-2000-10-17 Joel Sherrill <joel@OARcorp.com>
-
- * startup/Makefile.am: Added idt.c since it has been moved libcpu/i386
- to libbsp/i386/shared/irq.
-
-2000-09-29 Charles-Antoine Gauthier <charles.gauthier@nrc.ca>
-
- * startup/linkcmds: Added lines so DWARF debug information
- would be available. Otherwise gdb complains that the offsets
- for the debug info are incorrect and doesn't load the files.
-
-2000-09-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * start/Makefile.am: Remove AM_CPPFLAGS and GAS_CODE16 conditional.
-
-2000-09-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
-
- * clock/Makefile.am, console/Makefile.am, network/Makefile.am,
- start/Makefile.am, startup/Makefile.am, timer/Makefile.am,
- wrapup/Makefile.am: Include compile.am
-
-2000-08-10 Joel Sherrill <joel@OARcorp.com>
-
- * ChangeLog: New file.
diff --git a/c/src/lib/libbsp/i386/i386ex/Makefile.am b/c/src/lib/libbsp/i386/i386ex/Makefile.am
deleted file mode 100644
index 7e3ea8a628..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/Makefile.am
+++ /dev/null
@@ -1,83 +0,0 @@
-##
-## $Id$
-##
-
-ACLOCAL_AMFLAGS = -I ../../../../aclocal
-
-include $(top_srcdir)/../../../../automake/compile.am
-
-include_bspdir = $(includedir)/bsp
-
-dist_project_lib_DATA = bsp_specs
-
-include_HEADERS = include/bsp.h
-include_HEADERS += include/tm27.h
-
-nodist_include_HEADERS = include/bspopts.h
-nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h
-DISTCLEANFILES = include/bspopts.h
-
-noinst_PROGRAMS =
-
-include_HEADERS += include/coverhd.h
-
-include_bsp_HEADERS = ../../i386/shared/irq/irq.h \
- ../../i386/shared/irq/irq_asm.h \
- ../../shared/include/irq-generic.h \
- ../../shared/include/irq-info.h
-
-noinst_LIBRARIES = libbspstart.a
-libbspstart_a_SOURCES = start/start.S start/80386ex.h start/80386ex.inc \
- start/macros.inc
-project_lib_DATA = start.$(OBJEXT)
-
-dist_project_lib_DATA += startup/linkcmds
-
-noinst_LIBRARIES += libbsp.a
-libbsp_a_SOURCES =
-
-include_HEADERS += ../../i386/shared/comm/uart.h
-# startup
-libbsp_a_SOURCES += ../../shared/bspclean.c ../../shared/bsplibc.c \
- ../../shared/bsppredriverhook.c ../../shared/bsppretaskinghook.c \
- ../../shared/bspgetworkarea.c ../../shared/bsppost.c startup/bspstart.c \
- ../../shared/bootcard.c ../../shared/bspreset.c ../../shared/sbrk.c \
- ../../i386/shared/irq/idt.c \
- ../../i386/shared/irq/irq.c ../../i386/shared/irq/irq_init.c \
- ../../i386/shared/comm/i386-stub.c \
- ../../i386/shared/comm/i386-stub-glue.c ../../i386/shared/comm/uart.c \
- ../../shared/gnatinstallhandler.c ../../i386/shared/comm/gdb_glue.c \
- ../../i386/shared/comm/tty_drv.c ../../i386/shared/irq/irq_asm.S \
- ../../shared/src/irq-generic.c \
- ../../shared/src/irq-legacy.c \
- ../../shared/src/irq-info.c \
- ../../shared/src/irq-shell.c
-# clock
-libbsp_a_SOURCES += clock/ckinit.c
-# console
-libbsp_a_SOURCES += console/console.c
-include_HEADERS += ../../i386/shared/pci/pcibios.h
-# pci
-libbsp_a_SOURCES += ../../i386/shared/pci/pcibios.c \
- ../../i386/shared/pci/pcibios.h
-# timer
-libbsp_a_SOURCES += timer/timer.c timer/timerisr.S
-
-if HAS_NETWORKING
-network_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__ -D_KERNEL
-noinst_PROGRAMS += network.rel
-network_rel_SOURCES = network/netexterns.h network/network.c \
- network/uti596.h
-network_rel_CPPFLAGS = $(AM_CPPFLAGS) $(network_CPPFLAGS)
-network_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-endif
-
-libbsp_a_LIBADD = \
- ../../../libcpu/@RTEMS_CPU@/cache.rel \
- ../../../libcpu/@RTEMS_CPU@/score.rel
-if HAS_NETWORKING
-libbsp_a_LIBADD += network.rel
-endif
-
-include $(srcdir)/preinstall.am
-include $(top_srcdir)/../../../../automake/local.am
diff --git a/c/src/lib/libbsp/i386/i386ex/README b/c/src/lib/libbsp/i386/i386ex/README
deleted file mode 100644
index 240975c3b0..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/README
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# $Id$
-#
-
-This board support package works with the uti386ex, designed and built in
-house at the University of Toronto. It should also be compatible the an
-Intel Evaluation board.
-
-There are no decisions to be made at link time. The BSP reserves ALL
-available space between the end of the bss section and the start of the
-RTEMS Workspace for the heap. If you wish to add network support, then
-you will not need to modify the heap size.
-
-
-See startup/linkcmds and bsp_start.c for details.
-
-The clock is generated from an internal i386ex timer counter. The console
-uses COMM2 -- configured as 9600 n,8,1. COMM1 is available, also
-configured as 9600,n,8,1.
-
-In general, all modification needed to support another i386ex based
-platform should be restricted to start.s. Since there is no real-time
-clock on the Intel eval board, if RTclock support is required, then adding
-rtclock driver support is necessary.
-
-Hope this helps!
-
diff --git a/c/src/lib/libbsp/i386/i386ex/bsp_specs b/c/src/lib/libbsp/i386/i386ex/bsp_specs
deleted file mode 100644
index 1d57e6bf00..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/bsp_specs
+++ /dev/null
@@ -1,10 +0,0 @@
-%rename endfile old_endfile
-%rename startfile old_startfile
-%rename link old_link
-
-*startfile:
-%{!qrtems: %(old_startfile)} \
-%{!nostdlib: %{qrtems: start.o%s -e reset}}
-
-*link:
-%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N}
diff --git a/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c b/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c
deleted file mode 100644
index 7f3d92e6d9..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/* Clock_initialize
- *
- * This routine initializes the Timer/Counter on the Intel
- * 386ex evaluation board.
- *
- * The tick frequency is 1 millisecond.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-#define TMR0 0xF040
-#define TMR1 0xF041
-#define TMR2 0xF042
-#define TMRCON 0xF043
-#define TMRCFG 0xF834
-
-#include <bsp.h>
-#include <bsp/irq.h>
-
-#include <stdlib.h>
-
-uint32_t Clock_isrs; /* ISRs until next tick */
-static uint32_t Clock_initial_isr_value;
-
-volatile uint32_t Clock_driver_ticks;
-
-void Clock_exit( void );
-
-/*
- * These are set by clock driver during its init
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_major_number rtems_clock_minor = 0;
-
-/*
- * This is the ISR handler.
- */
-
-void Clock_isr(rtems_irq_hdl_param unused)
-{
- /* enable_tracing(); */
- Clock_driver_ticks += 1;
- if ( Clock_isrs == 1 ) {
- rtems_clock_tick();
- Clock_isrs = Clock_initial_isr_value; /* rtems_configuration_get_microseconds_per_tick() / 1000;*/
- }
- else
- Clock_isrs -= 1;
-}
-
-void ClockOff(const rtems_irq_connect_data* unused)
-{
- outport_byte ( TMRCFG , 0x80 ); /* disable the counter timer */
-}
-
-void ClockOn(const rtems_irq_connect_data* unused)
-{
- outport_byte ( TMRCFG , 0x00 ); /* enable the counter timer */
-}
-
-int ClockIsOn(const rtems_irq_connect_data* unused)
-{
- return ((i8259s_cache & 0x1) == 0);
-}
-
-static rtems_irq_connect_data clockIrqData = {BSP_PERIODIC_TIMER,
- Clock_isr,
- 0,
- ClockOn,
- ClockOff,
- ClockIsOn};
-
-rtems_device_driver Clock_initialize(
- rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *pargp
-)
-{
- unsigned timer_counter_init_value;
- unsigned char clock_lsb, clock_msb;
-
- Clock_driver_ticks = 0;
-
- Clock_isrs =
- Clock_initial_isr_value =
- rtems_configuration_get_microseconds_per_tick() / 1000; /* ticks per clock_isr */
-
- /*
- * configure the counter timer ( should be based on microsecs/tick )
- * NB. The divisor(Clock_isrs) resolves the is the same number that appears in confdefs.h
- * when setting the microseconds_per_tick value.
- */
- ClockOff ( &clockIrqData );
-
- timer_counter_init_value = rtems_configuration_get_microseconds_per_tick() / Clock_isrs;
- clock_lsb = (unsigned char)timer_counter_init_value;
- clock_msb = timer_counter_init_value >> 8;
-
- outport_byte ( TMRCON , 0x34 );
- outport_byte ( TMR0 , clock_lsb ); /* load LSB first */
- outport_byte ( TMR0 , clock_msb ); /* then MSB */
-
- if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
- printk("Unable to initialize system clock\n");
- rtems_fatal_error_occurred(1);
- }
-
- /*
- * make major/minor avail to others such as shared memory driver
- */
-
- rtems_clock_major = major;
- rtems_clock_minor = minor;
-
- return RTEMS_SUCCESSFUL;
-}
-
-void Clock_exit()
-{
- ClockOff(&clockIrqData);
- BSP_remove_rtems_irq_handler (&clockIrqData);
-}
diff --git a/c/src/lib/libbsp/i386/i386ex/configure.ac b/c/src/lib/libbsp/i386/i386ex/configure.ac
deleted file mode 100644
index 88a4118d03..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/configure.ac
+++ /dev/null
@@ -1,30 +0,0 @@
-## Process this file with autoconf to produce a configure script.
-##
-## $Id$
-
-AC_PREREQ([2.68])
-AC_INIT([rtems-c-src-lib-libbsp-i386-i386ex],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
-AC_CONFIG_SRCDIR([bsp_specs])
-RTEMS_TOP(../../../../../..)
-
-RTEMS_CANONICAL_TARGET_CPU
-AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.11.1])
-RTEMS_BSP_CONFIGURE
-
-RTEMS_PROG_CC_FOR_TARGET
-RTEMS_CANONICALIZE_TOOLS
-RTEMS_PROG_CCAS
-
-RTEMS_CHECK_NETWORKING
-
-## if this is an i386, does gas have good code16 support?
-RTEMS_I386_GAS_CODE16
-AM_CONDITIONAL(RTEMS_GAS_CODE16,test "$RTEMS_GAS_CODE16" = "yes")
-
-AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
-
-RTEMS_BSP_CLEANUP_OPTIONS(0, 0)
-
-# Explicitly list all Makefiles here
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
diff --git a/c/src/lib/libbsp/i386/i386ex/console/console.c b/c/src/lib/libbsp/i386/i386ex/console/console.c
deleted file mode 100644
index 9dcce7e86d..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/console/console.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*-------------------------------------------------------------------------+
-| console.c v1.1 - i386ex BSP - 1997/08/07
-+--------------------------------------------------------------------------+
-| This file contains the i386ex console I/O package. It is just a termios
-| wrapper.
-+--------------------------------------------------------------------------+
-| (C) Copyright 1997 -
-| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
-|
-| http://pandora.ist.utl.pt
-|
-| Instituto Superior Tecnico * Lisboa * PORTUGAL
-+--------------------------------------------------------------------------+
-| Disclaimer:
-|
-| This file is provided "AS IS" without warranty of any kind, either
-| expressed or implied.
-+--------------------------------------------------------------------------+
-| This code is based on:
-| console.c,v 1.4 1995/12/19 20:07:23 joel Exp - go32 BSP
-| console.c,v 1.15 pc386 BSP
-| With the following copyright notice:
-| **************************************************************************
-| * COPYRIGHT (c) 1989-1999.
-| * On-Line Applications Research Corporation (OAR).
-| *
-| * The license and distribution terms for this file may be
-| * found in the file LICENSE in this distribution or at
-| * http://www.rtems.com/license/LICENSE.
-| **************************************************************************
-|
-| $Id$
-+--------------------------------------------------------------------------*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#include <bsp.h>
-#include <bsp/irq.h>
-#include <rtems/libio.h>
-#include <rtems/error.h>
-#include <termios.h>
-#include <uart.h>
-#include <libcpu/cpuModel.h>
-#include <rtems/termiostypes.h>
-
-/*
- * Possible value for console input/output :
- * BSP_UART_COM1
- * BSP_UART_COM2
- * BSP_CONSOLE_PORT_CONSOLE is not valid in this BSP.
- * All references to either keyboard or video handling have been removed.
- */
-
-int BSPConsolePort = BSP_UART_COM2;
-int BSPBaseBaud = 781250;
-int BSP_poll_read(int);
-
-extern BSP_polling_getchar_function_type BSP_poll_char;
-
-static int conSetAttr(int minor, const struct termios *);
-static void isr_on(const rtems_irq_connect_data *);
-static void isr_off(const rtems_irq_connect_data *);
-static int isr_is_on(const rtems_irq_connect_data *);
-
-/*
- * Change references to com2 if required.
- */
-
-static rtems_irq_connect_data console_isr_data =
-{ BSP_UART_COM2_IRQ,
- BSP_uart_termios_isr_com2,
- 0,
- isr_on,
- isr_off,
- isr_is_on};
-
-static void
-isr_on(const rtems_irq_connect_data *unused)
-{
- return;
-}
-
-static void
-isr_off(const rtems_irq_connect_data *unused)
-{
- return;
-}
-
-static int
-isr_is_on(const rtems_irq_connect_data *irq)
-{
- return BSP_irq_enabled_at_i8259s(irq->name);
-}
-
-/*-------------------------------------------------------------------------+
-| Console device driver INITIALIZE entry point.
-+--------------------------------------------------------------------------+
-| Initilizes the I/O console (keyboard + VGA display) driver.
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_initialize(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_status_code status;
-
- /*
- * Set up TERMIOS
- */
- rtems_termios_initialize ();
-
- /*
- * Do device-specific initialization
- */
-
- /* 9600-8-N-1, no hardware flow control */
- BSP_uart_init(BSPConsolePort, 9600, CHR_8_BITS, 0, 0, 0);
-
- /* Set interrupt handler */
- if(BSPConsolePort == BSP_UART_COM1)
- {
- console_isr_data.name = BSP_UART_COM1_IRQ;
- console_isr_data.hdl = BSP_uart_termios_isr_com1;
-
- }
- else
- {
- assert(BSPConsolePort == BSP_UART_COM2);
- console_isr_data.name = BSP_UART_COM2_IRQ;
- console_isr_data.hdl = BSP_uart_termios_isr_com2;
- }
-
- status = BSP_install_rtems_irq_handler(&console_isr_data);
-
- if (!status){
- printk("Error installing serial console interrupt handler!\n");
- rtems_fatal_error_occurred(status);
- }
- /*
- * Register the device
- */
- status = rtems_io_register_name ("/dev/console", major, 0);
- if (status != RTEMS_SUCCESSFUL)
- {
- printk("Error registering console device!\n");
- rtems_fatal_error_occurred (status);
- }
-
- if(BSPConsolePort == BSP_UART_COM1)
- {
- printk("Initialized console on port COM1 9600-8-N-1\n\n");
- }
- else
- {
- printk("Initialized console on port COM2 9600-8-N-1\n\n");
- }
-
- return RTEMS_SUCCESSFUL;
-} /* console_initialize */
-
-static int console_last_close(int major, int minor, void *arg)
-{
- BSP_remove_rtems_irq_handler (&console_isr_data);
-
- return 0;
-}
-
-/*-------------------------------------------------------------------------+
-| Console device driver OPEN entry point
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_open(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_status_code status;
- static rtems_termios_callbacks cb =
- {
- NULL, /* firstOpen */
- console_last_close, /* lastClose */
- NULL, /* poll read */
- BSP_uart_termios_write_com2, /* write */
- conSetAttr, /* setAttributes */
- NULL, /* stopRemoteTx */
- NULL, /* startRemoteTx */
- 1 /* outputUsesInterrupts */
- };
-
- if(BSPConsolePort == BSP_UART_COM2)
- {
- cb.write = BSP_uart_termios_write_com2;
- }
-
- status = rtems_termios_open (major, minor, arg, &cb);
-
- if(status != RTEMS_SUCCESSFUL)
- {
- printk("Error openning console device\n");
- return status;
- }
-
- /*
- * Pass data area info down to driver
- */
- BSP_uart_termios_set(BSPConsolePort,
- ((rtems_libio_open_close_args_t *)arg)->iop->data1);
-
- /* Enable interrupts on channel */
- BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
-
- return RTEMS_SUCCESSFUL;
-}
-
-/*-------------------------------------------------------------------------+
-| Console device driver CLOSE entry point
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_close(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
-
- return (rtems_termios_close (arg));
-
-} /* console_close */
-
-/*-------------------------------------------------------------------------+
-| Console device driver READ entry point.
-+--------------------------------------------------------------------------+
-| Read characters from the I/O console. We only have stdin.
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_read(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void *arg)
-{
- rtems_status_code sc;
- printf("read the console\n");
-
- sc = rtems_termios_read (arg);
-
- if ( sc != RTEMS_SUCCESSFUL )
- printf("console_read: fails %s\n",rtems_status_text(sc));
-
- return sc;
-
-} /* console_read */
-
-/*-------------------------------------------------------------------------+
-| Console device driver WRITE entry point.
-+--------------------------------------------------------------------------+
-| Write characters to the I/O console. Stderr and stdout are the same.
-+--------------------------------------------------------------------------*/
-rtems_device_driver
-console_write(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg)
-{
- return rtems_termios_write (arg);
-
-} /* console_write */
-
-/*
- * Handle ioctl request.
- */
-rtems_device_driver
-console_control(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
-)
-{
- return rtems_termios_ioctl (arg);
-}
-
-static int
-conSetAttr(int minor, const struct termios *t)
-{
- int baud;
-
- baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
- if ( baud > 115200 )
- rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR);
-
- BSP_uart_set_baud(BSPConsolePort, baud);
-
- return 0;
-}
-
-/*
- * BSP initialization
- */
-
-BSP_output_char_function_type BSP_output_char = BSP_output_char_via_serial;
-
-BSP_polling_getchar_function_type BSP_poll_char = BSP_poll_char_via_serial;
-
-int BSP_poll_read(int ttyMinor){
-
- return BSP_poll_char_via_serial();
-}
diff --git a/c/src/lib/libbsp/i386/i386ex/include/.cvsignore b/c/src/lib/libbsp/i386/i386ex/include/.cvsignore
deleted file mode 100644
index 5f1077556d..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/include/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bspopts.h
-bspopts.h.in
-stamp-h
-stamp-h.in
diff --git a/c/src/lib/libbsp/i386/i386ex/include/bsp.h b/c/src/lib/libbsp/i386/i386ex/include/bsp.h
deleted file mode 100644
index 6ff3ffa773..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/include/bsp.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * This include file definitions related to an Intel i386ex board.
- *
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-#ifndef _BSP_H
-#define _BSP_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <bspopts.h>
-
-#include <rtems.h>
-#include <rtems/iosupp.h>
-#include <rtems/console.h>
-#include <rtems/clockdrv.h>
-#include <rtems/bspIo.h>
-#include <libcpu/cpu.h>
-#include <bsp/irq.h>
-
-/*
- * Simple spin delay in microsecond units for device drivers.
- * This is very dependent on the clock speed of the target.
- */
-
-#define rtems_bsp_delay( _microseconds ) \
- { \
- uint32_t _counter; \
- \
- _counter = (_microseconds); \
- \
- __asm__ volatile ( "0: nop;" \
- " mov %0,%0 ;" \
- " loop 0b" : "=c" (_counter) \
- : "0" (_counter) \
- ); \
- \
- }
-
-/* Constants */
-
-#define RAM_START 0
-
-/* replaced the earlier EI kludge of 0xfffff */
-
-#define RAM_END 0x100000
-
-#define IDT_SIZE 256
-#define GDT_SIZE 8192
-
-extern interrupt_gate_descriptor Interrupt_descriptor_table[IDT_SIZE];
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/libbsp/i386/i386ex/include/coverhd.h b/c/src/lib/libbsp/i386/i386ex/include/coverhd.h
deleted file mode 100644
index 077d731f0d..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/include/coverhd.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* coverhd.h
- *
- * This include file has defines to represent the overhead associated
- * with calling a particular directive from C on this target.
- *
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-#ifndef __COVERHD_h
-#define __COVERHD_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 3
-#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 3
-#define CALLING_OVERHEAD_TASK_CREATE 4
-#define CALLING_OVERHEAD_TASK_IDENT 4
-#define CALLING_OVERHEAD_TASK_START 4
-#define CALLING_OVERHEAD_TASK_RESTART 3
-#define CALLING_OVERHEAD_TASK_DELETE 3
-#define CALLING_OVERHEAD_TASK_SUSPEND 3
-#define CALLING_OVERHEAD_TASK_RESUME 3
-#define CALLING_OVERHEAD_TASK_SET_PRIORITY 4
-#define CALLING_OVERHEAD_TASK_MODE 4
-#define CALLING_OVERHEAD_TASK_GET_NOTE 4
-#define CALLING_OVERHEAD_TASK_SET_NOTE 4
-#define CALLING_OVERHEAD_TASK_WAKE_WHEN 7
-#define CALLING_OVERHEAD_TASK_WAKE_AFTER 3
-#define CALLING_OVERHEAD_INTERRUPT_CATCH 4
-#define CALLING_OVERHEAD_CLOCK_GET 7
-#define CALLING_OVERHEAD_CLOCK_SET 7
-#define CALLING_OVERHEAD_CLOCK_TICK 2
-
-#define CALLING_OVERHEAD_TIMER_CREATE 3
-#define CALLING_OVERHEAD_TIMER_IDENT 3
-#define CALLING_OVERHEAD_TIMER_DELETE 3
-#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 4
-#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 8
-#define CALLING_OVERHEAD_TIMER_RESET 3
-#define CALLING_OVERHEAD_TIMER_CANCEL 3
-#define CALLING_OVERHEAD_SEMAPHORE_CREATE 4
-#define CALLING_OVERHEAD_SEMAPHORE_DELETE 3
-#define CALLING_OVERHEAD_SEMAPHORE_IDENT 4
-#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 4
-#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 3
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 4
-#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 3
-
-#define CALLING_OVERHEAD_EVENT_SEND 4
-#define CALLING_OVERHEAD_EVENT_RECEIVE 4
-#define CALLING_OVERHEAD_SIGNAL_CATCH 3
-#define CALLING_OVERHEAD_SIGNAL_SEND 3
-#define CALLING_OVERHEAD_PARTITION_CREATE 4
-#define CALLING_OVERHEAD_PARTITION_IDENT 4
-#define CALLING_OVERHEAD_PARTITION_DELETE 3
-#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 4
-#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 4
-#define CALLING_OVERHEAD_REGION_CREATE 4
-#define CALLING_OVERHEAD_REGION_IDENT 3
-#define CALLING_OVERHEAD_REGION_DELETE 3
-#define CALLING_OVERHEAD_REGION_GET_SEGMENT 4
-#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 4
-#define CALLING_OVERHEAD_PORT_CREATE 4
-#define CALLING_OVERHEAD_PORT_IDENT 3
-#define CALLING_OVERHEAD_PORT_DELETE 3
-#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 4
-#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 4
-
-#define CALLING_OVERHEAD_IO_INITIALIZE 4
-#define CALLING_OVERHEAD_IO_OPEN 4
-#define CALLING_OVERHEAD_IO_CLOSE 4
-#define CALLING_OVERHEAD_IO_READ 4
-#define CALLING_OVERHEAD_IO_WRITE 4
-#define CALLING_OVERHEAD_IO_CONTROL 4
-#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 3
-#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 3
-#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 2
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/c/src/lib/libbsp/i386/i386ex/include/tm27.h b/c/src/lib/libbsp/i386/i386ex/include/tm27.h
deleted file mode 100644
index 623a045f16..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/include/tm27.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * tm27.h
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-#ifndef _RTEMS_TMTEST27
-#error "This is an RTEMS internal file you must not include directly."
-#endif
-
-#ifndef __tm27_h
-#define __tm27_h
-
-/*
- * Define the interrupt mechanism for Time Test 27
- *
- * NOTE: Use a software interrupt for the i386.
- */
-
-#define MUST_WAIT_FOR_INTERRUPT 0
-
-#define Install_tm27_vector(handler)
-
-#define Cause_tm27_intr() __asm__ volatile( "int $0x90" : : );
-
-#define Clear_tm27_intr() /* empty */
-
-#define Lower_tm27_intr() /* empty */
-
-#endif
diff --git a/c/src/lib/libbsp/i386/i386ex/make/custom/i386ex.cfg b/c/src/lib/libbsp/i386/i386ex/make/custom/i386ex.cfg
deleted file mode 100644
index 92f2dfb659..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/make/custom/i386ex.cfg
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Config file for the i386ex BSP
-#
-# $Id$
-#
-
-include $(RTEMS_ROOT)/make/custom/default.cfg
-
-RTEMS_CPU=i386
-RTEMS_CPU_MODEL=i386_nofp
-
-# This contains the compiler options necessary to select the CPU model
-# and (hopefully) optimize for it.
-#
-CPU_CFLAGS = -msoft-float
-
-# optimize flag: typically -O2
-CFLAGS_OPTIMIZE_V = -O2 -g
-
-define bsp-post-link
- $(OBJCOPY) -O srec $(basename $@).exe $(basename $@).srec
- sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \
- $(PACKHEX) > $(basename $@)$(DOWNEXT)
- $(default-bsp-post-link)
-endef
diff --git a/c/src/lib/libbsp/i386/i386ex/network/netexterns.h b/c/src/lib/libbsp/i386/i386ex/network/netexterns.h
deleted file mode 100644
index 4ad43f2231..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/network/netexterns.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef NET_EXTERNS_H
-#define NET_EXTERNS_H
-
-/*
- * External entry points
- */
-
-extern int uti596_attach(struct rtems_bsdnet_ifconfig *);
-extern int uti596dump(char * );
-extern void uti596reset(void);
-extern void uti596Diagnose(int);
-extern void uti596_request_reset(void);
-
-#endif
diff --git a/c/src/lib/libbsp/i386/i386ex/network/network.c b/c/src/lib/libbsp/i386/i386ex/network/network.c
deleted file mode 100644
index c12f619c45..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/network/network.c
+++ /dev/null
@@ -1,2724 +0,0 @@
-/* uti595.c: An 82596 ethernet driver for rtems-bsd.
- *
- * $Id$
- */
-
-void dump_scb(void);
-void printk_time(void);
-
-#ifdef DBG_VERSION
-#define BREAKPOINT() __asm__ (" int $3");
-#else
-#define BREAKPOINT()
-#endif
-
-/*
-
- EII: Oct 16 : Version 0.0
-
-*/
-
-#define DMA_MODE_CASCADE 0xC0 /* pass thru DREQ->HRQ, DACK<-HLDA only */
-#define DMA_MASK_REG 0x0A
-#define DMA_MODE_REG 0x0B
-#define DMA_ENABLE 0x0
-#define DMA_DISABLE 0x4
-
-struct i596_rfd *pISR_Rfd;
-
-void show_buffers (void);
-void show_queues(void);
-
-void outbyte(char);
-void dumpQ(void);
-
-#define UTI_596_ASSERT( condition, str ) { if (!( condition ) ) printk(str); }
-int count_rx = 0;
-
-/* static char *version = "uti596.c:v0.0 11/13/97\n"; */
-
-#include <bsp.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <rtems/error.h>
-#include <rtems/rtems_bsdnet.h>
-
-#include <sys/param.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/sockio.h>
-
-#include <net/if.h>
-
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
-
-#include "uti596.h"
-#include "netexterns.h"
-
-#include <rtems/asm.h>
-#include <string.h>
-
-/* #include "../misc/utils.h" */
-
-static struct uti596_softc uti596_softc;
-
-static int scbStatus;
-static struct i596_cmd *pIsrCmd;
-static struct i596_rfd *pIsrRfd;
-
-/*
- * Initial 596 configuration
- */
-char uti596initSetup[] = {
- 0x0E, /* length, prefetch off ( no RBD's ) */
- 0xC8, /* fifo to 8, monitor off */
- 0x40, /* don't save bad frames ( was save= 80, use intel's 40 )*/
- 0x2E, /* No source address insertion, 8 byte preamble */
- 0x00, /* priority and backoff defaults */
- 0x60, /* interframe spacing */
- 0x00, /* slot time LSB */
- 0xf2, /* slot time and retries */
- 0x0C, /* */
- 0x08, /* collision detect */
- 0x40, /* minimum frame length */
- 0xfb, /* tried C8 same as byte 1 in bits 6-7, else ignored*/
- 0x00,
- 0x3f /* no multi IA */ };
-/*
- * Externally defined symbols
- */
-#define RX_BUF_COUNT 15
-#define TX_BUF_COUNT 4
-#define TX_BD_PER_BUF 4
-
-#define INTERRUPT_EVENT RTEMS_EVENT_1
-#define START_TRANSMIT_EVENT RTEMS_EVENT_2
-#define NIC_RESET_EVENT RTEMS_EVENT_3
-
-#define RBUF_SIZE 1520
-
-/*
- * Local Routines
- */
-
-/* These are extern, and non-inline for testing purposes */
-
-void uti596addCmd (struct i596_cmd *pCmd);
-void uti596_initMem (struct uti596_softc *);
-void uti596_init (void * );
-int uti596initRxBufs (int num);
-int uti596_initRFA (int num);
-int uti596initRxBufs (int num);
-static int uti596_ioctl (struct ifnet *, ioctl_command_t, caddr_t);
-rtems_isr uti596DynamicInterruptHandler (rtems_vector_number);
-
-void uti596_txDaemon (void *);
-void uti596_rxDaemon (void *);
-void uti596_resetDaemon (void *);
-
-void uti596_stop (struct uti596_softc *);
-static void uti596_start (struct ifnet *);
-
-void uti596reset (void);
-
-void uti596_stats (struct uti596_softc *);
-
-void uti596_initialize_hardware(struct uti596_softc *);
-void uti596_reset_hardware(struct uti596_softc *);
-
-void uti596clearListStatus(struct i596_rfd *);
-void uti596addPolledCmd(struct i596_cmd *);
-
-void uti596supplyFD(struct i596_rfd *);
-
-struct i596_rfd * uti596dequeue( struct i596_rfd ** );
-void uti596append( struct i596_rfd ** , struct i596_rfd * );
-
-#ifdef DEBUG_INIT
-static void print_eth (unsigned char *);
-static void print_hdr (unsigned char *);
-static void print_pkt (unsigned char *);
-#endif
-
-void send_packet(struct ifnet *, struct mbuf *);
-
-#define UTI_596_IRQ 5
-#define UTI_596_ETH_MIN_SIZE 60
-
-/* Waits for the command word to clear. The command word is cleared AFTER the interrupt is
- * generated. This allows the CPU to issue the next command
- */
-#define UTI_WAIT_COMMAND_ACCEPTED(duration,function)\
-{ int waitcount = duration; \
- while ( uti596_softc.scb.command ) \
- if (--waitcount == 0) \
- { \
- printk("%s: i82596 timed out with status %x, cmd %x.\n", function, \
- uti596_softc.scb.status, uti596_softc.scb.command); \
- break; \
- } \
-}
-/*************************************************************************/
-
-void
-uti596_request_reset(void){
- rtems_status_code sc;
-
- uti596_softc.nic_reset = 0;
- sc = rtems_event_send(uti596_softc.resetDaemonTid, NIC_RESET_EVENT);
- if ( sc != RTEMS_SUCCESSFUL )
- rtems_panic ("Can't notify resetDaemon: %s\n", rtems_status_text (sc));
-}
-
-static void uti596_maskOn(const rtems_irq_connect_data* irq)
-{
- /*
- * code should be moved from initialize_hardware
- * to this location ?
- */
- (void) BSP_irq_enable_at_i8259s (irq->name);
-}
-
-static void uti596_maskOff(const rtems_irq_connect_data* irq)
-{
- /*
- * code should be moved from initialize_hardware
- * to this location ?
- */
- (void) BSP_irq_disable_at_i8259s (irq->name);
-}
-
-static int uti596_isOn(const rtems_irq_connect_data* irq)
-{
- return BSP_irq_enabled_at_i8259s (irq->name);
-}
-
-/***********************************************************************
- * Function: uti596initRFA(int num) ( New )
- *
- * Description:
- * attempts to allocate and initialize ( chain together )
- * the requested number of FD's
- *
- * Algorithm:
- *
- ***********************************************************************/
-
-int uti596_initRFA(int num)
-{
- struct i596_rfd *pRfd;
- int i = 0;
-
-#ifdef DBG_596
- printf ("%s: uti596_initRFA %d.\n", num);
-#endif
-
- /*
- * Initialize the first rfd in the rfa
- */
- pRfd = (struct i596_rfd *) calloc (1,sizeof (struct i596_rfd));
- if ( !pRfd ) {
- printf("Can't allocate all buffers: only %d allocated\n", i);
- return 0;
- }
- else {
- uti596_softc.countRFD = 1;
- uti596_softc.pBeginRFA = uti596_softc.pEndRFA = pRfd;
- printf ( "First Rfd allocated is: %p\n",
- uti596_softc.pBeginRFA);
- }
-
- for (i = 1; i < num; i++) {
- pRfd = (struct i596_rfd *) calloc (1,sizeof (struct i596_rfd) );
- if ( pRfd != NULL ) {
- uti596_softc.countRFD++;
- uti596_softc.pEndRFA -> next = pRfd; /* link it in */
- uti596_softc.pEndRFA = pRfd; /* move the end */
-#ifdef DBG_596_RFA
- printf("Allocated RFD @ %p\n", pRfd);
-#endif
- }
- else {
- printf("Can't allocate all buffers: only %d allocated\n", i);
- break;
- }
- } /* end for */
-
- uti596_softc.pEndRFA -> next = I596_NULL;
- UTI_596_ASSERT(uti596_softc.countRFD == RX_BUF_COUNT,"INIT:WRONG RFD COUNT\n" );
-
-#ifdef DBG_596_RFA
- printf ( "Head of RFA is buffer %p\nEnd of RFA is buffer %p \n",
- uti596_softc.pBeginRFA,
- uti596_softc.pEndRFA );
-#endif
- /* initialize the Rfd's */
- for ( pRfd = uti596_softc.pBeginRFA;
- pRfd != I596_NULL;
- pRfd = pRfd -> next ) {
-
- pRfd->cmd = 0x0000;
- pRfd->stat = 0x0000;
- pRfd->pRbd = I596_NULL;
- pRfd->count = 0; /* number of bytes in buffer: usually less than size */
- pRfd->size = 1532; /* was 1532; buffer size ( All RBD ) */
- if ( pRfd -> data == NULL )
- printf("Can't allocate the RFD data buffer\n");
- }
-
- /* mark the last FD */
- uti596_softc.pEndRFA -> cmd = CMD_EOL; /* moved jan 13 from before the init stuff */
-
-#ifdef DBG_596_RFA
- printf ( "Head of RFA is buffer @ %p \n", uti596_softc.pBeginRFA );
-#endif
-
- uti596_softc.pSavedRfdQueue =
- uti596_softc.pEndSavedQueue = I596_NULL; /* initially empty */
-
- uti596_softc.savedCount = 0;
-
- uti596_softc.nop.cmd.command = CmdNOp; /* initialize the nop command */
-
- return (i); /* the number of allocated buffers */
-
-}
-/***********************************************************************
- * Function: uti596supplyFD
- *
- * Description: returns a buffer to the receive frame pool.
- * call this with Inetrrupts disabled!
- *
- * Algorithm:
- *
- ***********************************************************************/
-void uti596supplyFD(struct i596_rfd * pRfd )
-{
- struct i596_rfd *pLastRfd;
-
- UTI_596_ASSERT(pRfd != I596_NULL, "Supplying NULL RFD!\n");
- pRfd -> cmd = CMD_EOL;
- pRfd -> pRbd = I596_NULL;
- pRfd -> next = I596_NULL;
- pRfd -> stat = 0x0000; /* clear STAT_C and STAT_B bits */
-
- /*
- * Check if the list is empty:
- */
- if ( uti596_softc.pBeginRFA == I596_NULL ) {
- /* Init a list w/ one entry */
- uti596_softc.pBeginRFA = uti596_softc.pEndRFA = pRfd;
- UTI_596_ASSERT(uti596_softc.countRFD == 0, "Null begin, but non-zero count\n");
- if ( uti596_softc.pLastUnkRFD != I596_NULL )
- printf("LastUnkRFD is NOT NULL!!\n");
- uti596_softc.countRFD = 1;
- return;
- }
- /*
- * Check if the last RFD is used/read by the 596.
- */
- pLastRfd = uti596_softc.pEndRFA;
-
- if ( pLastRfd != I596_NULL &&
- ! (pLastRfd -> stat & ( STAT_C | STAT_B ) )) { /* C = complete, B = busy (prefetched) */
-
- /*
- * Not yet too late to add it
- */
- pLastRfd -> next = pRfd;
- pLastRfd -> cmd &= ~CMD_EOL; /* RESET_EL : reset EL bit to 0 */
- uti596_softc.countRFD++; /* Lets assume we add it successfully
- If not, the RFD may be used, and may decrement countRFD < 0 !!*/
- /*
- * Check if the last RFD was used while appending.
- */
- if ( pLastRfd -> stat & ( STAT_C | STAT_B ) ) { /* completed or was prefetched */
- /*
- * Either the EL bit of the last rfd has been read by the 82596,
- * and it will stop after reception,( true when RESET_EL not reached ) or
- * the EL bit was NOT read by the 82596 and it will use the linked
- * RFD for the next reception. ( true is RESET_EL was reached )
- * So, it is unknown whether or not the linked rfd will be used.
- * Therefore, the end of list CANNOT be updated.
- */
- UTI_596_ASSERT ( uti596_softc.pLastUnkRFD == I596_NULL, "Too many Unk RFD's\n" );
- uti596_softc.pLastUnkRFD = pRfd;
- return;
- }
- else {
- /*
- * The RFD being added was not touched by the 82596
- */
- if (uti596_softc.pLastUnkRFD != I596_NULL ) {
-
- uti596append(&uti596_softc.pSavedRfdQueue, pRfd); /* Only here! saved Q */
- uti596_softc.pEndSavedQueue = pRfd;
- uti596_softc.savedCount++;
- uti596_softc.countRFD--;
-
- }
- else {
- uti596_softc.pEndRFA = pRfd; /* the RFA has been extended */
- if ( ( uti596_softc.scb.status & SCB_STAT_RNR ||
- uti596_softc.scb.status & RU_NO_RESOURCES ) &&
- uti596_softc.countRFD > 1 ) { /* was == 2 */
- uti596_softc.pBeginRFA -> cmd &= ~CMD_EOL; /* Ensure that beginRFA is not EOL */
-
- UTI_596_ASSERT(uti596_softc.pEndRFA -> next == I596_NULL, "supply: List buggered\n");
- UTI_596_ASSERT(uti596_softc.pEndRFA -> cmd & CMD_EOL, "supply: No EOL at end.\n");
- UTI_596_ASSERT(uti596_softc.scb.command == 0, "Supply: scb command must be zero\n");
-#ifdef DBG_START
- printf("Supply FD: starting receiver");
-#endif
- /* start the receiver */
- UTI_596_ASSERT(uti596_softc.pBeginRFA != I596_NULL, "rx start w/ NULL begin! \n");
- uti596_softc.scb.pRfd = uti596_softc.pBeginRFA;
- uti596_softc.scb.command = RX_START | SCB_STAT_RNR; /* Don't ack RNR! The receiver should be stopped in this case */
- UTI_596_ASSERT( !(uti596_softc.scb.status & SCB_STAT_FR),"FRAME RECEIVED INT COMING!\n");
- outport_byte(CHAN_ATTN, 0);
- }
- }
- return;
-
- }
- }
- else {
- /*
- * too late , pLastRfd in use ( or NULL ),
- * in either case, EL bit has been read, and RNR condition will occur
- */
- uti596append( &uti596_softc.pSavedRfdQueue, pRfd); /* save it for RNR */
-
- uti596_softc.pEndSavedQueue = pRfd; /* reset end of saved queue */
- uti596_softc.savedCount++;
-
- return;
- }
-}
-
-static void
-uti596_start (struct ifnet *ifp)
-{
- struct uti596_softc *sc = ifp->if_softc;
-
- rtems_event_send (sc->txDaemonTid, START_TRANSMIT_EVENT);
- ifp->if_flags |= IFF_OACTIVE;
-}
-
-void
-uti596_initialize_hardware(struct uti596_softc *sc)
-{
- int boguscnt = 1000;
- rtems_status_code status_code;
-
- printf("uti596_initialize_hardware\n");
-
- /* reset the board */
- outport_word( PORT_ADDR, 0 );
- outport_word( PORT_ADDR, 0 );
-
- uti596_softc.pScp = (struct i596_scp *) calloc(1,sizeof(struct i596_scp) + 0xf);
-#ifdef DBG_INIT
- printf("initialize_hardware:Scp address initially %p\n", sc->pScp);
-#endif
- sc->pScp = (struct i596_scp *)
- ((((int)uti596_softc.pScp) + 0xf) & 0xfffffff0);
-
-#ifdef DBG_INIT
- printf("initialize_hardware:change scp address to : %p\n",sc->pScp);
-#endif
-
- /* change the scp address */
-#ifdef DBG_INIT
- printf("Change the SCP address\n");
-#endif
-
- /*
- * Set the DMA mode to enable the 82596 to become a bus-master
- */
- outport_byte(DMA_MASK_REG,DMA_DISABLE); /* disable_dma */
- outport_byte(DMA_MODE_REG,DMA_MODE_CASCADE); /* set dma mode */
- outport_byte(DMA_MASK_REG,DMA_ENABLE); /* enable dma */
-
- /* reset the board */
- outport_word( PORT_ADDR, 0 );
- outport_word( PORT_ADDR, 0 );
-
- outport_word(PORT_ADDR, ((((int)sc->pScp) & 0xffff) | 2 ));
- outport_word(PORT_ADDR, (( (int)sc->pScp) >> 16 ) & 0xffff );
-
- /* This is linear mode, LOCK function is disabled */
-
- sc->pScp->sysbus = 0x00540000;
- sc->pScp->iscp = &sc->iscp;
- sc->iscp.scb = &sc->scb;
- sc->iscp.stat = 0x0001;
-
- sc->pCmdHead = sc->scb.pCmd = I596_NULL;
-
-#ifdef DBG_596
- printf("Starting i82596.\n");
-#endif
-
- /* Pass the scb address to the 596 */
- outport_word(CHAN_ATTN,0);
-
- while (sc->iscp.stat)
- if (--boguscnt == 0)
- {
- printf("initialize_hardware: timed out with status %4.4lx\n",
- sc->iscp.stat );
- break;
- }
-
- /* clear the command word */
- sc->scb.command = 0;
-
- /*
- * Set up interrupts ( NEW irq style )
- */
- sc->irqInfo.name = UTI_596_IRQ;
- sc->irqInfo.hdl = ( void * ) uti596DynamicInterruptHandler;
- sc->irqInfo.on = uti596_maskOn;
- sc->irqInfo.off = uti596_maskOff;
- sc->irqInfo.isOn = uti596_isOn;
-
- status_code = BSP_install_rtems_irq_handler (&sc->irqInfo);
- if (!status_code)
- rtems_panic ("Can't attach uti596 interrupt handler for irq %d\n",
- sc->irqInfo.name);
-
- /* Initialize the 82596 memory ( Transmit buffers ) */
- uti596_initMem(sc);
-
-#ifdef DBG_INIT
- printf("After attach, status of board = 0x%x\n", sc->scb.status );
-#endif
- outport_word(0x380, 0xf); /* reset the LED's */
-}
-
-
-void
-uti596_reset_hardware(struct uti596_softc *sc)
-{
- int boguscnt = 1000;
- rtems_status_code status_code;
- struct i596_cmd *pCmd;
-
- printf("uti596_reset_hardware\n");
- pCmd = sc->pCmdHead; /* This is a tx command for sure (99.99999%) */
-
- /* reset the board */
- outport_word( PORT_ADDR, 0 );
- outport_word( PORT_ADDR, 0 );
-
- if ( sc->pScp == NULL ) {
- printf("Calloc scp\n");
- uti596_softc.pScp = (struct i596_scp *) calloc(1,sizeof(struct i596_scp) + 0xf);
- }
-
-#ifdef DBG_RESET
- printf("reset_hardware:Scp address %p\n", sc->pScp);
-#endif
- sc->pScp = (struct i596_scp *)
- ((((int)uti596_softc.pScp) + 0xf) & 0xfffffff0);
-
-#ifdef DBG_RESET
- printf("reset_hardware:change scp address to : %p\n",sc->pScp);
-#endif
-
- /* change the scp address */
-#ifdef DBG_RESET
- printf("Change the SCP address\n");
-#endif
-
- /*
- * Set the DMA mode to enable the 82596 to become a bus-master
- */
- outport_byte(DMA_MASK_REG,DMA_DISABLE); /* disable_dma */
- outport_byte(DMA_MODE_REG,DMA_MODE_CASCADE); /* set dma mode */
- outport_byte(DMA_MASK_REG,DMA_ENABLE); /* enable dma */
-
- /* reset the board */
- outport_word( PORT_ADDR, 0 );
- outport_word( PORT_ADDR, 0 );
-
- /* outport_word(PORT_ADDR, ((((int)uti596_softc.pScp) & 0xffff) | 2 ));
- outport_word(PORT_ADDR, (( (int)uti596_softc.pScp) >> 16 ) & 0xffff ); */
-
- outport_word(PORT_ADDR, ((((int)sc->pScp) & 0xffff) | 2 ));
- outport_word(PORT_ADDR, (( (int)sc->pScp) >> 16 ) & 0xffff );
-
- /* This is linear mode, LOCK function is disabled */
-
- sc->pScp->sysbus = 0x00540000;
- sc->pScp->iscp = &sc->iscp;
- sc->iscp.scb = &sc->scb;
- sc->iscp.stat = 0x0001;
-
- sc->pCmdHead = sc->scb.pCmd = I596_NULL;
- /*
- * Wake the transmitter if needed.
- */
- if ( uti596_softc.txDaemonTid && pCmd != I596_NULL ){
- printf("****RESET: wakes transmitter!\n");
- status_code = rtems_event_send (uti596_softc.txDaemonTid,
- INTERRUPT_EVENT);
-
- if ( status_code != RTEMS_SUCCESSFUL )
- printk("****ERROR:Could NOT send event to tid 0x%x : %s\n",
- uti596_softc.txDaemonTid, rtems_status_text (status_code) );
- }
-
-#ifdef DBG_596
- printf("reset_hardware: starting i82596.\n");
-#endif
-
- /* Pass the scb address to the 596 */
- outport_word(CHAN_ATTN,0);
-
- while (sc->iscp.stat)
- if (--boguscnt == 0)
- {
- printf("reset_hardware: timed out with status %4.4lx\n",
- sc->iscp.stat );
- break;
- }
-
- /* clear the command word */
- sc->scb.command = 0;
-
-#ifdef DBG_RESET
- printf("After reset_hardware, status of board = 0x%x\n", sc->scb.status );
-#endif
-
- outport_word(0x380, 0xf); /* reset the LED's */
-}
-
-
-/***********************************************************************
- * Function: uti596_initMem
- *
- * Description:
- * creates the necessary descriptors for the
- * uti596 board, hooks the interrupt, and starts the board.
- * Assumes that interrupts are hooked.
- *
- * Algorithm:
- *
- ***********************************************************************/
-
- void
-uti596_initMem(struct uti596_softc * sc)
-{
- int i,count;
- struct i596_tbd *pTbd;
-
- sc->resetDone = 0; /* ??? */
-
- /*
- * Set up receive frame area (RFA)
- */
- i = uti596_initRFA( sc->rxBdCount );
- if ( i < sc->rxBdCount )
- printf("init_rfd: only able to allocate %d receive frame descriptors\n", i);
-
- sc->scb.pRfd = sc->pBeginRFA;
-
-#ifdef DBG_INIT
- printf(" IRQ %d.\n", sc->irqInfo.name);
-#endif
-
- /*
- * Diagnose the health of the board
- */
- uti596Diagnose(1);
-
- /*
- * set up the i596 config command
- */
-#ifdef DBG_INIT
- printf("Configuring\n");
-#endif
-
- sc->set_conf.cmd.command = CmdConfigure;
- memcpy (sc->set_conf.data, uti596initSetup, 14);
- uti596addPolledCmd( (struct i596_cmd *) &sc->set_conf);
-
- /****
- * POLL
- ****/
-
- count = 2000;
- while( !( sc->set_conf.cmd.status & STAT_C ) && --count )
- printf(".");
-
- if ( count )
- printf("Configure OK, count = %d\n",count);
- else
- printf("***Configure failed\n");
-
- /*******/
-
- /*
- * Create the IA setup command
- */
-
-#ifdef DBG_INIT
- printf("Setting Address\n");
-#endif
- sc->set_add.cmd.command = CmdSASetup;
- for ( i=0; i<6; i++)
- sc->set_add.data[i]=sc->arpcom.ac_enaddr[i];
-
- sc->cmdOk = 0;
- uti596addPolledCmd((struct i596_cmd *)&sc->set_add);
- /*******/
-
- count = 2000;
- while( !(sc->set_add.cmd.status & STAT_C ) && --count)
- printf(".");
-
- if ( count )
- printf ("Set Address OK, count= %d\n",count);
- else
- printf("Set Address Failed\n");
- /*******/
-
-#ifdef DBG_INIT
- printf( "After initialization, status and command: 0x%x, 0x%x\n",
- sc->scb.status, sc->scb.status);
-
-#endif
-
- /* initialize transmit buffer descriptors*/
- sc->pLastUnkRFD = I596_NULL;
- sc->pTxCmd = (struct tx_cmd *) calloc (1,sizeof (struct tx_cmd) );
- sc->pTbd = (struct i596_tbd *) calloc (1,sizeof (struct i596_tbd) );
- sc->pTxCmd -> pTbd = sc->pTbd;
- sc->pTxCmd->cmd.command = CMD_FLEX|CmdTx;
- sc->pTxCmd->pad = 0;
- sc->pTxCmd->size = 0; /* all bytes are in list of TBD's */
-
- pTbd = sc->pTbd;
-
- for ( i=0; i<sc->txBdCount; i++)
- pTbd = pTbd -> next = (struct i596_tbd *) calloc (1,sizeof (struct i596_tbd) );
-
- pTbd -> next = I596_NULL;
-
- memset ( &sc->zeroes, 0, 64);
-
-#ifdef DBG_596
- printf( "After receiver start, status and command: 0x%x, 0x%x\n",
- sc->scb.status, sc->scb.status);
-#endif
- printf("uti596_initMem allows ISR's\n");
- sc->resetDone = 1; /* now need ISR */
-
-}
-
-
-/***********************************************************************
- * Function: uti596dump
- *
- * Description: Dump 596 registers
- *
- * Algorithm:
- ***********************************************************************/
-/* static */ int
-uti596dump(char * pDumpArea)
-{
- struct i596_dump dumpCmd;
- int boguscnt = 25000000; /* over a second! */
-
-#ifdef DBG_596
-printf("uti596dump:\n");
-#endif
-
- dumpCmd.cmd.command = CmdDump;
- dumpCmd.cmd.next = I596_NULL;
- dumpCmd.pData = pDumpArea;
- uti596_softc.cmdOk = 0;
- uti596addCmd ( (struct i596_cmd *)&dumpCmd);
- while (1)
- if ( --boguscnt == 0){
- printf("Dump command was not processed within spin loop delay\n");
- return 0;
- }
- else {
- if ( uti596_softc.cmdOk )
- return 1; /* successful completion */
- }
-
-}
-
-/***********************************************************************
- * Function: uti596_rxDaemon
- *
- * Description: Receiver task
- *
- * Algorithm: Extract the packet from an RFD, and place into an
- * mbuf chain. Place the mbuf chain in the network task
- * queue. Assumes that the frame check sequence is removed
- * by the 82596.
- *
- ***********************************************************************/
-
-/* static */ void
-uti596_rxDaemon(void *arg)
-{
- struct uti596_softc *sc = (struct uti596_softc *)arg;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- struct mbuf *m;
-
- struct i596_rfd *pRfd;
- ISR_Level level;
- rtems_id tid;
- rtems_event_set events;
- struct ether_header *eh;
-
- int frames = 0;
-
-#ifdef DBG_596
- printf ("uti596_rxDaemon\n");
- printf("&scb = %p, pRfd = %p\n", &sc->scb,sc->scb.pRfd);
-#endif
-
- rtems_task_ident (0, 0, &tid);
-
-#ifdef DBG_596
- printf("RX tid = 0x%x\n", tid);
-#endif
-
- for(;;) {
- /*
- * Wait for packet.
- */
-#ifdef DBG_596
- printf("Receiver sleeps\n");
-#endif
-
- rtems_bsdnet_event_receive (INTERRUPT_EVENT,
- RTEMS_WAIT|RTEMS_EVENT_ANY,
- RTEMS_NO_TIMEOUT,
- &events);
-
-#ifdef DBG_596
- printf("Receiver wakes\n");
-#endif
- /*
- * While received frames are available. Note that the frame may be
- * a fragment, so it is NOT a complete packet.
- */
- pRfd = uti596dequeue( &sc->pInboundFrameQueue);
- while ( pRfd &&
- pRfd != I596_NULL &&
- pRfd -> stat & STAT_C )
- {
-
-#ifdef DEBUG_INIT
- printf("\nReceived packet:\n");
- print_eth( pRfd->data);
-#endif
- if ( pRfd->stat & STAT_OK){
- /* a good frame. Allocate an mbuf to take it from the queue */
-
- int pkt_len = pRfd->count & 0x3fff; /* the actual # of bytes received */
-
-#ifdef DBG_596
- printf("Good frame, @%p, data @%p length %d\n", pRfd, pRfd -> data , pkt_len);
-#endif
- frames++;
-
- /*
- * Allocate an mbuf to give to the stack
- * The format of the data portion of the RFD is:
- * <ethernet header, payload>.
- * The FRAME CHECK SEQUENCE / CRC is stripped by the uti596.
- * This is to be optimized later.... should not have to memcopy!
- */
- MGETHDR(m, M_WAIT, MT_DATA);
- MCLGET(m, M_WAIT);
-
- m->m_pkthdr.rcvif = ifp;
- /* move everything into an mbuf */
- memcpy(m->m_data,
- pRfd->data,
- pkt_len);
-
- m->m_len = m->m_pkthdr.len = pkt_len - sizeof(struct ether_header) - 4;
-
- /* move the header to an mbuf */
- eh = mtod (m, struct ether_header *);
- m->m_data += sizeof(struct ether_header);
-
-#ifdef DBG_596
- printf("m->m_ext: %p pRfd -> data: %p\n",
- m->m_ext, pRfd -> data);
-#endif
-#ifdef DEBUG_INIT_2
- printf("mbuf contains:\n");
- print_eth( (char *) (((int)m->m_data)-sizeof(struct ether_header)));
- for ( i = 0; i<20; i++)
- printf(".");
-
-#endif
-#ifdef DBG_VERSION
- BREAKPOINT();
-#endif
- ether_input (ifp, eh, m);
-
- } /* end if STAT_OK */
-
- else {
- /*
- * A bad frame is present: Note that this could be the last RFD!
- */
-#ifdef DBG_596
- printf("Bad frame\n");
-#endif
- /*
- * FIX ME: use the statistics from the SCB
- */
- sc->stats.rx_errors++;
- if ((sc->scb.pRfd->stat) & 0x0001)
- sc->stats.collisions++;
- if ((sc->scb.pRfd->stat) & 0x0080)
- sc->stats.rx_length_errors++;
- if ((sc->scb.pRfd->stat) & 0x0100)
- sc->stats.rx_over_errors++;
- if ((sc->scb.pRfd->stat) & 0x0200)
- sc->stats.rx_fifo_errors++;
- if ((sc->scb.pRfd->stat) & 0x0400)
- sc->stats.rx_frame_errors++;
- if ((sc->scb.pRfd->stat) & 0x0800)
- sc->stats.rx_crc_errors++;
- if ((sc->scb.pRfd->stat) & 0x1000)
- sc->stats.rx_length_errors++;
- }
-
- UTI_596_ASSERT(pRfd != I596_NULL, "Supplying NULL RFD\n");
-
-#ifdef DBG_SUPPLY_FD
- printf("Supply FD Starting\n");
-#endif
- _ISR_Disable(level);
- uti596supplyFD ( pRfd ); /* Return RFD to RFA. CAN WE REALLY?*/
- _ISR_Enable(level);
-#ifdef DBG_SUPPLY_FD
- printf("Supply FD Complete\n");
-#endif
-#ifdef DBG_VERSION
- BREAKPOINT();
-#endif
-
- pRfd = uti596dequeue( &sc->pInboundFrameQueue); /* grab next frame */
-
- } /* end while */
- } /* end for(;;)*/
-
-#ifdef DBG_596
- printf ("frames %d\n", frames);
-#endif
-
-}
-
- /***********************************************************************
- * Function: uti596clearListStatus
- *
- * Description:
- * Clear the stat fields for all rfd's
- * Algorithm:
- *
- ***********************************************************************/
-
-void
-uti596clearListStatus(struct i596_rfd *pRfd)
-{
-
- while ( pRfd != I596_NULL ) {
- pRfd -> stat = 0; /* clear the status field */
- pRfd = pRfd-> next;
- }
-}
-
-void uti596reset(void)
- {
- int i,count;
- struct uti596_softc *sc = &uti596_softc;
- /* struct i596_rfd * pRfd; */
-
-#ifdef DBG_RESET
- printf ("reset: begins\n");
-#endif
-
- sc->resetDone = 0;
- sc->irqInfo.off(&sc->irqInfo);
-
- UTI_WAIT_COMMAND_ACCEPTED(10000, "reset: wait for previous command complete");
-
- /* abort ALL of the current work */
- /* FEB 17 REMOVED
- ====>
- sc->scb.command = CUC_ABORT | RX_ABORT;
- outport_word(CHAN_ATTN,0);
- UTI_WAIT_COMMAND_ACCEPTED(4000, "reset: abort requested");
- <====
- */
-
- uti596_reset_hardware(&uti596_softc); /* reset the ethernet hardware. must re-config */
-
-#ifdef DBG_RESET
- uti596Diagnose(1);
-#endif
-
- sc->set_conf.cmd.command = CmdConfigure;
- memcpy (sc->set_conf.data, uti596initSetup, 14);
- uti596addPolledCmd( (struct i596_cmd *) &sc->set_conf);
-
- /****
- * POLL
- ****/
-
- count = 2000;
- while( !( sc->set_conf.cmd.status & STAT_C ) && --count )
- printf(".");
-
- if ( count )
- printf("Configure OK, count = %d\n",count);
- else
- printf("***reset: Configure failed\n");
-
- /*
- * Create the IA setup command
- */
-
-#ifdef DBG_RESET
- printf("reset: Setting Address\n");
-#endif
- sc->set_add.cmd.command = CmdSASetup;
- for ( i=0; i<6; i++)
- sc->set_add.data[i]=sc->arpcom.ac_enaddr[i];
-
- sc->cmdOk = 0;
- uti596addPolledCmd((struct i596_cmd *)&sc->set_add);
-
- count = 2000;
- while( !(sc->set_add.cmd.status & STAT_C ) && --count)
- printf(".");
-
- if ( count )
- printf ("Reset Set Address OK, count= %d\n",count);
- else
- printf("Reset Set Address Failed\n");
- /*******/
-
- sc->pCmdHead = sc->pCmdTail = sc->scb.pCmd = I596_NULL; /* Feb 17. clear these out */
-
-#ifdef DBG_RESET
- printf( "After reset, status and command: 0x%x, 0x%x\n",
- sc->scb.status, sc->scb.status);
-
-#endif
-
- /* restore the RFA */
-
- /*dumpQ();*/
-
- if ( sc->pLastUnkRFD != I596_NULL ) {
- sc-> pEndRFA = sc->pLastUnkRFD; /* The end position can be updated */
- sc-> pLastUnkRFD = I596_NULL;
- }
-
- sc->pEndRFA->next = sc->pSavedRfdQueue;
- if ( sc->pSavedRfdQueue != I596_NULL ) {
- sc->pEndRFA = sc->pEndSavedQueue;
- sc->pSavedRfdQueue = sc->pEndSavedQueue = I596_NULL;
- sc -> countRFD = sc->rxBdCount ;
- }
-
- /* if ( sc->pInboundFrameQueue != I596_NULL ){
- do {
- pRfd = sc->pInboundFrameQueue->next;
- sc->pEndRFA -> next = sc->pInboundFrameQueue;
- sc->pInboundFrameQueue = pRfd;
- } while( pRfd != I596_NULL ) ;
-
- }
- */
-
- sc->scb.pRfd = sc->pBeginRFA; /* readdress the head of the RFA in the SCB */
-
- uti596clearListStatus(sc->pBeginRFA );
-
- /* dumpQ();*/
-
- printf("Reset:Starting NIC\n");
- sc->scb.command = RX_START;
- sc->started = 1; /* we assume that the start works */
- sc->resetDone = 1; /* moved here from after channel attn. */
- outport_word(CHAN_ATTN,0 );
- UTI_WAIT_COMMAND_ACCEPTED(4000, "reset");
- printf("Reset:Start complete \n");
- UTI_596_ASSERT(sc->pCmdHead == I596_NULL, "Reset: CMD not cleared\n");
- sc->irqInfo.on(&sc->irqInfo); /* moved back here. Tried it before RX command issued. */
-
- /* uti596addCmd(&uti506_softc.nop); */ /* just for fun */
-
-#ifdef DBG_RESET
- printf("reset: complete\n");
-#endif
- }
-
- /***********************************************************************
- * Function: uti596addCmd
- *
- * Description:
- * This routine adds a command onto the end of the
- * command chain
- *
- * Algorithm:
- * Add the command to the end of and existing chain,
- * or start the chain and issue a CUC_START
- *
- *
- ***********************************************************************/
-
- /* static */ void uti596addCmd(struct i596_cmd *pCmd)
- {
- ISR_Level level;
-
- #ifdef DBG_596
- printf("Adding command 0x%x\n", pCmd -> command );
- #endif
-
-#ifdef DEBUG_ADD
-
- switch ( pCmd -> command & 0x7 ){ /* check bottom 7 bits */
- case CmdConfigure:
- printf("ADD: Configure Command 0x%x\n", pCmd->command);
- break;
- case CmdSASetup:
- printf("ADD: Set Address Command 0x%x\n", pCmd->command);
- break;
- case CmdMulticastList:
- printf("ADD: Multi-cast list 0x%x\n", pCmd->command);
- break;
- case CmdNOp:
- printf("ADD: NO op 0x%x\n", pCmd->command);
- break;
- case CmdTDR:
- printf("ADD: TDR 0x%x\n", pCmd->command);
- break;
- case CmdDump:
- printf("ADD: Dump 0x%x\n", pCmd->command);
- break;
- case CmdDiagnose:
- printf("ADD: Diagnose 0x%x\n", pCmd->command);
- break;
- case CmdTx:
- break;
- default:
- printf("****Unknown Command encountered 0x%x\n", pCmd->command);
- break;
- } /* end switch */
-
-#endif
-
- pCmd->status = 0;
- pCmd->command |= (CMD_EOL | CMD_INTR ); /* all commands last in list & return an interrupt */
-
- pCmd->next = I596_NULL;
-
- _ISR_Disable(level);
- if (uti596_softc.pCmdHead == I596_NULL)
- {
- uti596_softc.pCmdHead =
- uti596_softc.pCmdTail =
- uti596_softc.scb.pCmd = pCmd;
-#ifdef DBG_596
- printf("First Cmd\n");
-#endif
- UTI_WAIT_COMMAND_ACCEPTED(10000,"add command"); /* wait for acceptance of previous command */
- /* CHANGED TO |= Mar. 27 4:20 pm, was just =. changed back jun 18 1998. The wait assures command = 0 */
- uti596_softc.scb.command = CUC_START;
- outport_word (CHAN_ATTN,0);
- _ISR_Enable(level);
- }
- else
- {
-#ifdef DBG_596
- printf("Chained Cmd\n");
-#endif
- uti596_softc.pCmdTail->next = pCmd;
- uti596_softc.pCmdTail = pCmd; /* added Jan 30 */
- _ISR_Enable(level);
- }
-
-#ifdef DBG_596
- printf("Scb status & command 0x%x 0x%x\n",
- uti596_softc.scb.status,
- uti596_softc.scb.command );
-#endif
-
- }
-
- /***********************************************************************
- * Function: uti596addPolledCmd
- *
- * Description:
- * This routine issues a single command then polls for it's
- * completion. TO BE CALLED FROM ISR ONLY
- *
- * Algorithm:
- * Give the command to the driver. ( CUC_START is ALWAYS required )
- * Poll for completion.
- *
- ***********************************************************************/
-
-void uti596addPolledCmd(struct i596_cmd *pCmd)
- {
-
- #ifdef DBG_596
- printf("Adding command 0x%x\n", pCmd -> command );
- #endif
-
-#ifdef DBG_POLLED_CMD
-
- switch ( pCmd -> command & 0x7 ){ /* check bottom 7 bits */
- case CmdConfigure:
- printf("PolledCMD: Configure Command 0x%x\n", pCmd->command);
- break;
- case CmdSASetup:
- printf("PolledCMD: Set CMDress Command 0x%x\n", pCmd->command);
- break;
- case CmdMulticastList:
- printf("PolledCMD: Multi-cast list 0x%x\n", pCmd->command);
- break;
- case CmdNOp:
- printf("PolledCMD: NO op 0x%x\n", pCmd->command);
- break;
- case CmdTDR:
- printf("PolledCMD: TDR 0x%x\n", pCmd->command);
- break;
- case CmdDump:
- printf("PolledCMD: Dump 0x%x\n", pCmd->command);
- break;
- case CmdDiagnose:
- printf("PolledCMD: Diagnose 0x%x\n", pCmd->command);
- break;
- case CmdTx:
- break;
- default:
- printf("PolledCMD: ****Unknown Command encountered 0x%x\n", pCmd->command);
- break;
- } /* end switch */
-
-#endif
-
- pCmd->status = 0;
- pCmd->command |= CMD_EOL ; /* only command in list*/
-
- pCmd->next = I596_NULL;
-
- UTI_WAIT_COMMAND_ACCEPTED(10000,"Add Polled command: wait prev");
-
- uti596_softc.pCmdHead = uti596_softc.pCmdTail = uti596_softc.scb.pCmd = pCmd;
- uti596_softc.scb.command = CUC_START;
- outport_word (CHAN_ATTN,0);
-
- UTI_WAIT_COMMAND_ACCEPTED(10000,"Add Polled command: start");
- uti596_softc.pCmdHead = uti596_softc.pCmdTail = uti596_softc.scb.pCmd = I596_NULL;
-
-#ifdef DBG_POLLED_CMD
- printf("Scb status & command 0x%x 0x%x\n",
- uti596_softc.scb.status,
- uti596_softc.scb.command );
-#endif
-
- }
-/*
- * Driver transmit daemon
- */
-void
-uti596_txDaemon (void *arg)
-{
- struct uti596_softc *sc = (struct uti596_softc *)arg;
- struct ifnet *ifp = &sc->arpcom.ac_if;
- struct mbuf *m;
- rtems_event_set events;
-
- for (;;) {
- /*
- * Wait for packet from stack
- */
- rtems_bsdnet_event_receive (START_TRANSMIT_EVENT,
- RTEMS_EVENT_ANY | RTEMS_WAIT,
- RTEMS_NO_TIMEOUT, &events);
-
- /*
- * Send packets till queue is empty.
- * Ensure that irq is on before sending.
- */
- for (;;) {
- /* Feb 17: No need to make sure a reset is in progress,
- * Since reset daemon runs at same priority as this thread
- */
- /*
- * Get the next mbuf chain to transmit.
- */
- IF_DEQUEUE(&ifp->if_snd, m);
- if (!m)
- break;
-
- send_packet (ifp, m); /* blocks */
- } /* end for */
- ifp->if_flags &= ~IFF_OACTIVE; /* no more to send, mark output inactive */
- }
-}
-
-
-/*
- * NIC reset daemon.
- */
-void
-uti596_resetDaemon (void *arg)
-{
- struct uti596_softc *sc = (struct uti596_softc *)arg;
- rtems_event_set events;
- rtems_time_of_day tm_struct;
-
- /* struct ifnet *ifp = &sc->arpcom.ac_if; */
-
- for (;;) {
- /*
- * Wait for reset event from ISR
- */
- rtems_bsdnet_event_receive (NIC_RESET_EVENT,
- RTEMS_EVENT_ANY | RTEMS_WAIT,
- RTEMS_NO_TIMEOUT, &events);
-
- rtems_clock_get(RTEMS_CLOCK_GET_TOD, &tm_struct);
- printf("reset daemon: Resetting NIC @ %" PRIu32 ":%" PRIu32 ":%" PRIu32 " \n",
- tm_struct.hour, tm_struct.minute, tm_struct.second);
-
- sc->stats.nic_reset_count++;
- /*
- * Reinitialize the network card
- */
- rtems_bsdnet_semaphore_obtain ();
- uti596reset();
- rtems_bsdnet_semaphore_release ();
- }
-}
-
-
- /***********************************************************************
- * Function: send_packet
- *
- * Description: Send a raw ethernet packet
- *
- * Algorithm:
- * increment some stats counters,
- * create the transmit command,
- * add the command to the CBL,
- * wait for event
- *
- ***********************************************************************/
-
-void send_packet(struct ifnet *ifp, struct mbuf *m)
-{
- struct i596_tbd *pPrev = I596_NULL,
- *pRemainingTbdList,
- *pTbd;
- struct mbuf *n, *input_m = m;
-
- struct uti596_softc *sc = ifp->if_softc; /* is this available from ifp ?*/
-
- struct mbuf *l = NULL;
- unsigned int length = 0;
- rtems_status_code status;
- int bd_count = 0;
- rtems_event_set events;
-
- /*
- * For all mbufs in the chain,
- * fill a transmit buffer descriptor
- */
- pTbd = sc->pTxCmd->pTbd;
-
- do {
- if (m->m_len) {
- /*
- * Fill in the buffer descriptor
- */
- length += m->m_len;
- pTbd->data = mtod (m, void *);
- pTbd->size = m->m_len;
- pPrev = pTbd;
- pTbd = pTbd -> next;
- l = m;
- m = m->m_next;
- }
- else {
- /*
- * Just toss empty mbufs
- */
- MFREE (m, n);
- m = n;
- if (l != NULL)
- l->m_next = m;
- }
- } while( m != NULL && ++bd_count < 16 );
-
- /* This should never happen */
- if ( bd_count == 16 ) {
- printf("TX ERROR:Too many mbufs in the packet!!!\n");
- printf("Must coalesce!\n");
- }
-
- if ( length < UTI_596_ETH_MIN_SIZE ) {
- pTbd->data = sc->zeroes; /* add padding to pTbd */
- pTbd->size = UTI_596_ETH_MIN_SIZE - length; /* zeroes have no effect on the CRC */
- }
- else
- pTbd = pPrev; /* Don't use pTbd in the send routine */
-
- /* Disconnect the packet from the list of Tbd's */
- pRemainingTbdList = pTbd->next;
- pTbd->next = I596_NULL;
- pTbd->size |= UTI_596_END_OF_FRAME;
-
-#ifdef DBG_RAW
- printf("RAW:Add cmd and sleep\n");
-#endif
-
- sc->rawsndcnt++;
-
-#ifdef DBG_RAW
- printf ("sending packet\n");
-#endif
-
- /* Sending Zero length packet: shouldn't happen */
- if (pTbd->size <= 0) return ;
-
-#ifdef DEBUG_INIT_2
- printf("\nTransmitter adds packet\n");
- print_hdr ( sc->pTxCmd->pTbd->data ); /* print the first part */
- print_pkt ( sc->pTxCmd->pTbd->next->data ); /* print the first part */
- /* print_echo(sc->pTxCmd->pTbd->data); */
-#endif
-#ifdef DBG_VERSION
- BREAKPOINT();
-#endif
-
- /* add the command to the output command queue */
- uti596addCmd ( (struct i596_cmd *) sc->pTxCmd );
-
- /* sleep until the command has been processed or Timeout encountered. */
- status= rtems_bsdnet_event_receive (INTERRUPT_EVENT,
- RTEMS_WAIT|RTEMS_EVENT_ANY,
- RTEMS_NO_TIMEOUT,
- &events);
-
- if ( status != RTEMS_SUCCESSFUL ) {
- printf("Could not sleep %s\n", rtems_status_text(status));
- }
-
-#ifdef DBG_RAW
- printf("RAW: wake\n");
-#endif
-
- sc->txInterrupts++;
-
-#ifdef DEBUG_INIT
- printf("\nTransmitter issued packet\n");
- print_hdr ( sc->pTxCmd->pTbd -> data ); /* print the first part */
- print_pkt ( sc->pTxCmd->pTbd ->next-> data ); /* print the first part */
-#endif
-
- if ( sc->pTxCmd -> cmd.status & STAT_OK )
- sc->stats.tx_packets++;
- else
- {
-#ifdef DBG_RAW
- printf("******Driver Error 0x%x\n", sc->pTxCmd -> cmd.status );
-#endif
- sc->stats.tx_errors++;
- if ( sc->pTxCmd->cmd.status & 0x0020 )
- sc->stats.tx_retries_exceeded++;
- if (!(sc->pTxCmd->cmd.status & 0x0040))
- sc->stats.tx_heartbeat_errors++;
- if ( sc->pTxCmd->cmd.status & 0x0400 )
- sc->stats.tx_carrier_errors++;
- if ( sc->pTxCmd->cmd.status & 0x0800 )
- sc->stats.collisions++;
- if ( sc->pTxCmd->cmd.status & 0x1000 )
- sc->stats.tx_aborted_errors++;
- } /* end if stat_ok */
-
- /*
- * Restore the transmited buffer descriptor chain.
- */
- pTbd -> next = pRemainingTbdList;
-
- /*
- * Free the mbufs used by the sender.
- */
- m = input_m;
- while ( m != NULL ) {
- MFREE(m,n);
- m = n;
- }
-
-}
-
- /***********************************************************************
- * Function: print_eth
- *
- * Description:
- * Print the contents of an ethernet packet header
- * CANNOT BE CALLED FROM ISR
- *
- * Algorithm:
- * Print Destination, Src, and type of packet
- *
- ***********************************************************************/
-
- /* static */ void print_eth(unsigned char *add)
- {
- int i;
- short int length;
-
- printf("Packet Location %p\n", add);
-
- printf ("Dest ");
-
- for (i = 0; i < 6; i++)
- printf(" %2.2X", add[i]);
-
- printf ("\n");
-
- printf ("Source");
-
- for (i = 6; i < 12; i++)
- printf(" %2.2X", add[i]);
-
- printf ("\n");
-
- printf ("frame type %2.2X%2.2X\n", add[12], add[13]);
-
- if ( add[12] == 0x08 && add[13] == 0x06 )
- { /* an ARP */
- printf("Hardware type : %2.2X%2.2X\n", add[14],add[15]);
- printf("Protocol type : %2.2X%2.2X\n", add[16],add[17]);
- printf("Hardware size : %2.2X\n", add[18]);
- printf("Protocol size : %2.2X\n", add[19]);
- printf("op : %2.2X%2.2X\n", add[20],add[21]);
-
- printf("Sender Enet addr: ");
-
- for ( i=0; i< 5 ; i++)
- printf( "%x:", add[22 + i]);
-
- printf("%x\n", add[27]);
-
- printf("Sender IP addr: ");
- for ( i=0; i< 3 ; i++)
- printf( "%u.", add[28 + i]);
-
- printf("%u\n", add[31]);
-
- printf("Target Enet addr: ");
- for ( i=0; i< 5 ; i++)
- printf( "%x:", add[32 + i]);
- printf("%x\n", add[37]);
-
- printf("Target IP addr: ");
-
- for ( i=0; i< 3 ; i++)
- printf( "%u.", add[38 + i]);
- printf("%u\n", add[41]);
-
- }
-
- if ( add[12] == 0x08 && add[13] == 0x00 )
- { /* an IP packet */
- printf("*********************IP HEADER******************\n");
- printf("IP version/IPhdr length: %2.2X TOS: %2.2X\n", add[14] , add[15]);
- printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
- printf("IP identification: %2.2X %2.2X, 3-bit flags and offset %2.2X %2.2X\n",
- add[18],add[19], add[20], add[21]);
- printf("IP TTL: %2.2X, protocol: %2.2X, checksum: %2.2X %2.2X \n",
- add[22],add[23],add[24],add[25]);
- printf("IP packet type: %2.2X code %2.2X\n", add[34],add[35]);
-
- printf("Source IP address: ");
- for ( i=0; i< 3 ; i++)
- printf( "%u.", add[26 + i]);
-
- printf("%u\n", add[29]);
-
- printf("Destination IP address: ");
- for ( i=0; i< 3 ; i++)
- printf( "%u.", add[30 + i]);
- printf("%u\n", add[33]);
-
- /* printf("********************IP Packet Data*******************\n");
- length -=20;
- for ( i=0; i < length ; i++)
- printf("0x%2.2x ", add[34+i]);
- printf("\n");
-
- printf("ICMP checksum: %2.2x %2.2x\n", add[36], add[37]);
- printf("ICMP identifier: %2.2x %2.2x\n", add[38], add[39]);
- printf("ICMP sequence nbr: %2.2x %2.2x\n", add[40], add[41]);
- */
- }
-
- }
-#ifdef DEBUG_INIT
-
- /***********************************************************************
- * Function: print_eth
- *
- * Description:
- * Print the contents of an ethernet packet header
- * CANNOT BE CALLED FROM ISR
- *
- * Algorithm:
- * Print Destination, Src, and type of packet
- *
- ***********************************************************************/
-
- /* static */ void print_hdr(unsigned char *add)
- {
- int i;
- short int length;
-
- printf("Header Location %p\n", add);
-
- printf ("Dest ");
-
- for (i = 0; i < 6; i++)
- printf(" %2.2X", add[i]);
-
- printf ("\n");
-
- printf ("Source");
-
- for (i = 6; i < 12; i++)
- printf(" %2.2X", add[i]);
-
- printf ("\n");
-
- printf ("frame type %2.2X%2.2X\n", add[12], add[13]);
-
- }
- /***********************************************************************
- * Function: print_pkt
- *
- * Description:
- * Print the contents of an ethernet packet header
- * CANNOT BE CALLED FROM ISR
- *
- * Algorithm:
- * Print Destination, Src, and type of packet
- *
- ***********************************************************************/
-
- /* static */ void print_pkt(unsigned char *add)
- {
- int i;
- short int length;
-
- printf("Data Location %p\n", add);
-
- if ( add[0] == 0x08 && add[1] == 0x06 )
- { /* an ARP */
- printf("Hardware type : %2.2X%2.2X\n", add[14],add[15]);
- printf("Protocol type : %2.2X%2.2X\n", add[16],add[17]);
- printf("Hardware size : %2.2X\n", add[18]);
- printf("Protocol size : %2.2X\n", add[19]);
- printf("op : %2.2X%2.2X\n", add[20],add[21]);
-
- printf("Sender Enet addr: ");
-
- for ( i=0; i< 5 ; i++)
- printf( "%x:", add[22 + i]);
-
- printf("%x\n", add[27]);
-
- printf("Sender IP addr: ");
- for ( i=0; i< 3 ; i++)
- printf( "%u.", add[28 + i]);
-
- printf("%u\n", add[31]);
-
- printf("Target Enet addr: ");
- for ( i=0; i< 5 ; i++)
- printf( "%x:", add[32 + i]);
- printf("%x\n", add[37]);
-
- printf("Target IP addr: ");
-
- for ( i=0; i< 3 ; i++)
- printf( "%u.", add[38 + i]);
- printf("%u\n", add[41]);
-
- }
-
- if ( add[0] == 0x08 && add[1] == 0x00 )
- { /* an IP packet */
- printf("*********************IP HEADER******************\n");
- printf("IP version/IPhdr length: %2.2X TOS: %2.2X\n", add[14] , add[15]);
- printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
- printf("IP identification: %2.2X %2.2X, 3-bit flags and offset %2.2X %2.2X\n",
- add[18],add[19], add[20], add[21]);
- printf("IP TTL: %2.2X, protocol: %2.2X, checksum: %2.2X %2.2X \n",
- add[22],add[23],add[24],add[25]);
- printf("IP packet type: %2.2X code %2.2X\n", add[34],add[35]);
-
- printf("Source IP address: ");
- for ( i=0; i< 3 ; i++)
- printf( "%u.", add[26 + i]);
-
- printf("%u\n", add[29]);
-
- printf("Destination IP address: ");
- for ( i=0; i< 3 ; i++)
- printf( "%u.", add[30 + i]);
- printf("%u\n", add[33]);
-
- printf("********************IP Packet Data*******************\n");
- length -=20;
- for ( i=0; i < length ; i++)
- printf("0x%2.2x ", add[34+i]);
- printf("\n");
-
- printf("ICMP checksum: %2.2x %2.2x\n", add[36], add[37]);
- printf("ICMP identifier: %2.2x %2.2x\n", add[38], add[39]);
- printf("ICMP sequence nbr: %2.2x %2.2x\n", add[40], add[41]);
- }
-
- }
- /***********************************************************************
- * Function: print_echo
- *
- * Description:
- * Print the contents of an ethernet packet header
- * CANNOT BE CALLED FROM ISR
- *
- * Algorithm:
- * Prints only echo packets
- *
- ***********************************************************************/
-
- /* static */ void print_echo(unsigned char *add)
- {
- int i;
- short int length;
-
- if ( add[12] == 0x08 && add[13] == 0x00 ){ /* an IP packet */
-
- printf("Packet Location %p\n", add);
-
- printf ("Dest ");
-
- for (i = 0; i < 6; i++)
- printf(" %2.2X", add[i]);
-
- printf ("\n");
-
- printf ("Source");
-
- for (i = 6; i < 12; i++)
- printf(" %2.2X", add[i]);
-
- printf ("\n");
-
- printf ("frame type %2.2X%2.2X\n", add[12], add[13]);
-
- printf("*********************IP HEADER******************\n");
- printf("IP version/IPhdr length: %2.2X TOS: %2.2X\n", add[14] , add[15]);
- printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
- printf("IP identification: %2.2X %2.2X, 3-bit flags and offset %2.2X %2.2X\n",
- add[18],add[19], add[20], add[21]);
- printf("IP TTL: %2.2X, protocol: %2.2X, checksum: %2.2X %2.2X \n",
- add[22],add[23],add[24],add[25]);
- printf("IP packet type: %2.2X code %2.2X\n", add[34],add[35]);
-
- printf("Source IP address: ");
- for ( i=0; i< 3 ; i++)
- printf( "%u.", add[26 + i]);
-
- printf("%u\n", add[29]);
-
- printf("Destination IP address: ");
- for ( i=0; i< 3 ; i++)
- printf( "%u.", add[30 + i]);
- printf("%u\n", add[33]);
-
- printf("********************IP Packet Data*******************\n");
- length -=20;
- for ( i=0; i < length ; i++)
- printf("0x%2.2x ", add[34+i]);
- printf("\n");
-
- printf("ICMP checksum: %2.2x %2.2x\n", add[36], add[37]);
- printf("ICMP identifier: %2.2x %2.2x\n", add[38], add[39]);
- printf("ICMP sequence nbr: %2.2x %2.2x\n", add[40], add[41]);
- }
- }
-#endif
-
- /***********************************************************************
- * Function: uti596_attach
- *
- * Description:
- * User requested attach of driver to hardware
- *
- * Algorithm:
- *
- * Check that the board is present
- * parse and store the command line parameters
- * argv[0]: interface label, e.g., "uti596"
- * argv[1]: maximum transmission unit, bytes, e.g., "1500"
- * argv[2]: IP address (optional)
- * initialize required rx and tx buffers
- * hook interrupt
- * issue start command and some diagnostics
- * return
- *
- ***********************************************************************/
-
-int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
-{
- struct uti596_softc *sc = &uti596_softc; /* soft config */
- struct ifnet * ifp = &sc->arpcom.ac_if;
- int i = 0;
-
-#ifdef DBG_ATTACH
- printf("attach");
-#endif
-
- sc->started = 0; /* The NIC is not started yet */
- sc->ioAddr = IO_ADDR;
-
- /* Indicate to ULCS that this is initialized */
- ifp->if_softc = sc;
- sc -> pScp = NULL;
-
- /* Assign the name */
- ifp->if_name = "uti";
-
- /* Assign the unit number */
- ifp->if_unit = 1;
-
- /* Assign mtu */
- if ( pConfig -> mtu )
- ifp->if_mtu = pConfig -> mtu;
- else
- ifp->if_mtu = ETHERMTU;
-
- /* Assign and possibly override the hw address */
-
- if ( !pConfig->hardware_address) { /* Read the ethernet address from the board */
- for (i = 0; i < 8; i++)
- inport_byte(NIC_ADDR+i,sc->arpcom.ac_enaddr[i] );
- }
- else {
- /* hwaddr override */
- memcpy (sc->arpcom.ac_enaddr, pConfig->hardware_address, ETHER_ADDR_LEN);
- }
-
- /* Test for valid hwaddr */
- if(memcmp(sc->arpcom.ac_enaddr,"\xAA\x55\x01",3)!= 0)/* b0 of byte 0 != 0 => multicast */
- return ENODEV;
-
- /* Assign requested receive buffer descriptor count */
- if (pConfig->rbuf_count)
- sc->rxBdCount = pConfig->rbuf_count;
- else
- sc->rxBdCount = RX_BUF_COUNT;
-
- /* Assign requested tx buffer descriptor count */
- if (pConfig->xbuf_count)
- sc->txBdCount = pConfig->xbuf_count;
- else
- sc->txBdCount = TX_BUF_COUNT * TX_BD_PER_BUF;
-
- /* ignore_broadcast is an unused feature... accept broadcast */
- /* sc->acceptBroadcast = !pConfig->ignore_broadcast; */
-
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
- ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX;
-
- /* to init_hardware */
- sc->started = 1;
- sc->pInboundFrameQueue = I596_NULL;
-
- ifp->if_ioctl = uti596_ioctl;
- ifp->if_init = uti596_init;
- ifp->if_start = uti596_start;
- ifp->if_output = ether_output;
-
- sc->scb.command = 0;
-
- /*
- * Attach the interface
- */
- if_attach (ifp);
- ether_ifattach (ifp);
- return 1;
-
- }
-
-
- /***********************************************************************
- * Function: uti596DynamicInterruptHandler
- *
- * Description:
- * This is the interrupt handler for the uti596 board
- *
- * Algorithm:
- *
- ***********************************************************************/
-
- /* static */ rtems_isr uti596DynamicInterruptHandler(rtems_vector_number irq)
- {
- rtems_status_code sc;
-#ifdef DEBUG_ISR
- printk("I");
-#endif
-
- UTI_WAIT_COMMAND_ACCEPTED(20000, "****ERROR:on ISR entry");
-
- if ( !(i8259s_cache & 0x20 )) {
- printk("****Error: network ISR running, no IRR!\n");
- printk("****Error: i8259s_cache = 0x%x\n",i8259s_cache );
- printk_time();
- }
-
- scbStatus = uti596_softc.scb.status & 0xf000;
-
- if ( scbStatus ){
- /* acknowledge interrupts */
- /* printk("***INFO: ACK %x\n", scbStatus);*/
- uti596_softc.scb.command = scbStatus;
- outport_word(CHAN_ATTN, 0);
-
- if( uti596_softc.resetDone ) {
- /* stack is attached */
- UTI_WAIT_COMMAND_ACCEPTED(20000, "****ERROR:ACK");
- }
- else {
- /* printk("***INFO: ACK'd w/o processing. status = %x\n", scbStatus); */
- return;
- }
- }
- else {
- printk("\n***ERROR: Spurious interrupt. Resetting...\n");
- uti596_softc.nic_reset = 1;
- }
-
- if ( (scbStatus & SCB_STAT_CX) && !(scbStatus & SCB_STAT_CNA) ){
- printk_time();
- printk("\n*****ERROR: Command Complete, and CNA available: 0x%x\nResetting...", scbStatus);
- uti596_softc.nic_reset = 1;
- return;
- }
-
- if ( !(scbStatus & SCB_STAT_CX) && (scbStatus & SCB_STAT_CNA) ) {
- printk_time();
- printk("\n*****ERROR: CNA, NO CX:0x%x\nResetting...",scbStatus);
- uti596_softc.nic_reset = 1;
- return;
- }
-
- if ( scbStatus & SCB_CUS_SUSPENDED ) {
- printk_time();
- printk("\n*****ERROR: Command unit suspended!:0x%x\nResetting...",scbStatus);
- uti596_softc.nic_reset = 1;
- return;
- }
-
- if ( scbStatus & RU_SUSPENDED ) {
- printk_time();
- printk("\n*****ERROR: Receive unit suspended!:0x%x\nResetting...",scbStatus);
- uti596_softc.nic_reset = 1;
- return;
- }
-
- if ( scbStatus & SCB_STAT_RNR ) {
- printk_time();
- printk("\n*****WARNING: RNR %x\n",scbStatus);
- printk("*****INFO: RFD cmd: %x status:%x\n",
- uti596_softc.pBeginRFA -> cmd,
- uti596_softc.pBeginRFA -> stat);
- }
-
- /*
- * Receive Unit Control
- */
- if ( scbStatus & SCB_STAT_FR ) { /* a frame has been received */
- uti596_softc.rxInterrupts++;
-
-#ifdef DBG_FR
- printk("\nISR:FR\n");
-#endif
- if ( uti596_softc.pBeginRFA == I596_NULL || !( uti596_softc.pBeginRFA -> stat & STAT_C)){
- dump_scb();
- uti596_softc.nic_reset = 1;
- }
- else
- while ( uti596_softc.pBeginRFA != I596_NULL &&
- ( uti596_softc.pBeginRFA -> stat & STAT_C)) {
-
-#ifdef DBG_ISR
- printk("ISR:pBeginRFA != NULL\n");
-#endif
- count_rx ++;
- if ( count_rx > 1)
- printk("****WARNING: Received 2 frames on 1 interrupt \n");
-
- /*
- * Give Received Frame to the ULCS
- */
- uti596_softc.countRFD--;
-
- if ( uti596_softc.countRFD < 0 )
- printk("Count < 0 !!!: count == %d, beginRFA = %p\n",
- uti596_softc.countRFD, uti596_softc.pBeginRFA);
-
- uti596_softc.stats.rx_packets++;
- pIsrRfd = uti596_softc.pBeginRFA -> next; /* the append destroys the link */
- uti596append( &uti596_softc.pInboundFrameQueue , uti596_softc.pBeginRFA );
-
- /*
- * if we have just received the a frame int he last unknown RFD,
- * then it is certain that the RFA is empty.
- */
- if ( uti596_softc.pLastUnkRFD == uti596_softc.pBeginRFA ) {
- UTI_596_ASSERT(uti596_softc.pLastUnkRFD != I596_NULL,"****ERROR:LastUnk is NULL, begin ptr @ end!\n");
- uti596_softc.pEndRFA = uti596_softc.pLastUnkRFD = I596_NULL;
- }
-
-#ifdef DBG_ISR
- printk("Wake %#x\n",uti596_softc.rxDaemonTid);
-#endif
- sc = rtems_event_send(uti596_softc.rxDaemonTid, INTERRUPT_EVENT);
- if ( sc != RTEMS_SUCCESSFUL )
- rtems_panic ("Can't notify rxDaemon: %s\n",
- rtems_status_text (sc));
-#ifdef DBG_RAW_ISR
- else
- printk("Rx Wake: %#x\n",uti596_softc.rxDaemonTid);
-#endif
-
- uti596_softc.pBeginRFA = pIsrRfd;
- } /* end while */
-
- if ( uti596_softc.pBeginRFA == I596_NULL ){ /* adjust the pEndRFA to reflect an empty list */
- if ( uti596_softc.pLastUnkRFD == I596_NULL && uti596_softc.countRFD != 0 )
- printk("Last Unk is NULL, BeginRFA is null, and count == %d\n",uti596_softc.countRFD);
-
- uti596_softc.pEndRFA = I596_NULL;
- if ( uti596_softc.countRFD != 0 ) {
- printk("****ERROR:Count is %d, but begin ptr is NULL\n",uti596_softc.countRFD );
- }
- }
-
- } /* end scb_stat_fr */
-
- /*
- * Check For Command Complete
- */
- if ( scbStatus & SCB_STAT_CX ){
-#ifdef DBG_ISR
- printk("ISR:CU\n");
-#endif
-
- pIsrCmd = uti596_softc.pCmdHead;
-
- /*
- * For ALL completed commands
- */
- if ( pIsrCmd != I596_NULL && pIsrCmd->status & STAT_C ){
-
-#ifdef DBG_RAW_ISR
- printk("ISR:pIsrCmd != NULL\n");
-#endif
-
- /*
- * Adjust the command block list
- */
- uti596_softc.pCmdHead = pIsrCmd -> next;
-
- /*
- * If there are MORE commands to process,
- * the serialization in the raw routine has failed.
- * ( Perhaps AddCmd is bad? )
- */
- UTI_596_ASSERT(uti596_softc.pCmdHead == I596_NULL,
- "****ERROR: command serialization failed\n");
- /*
- * What if the command did not complete OK?
- */
- switch ( pIsrCmd->command & 0x7)
- {
- case CmdConfigure:
-
- /* printk("****INFO:Configure OK\n"); */
- uti596_softc.cmdOk = 1;
- break;
-
- case CmdDump:
-
-#ifdef DBG_ISR
- printk("dump!\n");
-#endif
- uti596_softc.cmdOk = 1;
- break;
-
- case CmdDiagnose:
-
-#ifdef DBG_ISR
- printk("diagnose!\n");
-#endif
- uti596_softc.cmdOk = 1;
- break;
-
- case CmdSASetup:
-
- /* printk("****INFO:Set address interrupt\n"); */
- if ( pIsrCmd -> status & STAT_OK )
- uti596_softc.cmdOk = 1;
- else
- printk("****ERROR:SET ADD FAILED\n");
- break;
-
- case CmdTx:
- {
- UTI_596_ASSERT(uti596_softc.txDaemonTid, "****ERROR:Null txDaemonTid\n");
-#ifdef DBG_ISR
- printk("wake TX:0x%x\n",uti596_softc.txDaemonTid);
-#endif
- if ( uti596_softc.txDaemonTid ){ /* Ensure that the transmitter is present */
- sc = rtems_event_send (uti596_softc.txDaemonTid,
- INTERRUPT_EVENT);
-
- if ( sc != RTEMS_SUCCESSFUL )
- printk("****ERROR:Could NOT send event to tid 0x%x : %s\n",
- uti596_softc.txDaemonTid, rtems_status_text (sc) );
-#ifdef DBG_RAW_ISR
- else
- printk("****INFO:Tx wake: %#x\n",uti596_softc.txDaemonTid);
-#endif
- }
- } /* End case Cmd_Tx */
- break;
-
- case CmdMulticastList:
-
- printk("***ERROR:Multicast?!\n");
- pIsrCmd->next = I596_NULL;
- break;
-
- case CmdTDR:
- {
- unsigned long status = *( (unsigned long *)pIsrCmd)+1;
- printk("****ERROR:TDR?!\n");
-
- if (status & STAT_C)
- {
- /*
- * mark the TDR command successful
- */
- uti596_softc.cmdOk = 1;
- }
- else
- {
- if (status & 0x4000)
- printk("****WARNING:Transceiver problem.\n");
- if (status & 0x2000)
- printk("****WARNING:Termination problem.\n");
- if (status & 0x1000)
- printk("****WARNING:Short circuit.\n");
-
- /* printk("****INFO:Time %ld.\n", status & 0x07ff); */
- }
- }
- break;
-
- default:
- /*
- * This should never be reached
- */
- printk("CX but NO known command\n");
- } /* end switch */
- pIsrCmd = uti596_softc.pCmdHead; /* next command */
- if ( pIsrCmd != I596_NULL )
- printk("****WARNING: more commands in list, but no start to NIC\n");
- } /* end if pIsrCmd != NULL && pIsrCmd->stat & STAT_C */
- else {
- if ( pIsrCmd != I596_NULL ) { /* The command MAY be NULL from a RESET */
-
- /* Reset the ethernet card, and wake the transmitter (if necessary) */
- printk_time();
- printk("****INFO: Request board reset ( tx )\n");
- uti596_softc.nic_reset = 1;
- if ( uti596_softc.txDaemonTid){ /* Ensure that a transmitter is present */
- sc = rtems_event_send (uti596_softc.txDaemonTid,
- INTERRUPT_EVENT);
-
- if ( sc != RTEMS_SUCCESSFUL )
- printk("****ERROR:Could NOT send event to tid 0x%x : %s\n",uti596_softc.txDaemonTid, rtems_status_text (sc) );
-#ifdef DBG_RAW_ISR
- else
- printk("****INFO:Tx wake: %#x\n",uti596_softc.txDaemonTid);
-#endif
- }
- }
- }
- } /* end if command complete */
-
- /* if the receiver has stopped,
- * check if this is a No Resources scenario,
- * Try to add more RFD's ( no RBDs are used )
- */
- if ( uti596_softc.started ) {
- if ( scbStatus & SCB_STAT_RNR ){
-#ifdef DBG_ISR
- printk("INFO:RNR: status %#x \n", uti596_softc.scb.status );
-#endif
- /*
- * THE RECEIVER IS OFF!
- */
- if ( uti596_softc.pLastUnkRFD != I596_NULL ){ /* We have an unknown RFD, it is not inbound*/
- if ( uti596_softc.pLastUnkRFD -> stat & (STAT_C | STAT_B )) /* in use */
- uti596_softc.pEndRFA = uti596_softc.pLastUnkRFD; /* update end */
- else {
- /*
- * It is NOT in use, and since RNR, we know EL bit of pEndRFA was read!
- * So, unlink it from the RFA and move it to the saved queue.
- * But pBegin can equal LastUnk!
- */
-
- if ( uti596_softc.pEndRFA != I596_NULL ){ /* check added feb24. */
-#ifdef DEBUG_RFA
- if (uti596_softc.pEndRFA -> next != uti596_softc.pLastUnkRFD){
- printk("***ERROR:UNK: %p not end->next: %p, end: %p\n",
- uti596_softc.pLastUnkRFD,uti596_softc.pEndRFA -> next,uti596_softc.pEndRFA);
- printk("***INFO:countRFD now %d\n", uti596_softc.countRFD);
- printk("\n\n");
-
- }
-#endif
- uti596_softc.pEndRFA -> next = I596_NULL; /* added feb 16 */
- }
- uti596append( &uti596_softc.pSavedRfdQueue, uti596_softc.pLastUnkRFD );
- uti596_softc.savedCount++;
- uti596_softc.pEndSavedQueue = uti596_softc.pLastUnkRFD;
- uti596_softc.countRFD--; /* It was not in the RFA */
- /*
- * The Begin pointer CAN advance this far. We must resynch the CPU side
- * with the chip.
- */
- if ( uti596_softc.pBeginRFA == uti596_softc.pLastUnkRFD ) {
-#ifdef DEBUG_RFA
- if ( uti596_softc.countRFD != 0 ) {
- printk("****INFO:About to set begin to NULL, with count == %d\n", uti596_softc.countRFD );
- printk("\n\n");
- }
-#endif
- uti596_softc.pBeginRFA = I596_NULL;
- UTI_596_ASSERT(uti596_softc.countRFD == 0,"****ERROR:Count must be zero here!\n");
- }
- }
-
- uti596_softc.pLastUnkRFD = I596_NULL;
-
- } /* end if exists UnkRFD */
-
- /*
- * Append the saved queue to the RFA.
- * Any further RFD's being supplied will be added to
- * this new list.
- */
- if ( uti596_softc.pSavedRfdQueue != I596_NULL ) { /* entries to add */
- if ( uti596_softc.pBeginRFA == I596_NULL ) { /* add at beginning to list */
-#ifdef DEBUG_RFA
- if(uti596_softc.countRFD != 0) {
- printk("****ERROR:Begin pointer is NULL, but count == %d\n",uti596_softc.countRFD);
- }
-#endif
- uti596_softc.pBeginRFA = uti596_softc.pSavedRfdQueue;
- uti596_softc.pEndRFA = uti596_softc.pEndSavedQueue;
- uti596_softc.pSavedRfdQueue = uti596_softc.pEndSavedQueue = I596_NULL; /* Reset the End */
- }
- else {
-#ifdef DEBUG_RFA
- if ( uti596_softc.countRFD <= 0) {
- printk("****ERROR:Begin pointer is not NULL, but count == %d\n",uti596_softc.countRFD);
- }
-#endif
- UTI_596_ASSERT( uti596_softc.pEndRFA != I596_NULL, "****WARNING: END RFA IS NULL\n");
- UTI_596_ASSERT( uti596_softc.pEndRFA->next == I596_NULL, "****ERROR:END RFA -> next must be NULL\n");
-
- uti596_softc.pEndRFA->next = uti596_softc.pSavedRfdQueue;
- uti596_softc.pEndRFA->cmd &= ~CMD_EOL; /* clear the end of list */
- uti596_softc.pEndRFA = uti596_softc.pEndSavedQueue;
- uti596_softc.pSavedRfdQueue = uti596_softc.pEndSavedQueue = I596_NULL; /* Reset the End */
-#ifdef DEBUG_ISR
- printk("count: %d, saved: %d \n", uti596_softc.countRFD , uti596_softc.savedCount);
-#endif
-
- }
- /* printk("Isr: countRFD = %d\n",uti596_softc.countRFD); */
- uti596_softc.countRFD += uti596_softc.savedCount;
- /* printk("Isr: after countRFD = %d\n",uti596_softc.countRFD); */
- uti596_softc.savedCount = 0;
- }
-
-#ifdef DBG_596_RFD
- printk("The list starts here %p\n",uti596_softc.pBeginRFA );
-#endif
-
- if ( uti596_softc.countRFD > 1) {
- /****REMOVED FEB 18.
- &&
- !( uti596_softc.pBeginRFA -> stat & (STAT_C | STAT_B ))) {
- *****/
- printk_time();
- printk("****INFO: pBeginRFA -> stat = 0x%x\n",uti596_softc.pBeginRFA -> stat);
- printk("****INFO: pBeginRFA -> cmd = 0x%x\n",uti596_softc.pBeginRFA -> cmd);
- uti596_softc.pBeginRFA -> stat = 0;
- UTI_596_ASSERT(uti596_softc.scb.command == 0, "****ERROR:scb command must be zero\n");
- uti596_softc.scb.pRfd = uti596_softc.pBeginRFA;
- /* start RX here */
- printk("****INFO: ISR Starting receiver\n");
- uti596_softc.scb.command = RX_START; /* should this also be CU start? */
- outport_word(CHAN_ATTN, 0);
- }
- /*****REMOVED FEB 18.
- else {
- printk("****WARNING: Receiver NOT Started -- countRFD = %d\n", uti596_softc.countRFD);
- printk("82596 cmd: 0x%x, status: 0x%x RFA len: %d\n",
- uti596_softc.scb.command,
- uti596_softc.scb.status,
- uti596_softc.countRFD);
-
- printk("\nRFA: \n");
- for ( pISR_Rfd = uti596_softc.pBeginRFA;
- pISR_Rfd != I596_NULL;
- pISR_Rfd = pISR_Rfd->next)
- printk("Frame @ %x, status: %x, cmd: %x\n",
- pISR_Rfd, pISR_Rfd->stat, pISR_Rfd->cmd);
-
- printk("\nInbound: \n");
- for ( pISR_Rfd = uti596_softc.pInboundFrameQueue;
- pISR_Rfd != I596_NULL;
- pISR_Rfd = pISR_Rfd->next)
- printk("Frame @ %x, status: %x, cmd: %x\n",
- pISR_Rfd, pISR_Rfd->stat, pISR_Rfd->cmd);
-
- printk("\nSaved: \n");
- for ( pISR_Rfd = uti596_softc.pSavedRfdQueue;
- pISR_Rfd != I596_NULL;
- pISR_Rfd = pISR_Rfd->next)
- printk("Frame @ %x, status: %x, cmd: %x\n",
- pISR_Rfd, pISR_Rfd->stat, pISR_Rfd->cmd);
- printk("\nUnknown: %p\n",uti596_softc.pLastUnkRFD);
- }
- *****/
- } /* end stat_rnr */
-
- } /* end if receiver started */
- /* UTI_596_ASSERT(uti596_softc.scb.status == scbStatus, "****WARNING:scbStatus change!\n"); */
-
-#ifdef DBG_ISR
- printk("X\n");
-#endif
- count_rx=0;
-
- /*
- * Do this last, to ensure that the reset is called at the right time.
- */
- if ( uti596_softc.nic_reset ){
- uti596_softc.nic_reset = 0;
- sc = rtems_event_send(uti596_softc.resetDaemonTid, NIC_RESET_EVENT);
- if ( sc != RTEMS_SUCCESSFUL )
- rtems_panic ("Can't notify resetDaemon: %s\n", rtems_status_text (sc));
- }
-
- return;
- }
-
-/***********************************************************************
- * Function: void uti596dequeue
- *
- * Description:
- * removes an RFD from the received frame queue,
- *
- * Algorithm:
- *
- ***********************************************************************/
-
-struct i596_rfd * uti596dequeue( struct i596_rfd ** ppQ )
- {
- ISR_Level level;
-
- struct i596_rfd * pRfd;
- _ISR_Disable(level);
-
- /* invalid address, or empty queue or emptied queue */
- if( ppQ == NULL || *ppQ == NULL || *ppQ == I596_NULL) {
- _ISR_Enable(level);
- return I596_NULL;
- }
-
- pRfd = *ppQ; /* The dequeued buffer */
- *ppQ = pRfd->next; /* advance the queue pointer */
- pRfd->next = I596_NULL; /* unlink the rfd being returned */
-
- _ISR_Enable(level);
- return pRfd;
-}
-
-/***********************************************************************
- * Function: void uti596append
- *
- * Description:
- * adds an RFD to the end of the received frame queue,
- * for processing by the rxproc.
- * Also removes this RFD from the RFA
- *
- * Algorithm:
- *
- ***********************************************************************/
-
-void uti596append( struct i596_rfd ** ppQ , struct i596_rfd * pRfd )
-{
-
- struct i596_rfd *p;
-
- if ( pRfd != NULL && pRfd != I596_NULL) {
- pRfd -> next = I596_NULL;
- pRfd -> cmd |= CMD_EOL; /* set EL bit */
-
- if ( *ppQ == NULL || *ppQ == I596_NULL ) {
- /* Empty or emptied */
- *ppQ = pRfd;
- }
- else
- {
- for ( p=*ppQ; p -> next != I596_NULL; p=p->next)
- ;
-
- p->cmd &= ~CMD_EOL; /* Clear EL bit at end */
- p->next = pRfd;
- }
- }
- else
- printf("Illegal attempt to append: %p\n", pRfd);
-}
-
-
-/***********************************************************************
- * Function: uti596stop
- *
- * Description:
- * stop the driver
- *
- * Algorithm:
- * mark driver as not started,
- * mark transmitter as busy
- * abort any transmissions/receptions
- * clean-up all buffers ( RFD's et. al. )
- *
- *
- *
- *
- ***********************************************************************/
-
-/* static */
-void uti596_stop(struct uti596_softc *sc)
-{
- sc->started = 0;
-
-#ifdef DBG_596
- printf("%s: Shutting down ethercard, status was %4.4x.\n",
- uti596_softc.pIface->name, uti596_softc.scb.status);
-#endif
-
- printf("Stopping interface\n");
- sc->scb.command = CUC_ABORT|RX_ABORT;
- outport_word( CHAN_ATTN, 0 );
-
-}
-
-static int
-uti596_ioctl (struct ifnet *ifp, ioctl_command_t command, caddr_t data)
-{
- struct uti596_softc *sc = ifp->if_softc;
- int error = 0;
-
- switch (command) {
- case SIOCGIFADDR:
- case SIOCSIFADDR:
- printk("SIOCSIFADDR\n");
- ether_ioctl (ifp, command, data);
- break;
-
- case SIOCSIFFLAGS:
- printk("SIOCSIFFLAGS\n");
- switch (ifp->if_flags & (IFF_UP | IFF_RUNNING)) {
- case IFF_RUNNING:
- printk("IFF_RUNNING\n");
- uti596_stop (sc);
- break;
-
- case IFF_UP:
- printk("IFF_UP\n");
- uti596_init (sc);
- break;
-
- case IFF_UP | IFF_RUNNING:
- printk("IFF_UP and RUNNING\n");
- uti596_stop (sc);
- uti596_init (sc);
- break;
-
- default:
- printk("default\n");
-
- break;
- }
- break;
-
- case SIO_RTEMS_SHOW_STATS:
- printk("show stats\n");
- uti596_stats (sc);
- break;
-
- /*
- * FIXME: All sorts of multicast commands need to be added here!
- */
- default:
- printk("default: EINVAL\n");
- error = EINVAL;
- break;
- }
- return error;
-}
-
-
-/***********************************************************************
- * Function: uti596_stats
- *
- * Description:
- * print out the collected data
- *
- * Algorithm:
- * use printf
- *
- ***********************************************************************/
-
-void
-uti596_stats(struct uti596_softc *sc)
- {
- printf(" CPU Reports:\n");
- printf ("Tx raw send count:%-8lu", sc->rawsndcnt);
- printf ("Rx Interrupts:%-8lu", sc->rxInterrupts);
- printf ("Tx Interrupts:%-8lu\n", sc->txInterrupts);
- printf ("Rx Packets:%-8u", sc->stats.rx_packets);
- printf ("Tx Attempts:%-u\n", sc->stats.tx_packets);
-
- printf ("Rx Dropped:%-8u", sc->stats.rx_dropped);
- printf ("Rx IP Packets:%-8u", sc->stats.rx_packets);
- printf ("Tx Errors:%-8u\n", sc->stats.tx_errors);
- printf ("Tx aborted:%-8u", sc->stats.tx_aborted_errors);
- printf ("Tx Dropped:%-8u\n", sc->stats.tx_dropped);
- printf ("Tx IP packets:%-8u", sc->stats.tx_packets);
-
- printf ("Collisions Detected:%-8u\n", sc->stats.collisions);
- printf ("Tx Heartbeat Errors:%-8u", sc->stats.tx_heartbeat_errors);
- printf ("Tx Carrier Errors:%-8u\n", sc->stats.tx_carrier_errors);
- printf ("Tx Aborted Errors:%-8u", sc->stats.tx_aborted_errors);
- printf ("Rx Length Errors:%-8u\n", sc->stats.rx_length_errors);
- printf ("Rx Overrun Errors:%-8u", sc->stats.rx_over_errors);
- printf ("Rx Fifo Errors:%-8u\n", sc->stats.rx_fifo_errors);
- printf ("Rx Framing Errors:%-8u", sc->stats.rx_frame_errors);
- printf ("Rx crc errors:%-8u\n", sc->stats.rx_crc_errors);
-
- printf ("TX WAITS: %-8lu\n", sc->txRawWait);
-
- printf ("NIC resets: %-8u\n", sc->stats.nic_reset_count);
-
- printf("NIC reports\n");
-
- dump_scb();
- }
-
-void dumpQ(void) {
-
- struct i596_rfd *pRfd;
-
- printf("savedQ:\n");
- for( pRfd = uti596_softc.pSavedRfdQueue;
- pRfd != I596_NULL;
- pRfd = pRfd -> next)
- printf("pRfd: %p, stat: 0x%x cmd: 0x%x\n",pRfd,pRfd -> stat,pRfd -> cmd);
- printf("Inbound:\n");
- for( pRfd = uti596_softc.pInboundFrameQueue;
- pRfd != I596_NULL;
- pRfd = pRfd -> next)
- printf("pRfd: %p, stat: 0x%x cmd: 0x%x\n",pRfd,pRfd -> stat,pRfd -> cmd);
- printf("Last Unk: %p\n", uti596_softc.pLastUnkRFD );
-
- printf("RFA:\n");
- for( pRfd = uti596_softc.pBeginRFA;
- pRfd != I596_NULL;
- pRfd = pRfd -> next)
- printf("pRfd: %p, stat: 0x%x cmd: 0x%x\n",pRfd,pRfd -> stat,pRfd -> cmd);
-}
-
-void uti596Diagnose(int verbose){
- struct i596_cmd diagnose;
- int count=10000;
-
- diagnose.command = CmdDiagnose;
- diagnose.status = 0;
- uti596addPolledCmd(&diagnose);
- while( !( diagnose.status & STAT_C ) && count ) {
- if(verbose)
- printf(".");
- count --;
- }
- if(verbose)
- printf("Status diagnostic: 0x%2.2x\n", diagnose.status);
-
-}
-void show_buffers (void)
-{
- struct i596_rfd *pRfd;
-
- printf("82596 cmd: 0x%x, status: 0x%x RFA len: %d\n",
- uti596_softc.scb.command,
- uti596_softc.scb.status,
- uti596_softc.countRFD);
-
- printf("\nRFA: \n");
- for ( pRfd = uti596_softc.pBeginRFA;
- pRfd != I596_NULL;
- pRfd = pRfd->next)
- printf("Frame @ %p, status: %2.2x, cmd: %2.2x\n",
- pRfd, pRfd->stat, pRfd->cmd);
-
- printf("\nInbound: \n");
- for ( pRfd = uti596_softc.pInboundFrameQueue;
- pRfd != I596_NULL;
- pRfd = pRfd->next)
- printf("Frame @ %p, status: %2.2x, cmd: %2.2x\n",
- pRfd, pRfd->stat, pRfd->cmd);
-
- printf("\nSaved: \n");
- for ( pRfd = uti596_softc.pSavedRfdQueue;
- pRfd != I596_NULL;
- pRfd = pRfd->next)
- printf("Frame @ %p, status: %2.2x, cmd: %2.2x\n",
- pRfd, pRfd->stat, pRfd->cmd);
- printf("\nUnknown: %p\n",uti596_softc.pLastUnkRFD);
-
-}
-void show_queues(void)
-{
- struct i596_rfd *pRfd;
-
- printf("CMD: 0x%x, Status: 0x%x\n",
- uti596_softc.scb.command,
- uti596_softc.scb.status);
- printf("saved Q\n");
-
- for ( pRfd = uti596_softc.pSavedRfdQueue;
- pRfd != I596_NULL &&
- pRfd != NULL;
- pRfd = pRfd->next)
- printf("0x%p\n", pRfd);
-
- printf("End saved Q 0x%p\n", uti596_softc.pEndSavedQueue);
-
- printf("\nRFA:\n");
- for ( pRfd = uti596_softc.pBeginRFA;
- pRfd != I596_NULL &&
- pRfd != NULL;
- pRfd = pRfd->next)
- printf("0x%p\n", pRfd);
-
- printf("uti596_softc.pEndRFA: %p\n",uti596_softc.pEndRFA);
-}
-
-void uti596_init(void * arg){
-
- struct uti596_softc *sc = arg;
- struct ifnet *ifp = &sc->arpcom.ac_if;
-
- if (sc->txDaemonTid == 0) {
-
- uti596_initialize_hardware(sc);
-
- /*
- * Start driver tasks
- */
-
- sc->txDaemonTid = rtems_bsdnet_newproc ("UTtx", 2*4096, uti596_txDaemon, sc);
- sc->rxDaemonTid = rtems_bsdnet_newproc ("UTrx", 2*4096, uti596_rxDaemon, sc);
- sc->resetDaemonTid = rtems_bsdnet_newproc ("UTrt", 2*4096,
- uti596_resetDaemon, sc);
-
-#ifdef DBG_INIT
- printf("After attach, status of board = 0x%x\n", sc->scb.status );
-#endif
- outport_word(0x380, 0xf); /* reset the LED's */
-
- }
-
- /*
- * Enable receiver
- */
- UTI_WAIT_COMMAND_ACCEPTED(4000, "init:Before RX_START");
- sc->scb.pRfd = sc -> pBeginRFA;
- sc->scb.command = RX_START;
- outport_word(CHAN_ATTN,0 );
- UTI_WAIT_COMMAND_ACCEPTED(4000, "init:RX_START");
- /*
- * Tell the world that we're running.
- */
- ifp->if_flags |= IFF_RUNNING;
-
-}
-void dump_scb(void){
- printk("status 0x%x\n",uti596_softc.scb.status);
- printk("command 0x%x\n",uti596_softc.scb.command);
- printk("cmd 0x%x\n",(int)uti596_softc.scb.pCmd);
- printk("rfd 0x%x\n",(int)uti596_softc.scb.pRfd);
- printk("crc_err 0x%x\n",uti596_softc.scb.crc_err);
- printk("align_err 0x%x\n",uti596_softc.scb.align_err);
- printk("resource_err 0x%x\n",uti596_softc.scb.resource_err );
- printk("over_err 0x%x\n",uti596_softc.scb.over_err);
- printk("rcvdt_err 0x%x\n",uti596_softc.scb.rcvdt_err);
- printk("short_err 0x%x\n",uti596_softc.scb.short_err);
- printk("t_on 0x%x\n",uti596_softc.scb.t_on);
- printk("t_off 0x%x\n",uti596_softc.scb.t_off);
-}
-
-void printk_time(void){
- rtems_time_of_day tm_struct;
-
- rtems_clock_get(RTEMS_CLOCK_GET_TOD, &tm_struct);
- printk("Current time: %d:%d:%d \n", tm_struct.hour, tm_struct.minute, tm_struct.second);
-}
diff --git a/c/src/lib/libbsp/i386/i386ex/network/uti596.h b/c/src/lib/libbsp/i386/i386ex/network/uti596.h
deleted file mode 100644
index 1238d2ea41..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/network/uti596.h
+++ /dev/null
@@ -1,284 +0,0 @@
-
-/* uti596.h: Contains the defines and structures used by the uti596 driver */
-
-/*
- * EII: March 11: Created v. 0.0
- * Jan 12/98 Added STAT bits, s11-=s5 and max_colls.
- *
- * $Id$
- */
-
-#ifndef UTI596_H
-#define UTI596_H
-#include <rtems/error.h>
-#include <rtems/rtems_bsdnet.h>
-
-#include <sys/param.h>
-#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/sockio.h>
-
-#include <net/if.h>
-
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
-
-/* Ethernet statistics */
-
-struct enet_statistics{
- int rx_packets; /* total packets received */
- int tx_packets; /* total packets transmitted */
- int rx_errors; /* bad packets received */
- int tx_errors; /* packet transmit problems */
- int rx_dropped; /* no space in buffers */
- int tx_dropped; /* */
- int tx_retries_exceeded; /* excessive retries */
- int multicast; /* multicast packets received */
- int collisions;
-
- /* detailed rx_errors: */
- int rx_length_errors;
- int rx_over_errors; /* receiver ring buff overflow */
- int rx_crc_errors; /* recved pkt with crc error */
- int rx_frame_errors; /* recv'd frame alignment error */
- int rx_fifo_errors; /* recv'r fifo overrun */
- int rx_missed_errors; /* receiver missed packet */
-
- /* detailed tx_errors */
- int tx_aborted_errors;
- int tx_carrier_errors;
- int tx_fifo_errors;
- int tx_heartbeat_errors;
- int tx_window_errors;
-
- /* NIC reset errors */
- int nic_reset_count; /* The number of times uti596reset() has been called. */
-};
-
-enum commands {
- CmdNOp = 0,
- CmdSASetup = 1,
- CmdConfigure = 2,
- CmdMulticastList = 3,
- CmdTx = 4,
- CmdTDR = 5,
- CmdDump = 6,
- CmdDiagnose = 7
-};
-
-#define UTI596_MUTEX 1
-
-#define CMD_EOL 0x8000 /* The last command of the list, stop. */
-#define CMD_SUSP 0x4000 /* Suspend after doing cmd. */
-#define CMD_INTR 0x2000 /* Interrupt after doing cmd. */
-
-#define CMD_FLEX 0x0008 /* Enable flexible memory model */
-
-#define SCB_STAT_CX 0x8000 /* Cmd completes with 'I' bit set */
-#define SCB_STAT_FR 0x4000 /* Frame Received */
-#define SCB_STAT_CNA 0x2000 /* Cmd unit Not Active */
-#define SCB_STAT_RNR 0x1000 /* Receiver Not Ready */
-
-#define SCB_CUS_SUSPENDED 0x0100
-#define SCB_CUS_ACTIVE 0x0200
-
-#define STAT_C 0x8000 /* Set to 1 after execution */
-#define STAT_B 0x4000 /* 1 : Cmd being executed, 0 : Cmd done. */
-#define STAT_OK 0x2000 /* 1: Command executed ok 0 : Error */
-#define STAT_A 0x1000 /* command has been aborted */
-
-#define STAT_S11 0x0800
-#define STAT_S10 0x0400
-#define STAT_S9 0x0200
-#define STAT_S8 0x0100
-#define STAT_S7 0x0080
-#define STAT_S6 0x0040
-#define STAT_S5 0x0020
-#define STAT_MAX_COLLS 0x000F
-
-#define RBD_STAT_P 0x4000 /* prefetch */
-#define RBD_STAT_F 0x4000 /* used */
-
-#define CUC_START 0x0100
-#define CUC_RESUME 0x0200
-#define CUC_SUSPEND 0x0300
-#define CUC_ABORT 0x0400
-#define RX_START 0x0010
-#define RX_RESUME 0x0020
-#define RX_SUSPEND 0x0030
-#define RX_ABORT 0x0040
-
-#define RU_SUSPENDED 0x0010
-#define RU_NO_RESOURCES 0x0020
-#define RU_READY 0x0040
-
-#define IO_ADDR 0x360
-#define PORT_ADDR IO_ADDR
-#define CHAN_ATTN PORT_ADDR + 4
-#define NIC_ADDR PORT_ADDR + 8
-
-struct i596_cmd {
- volatile unsigned short status;
- volatile unsigned short command;
- struct i596_cmd *next;
-};
-
-#define I596_NULL ( ( void * ) 0xffffffff)
-#define UTI_596_END_OF_FRAME 0x8000
-#define SIZE_MASK 0x3fff
-
-/*
- * Transmit buffer Descriptor
- */
-
-struct i596_tbd {
- unsigned short size;
- unsigned short pad;
- struct i596_tbd *next;
- char *data;
-};
-
-/*
- * Receive buffer Descriptor
- */
-
-struct i596_rbd {
- unsigned short count;
- unsigned short offset;
- struct i596_rbd *next;
- char *data;
- unsigned short size;
- unsigned short pad;
-};
-
-/*
- * Transmit Command Structure
- */
-struct tx_cmd {
- struct i596_cmd cmd;
- struct i596_tbd *pTbd;
- unsigned short size;
- unsigned short pad;
-} ;
-
-/*
- * Receive Frame Descriptor
- */
-struct i596_rfd {
- volatile unsigned short stat;
- volatile unsigned short cmd;
- struct i596_rfd *next;
- struct i596_rbd *pRbd;
- unsigned short count;
- unsigned short size;
- char data [1532 ];
-} ;
-
-struct i596_dump {
- struct i596_cmd cmd;
- char * pData;
-};
-
-struct i596_set_add {
- struct i596_cmd cmd;
- char data[8];
-};
-
-struct i596_configure {
- struct i596_cmd cmd;
- char data[16];
-};
-
-struct i596_nop {
- struct i596_cmd cmd;
-};
-
-struct i596_tdr {
- struct i596_cmd cmd;
- unsigned int data;
-};
-
-#define RX_RING_SIZE 8
-
-/*
- * System Control Block
- */
-struct i596_scb {
- volatile unsigned short status;
- volatile unsigned short command;
- struct i596_cmd *pCmd;
- struct i596_rfd *pRfd;
- volatile unsigned long crc_err;
- volatile unsigned long align_err;
- volatile unsigned long resource_err;
- volatile unsigned long over_err;
- volatile unsigned long rcvdt_err;
- volatile unsigned long short_err;
- volatile unsigned short t_on;
- volatile unsigned short t_off;
-};
-
-/*
- * Intermediate System Control Block
- */
-struct i596_iscp {
- volatile unsigned long stat;
- struct i596_scb *scb;
-} ;
-/*
- * System Control Parameters
- */
-struct i596_scp {
- unsigned long sysbus;
- unsigned long pad;
- struct i596_iscp *iscp;
-} ;
-
-struct uti596_softc {
- struct arpcom arpcom;
- rtems_irq_connect_data irqInfo;
- struct i596_scp *pScp;
- struct i596_iscp iscp;
- struct i596_scb scb;
- struct i596_set_add set_add;
- struct i596_configure set_conf;
- struct i596_tdr tdr;
- struct i596_nop nop;
- unsigned long stat;
- struct tx_cmd *pTxCmd;
- struct i596_tbd *pTbd;
-
- int ioAddr;
-
- struct i596_rfd *pBeginRFA;
- struct i596_rfd *pEndRFA;
- struct i596_rfd *pLastUnkRFD;
- struct i596_rbd *pLastUnkRBD;
- struct i596_rfd *pEndSavedQueue;
- struct i596_cmd *pCmdHead;
- struct i596_cmd *pCmdTail; /* unneeded, as chaining not used, but implemented */
-
- rtems_id rxDaemonTid;
- rtems_id txDaemonTid;
- rtems_id resetDaemonTid;
-
- struct enet_statistics stats;
- int started;
- unsigned long rxInterrupts;
- unsigned long txInterrupts;
- volatile int cmdOk;
- int resetDone;
- unsigned long txRawWait;
- struct i596_rfd *pInboundFrameQueue;
- short int rxBdCount;
- short int txBdCount;
- short int countRFD;
- short int savedCount;
- struct i596_rfd *pSavedRfdQueue;
- rtems_name semaphore_name;
- rtems_id semaphore_id;
- char zeroes[64];
- unsigned long rawsndcnt;
- int nic_reset; /* flag is for requesting that ISR issue a reset quest */
-} ;
-#endif
diff --git a/c/src/lib/libbsp/i386/i386ex/preinstall.am b/c/src/lib/libbsp/i386/i386ex/preinstall.am
deleted file mode 100644
index 59d8bc82ce..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/preinstall.am
+++ /dev/null
@@ -1,91 +0,0 @@
-## Automatically generated by ampolish3 - Do not edit
-
-if AMPOLISH3
-$(srcdir)/preinstall.am: Makefile.am
- $(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
-endif
-
-PREINSTALL_DIRS =
-DISTCLEANFILES += $(PREINSTALL_DIRS)
-
-all-local: $(TMPINSTALL_FILES)
-
-TMPINSTALL_FILES =
-CLEANFILES = $(TMPINSTALL_FILES)
-
-all-am: $(PREINSTALL_FILES)
-
-PREINSTALL_FILES =
-CLEANFILES += $(PREINSTALL_FILES)
-
-$(PROJECT_LIB)/$(dirstamp):
- @$(MKDIR_P) $(PROJECT_LIB)
- @: > $(PROJECT_LIB)/$(dirstamp)
-PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
-
-$(PROJECT_INCLUDE)/$(dirstamp):
- @$(MKDIR_P) $(PROJECT_INCLUDE)
- @: > $(PROJECT_INCLUDE)/$(dirstamp)
-PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
-
-$(PROJECT_INCLUDE)/bsp/$(dirstamp):
- @$(MKDIR_P) $(PROJECT_INCLUDE)/bsp
- @: > $(PROJECT_INCLUDE)/bsp/$(dirstamp)
-PREINSTALL_DIRS += $(PROJECT_INCLUDE)/bsp/$(dirstamp)
-
-$(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs
-PREINSTALL_FILES += $(PROJECT_LIB)/bsp_specs
-
-$(PROJECT_INCLUDE)/bsp.h: include/bsp.h $(PROJECT_INCLUDE)/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp.h
-
-$(PROJECT_INCLUDE)/tm27.h: include/tm27.h $(PROJECT_INCLUDE)/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tm27.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/tm27.h
-
-$(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
-
-$(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
-
-$(PROJECT_INCLUDE)/coverhd.h: include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
-
-$(PROJECT_INCLUDE)/bsp/irq.h: ../../i386/shared/irq/irq.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq.h
-
-$(PROJECT_INCLUDE)/bsp/irq_asm.h: ../../i386/shared/irq/irq_asm.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq_asm.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq_asm.h
-
-$(PROJECT_INCLUDE)/bsp/irq-generic.h: ../../shared/include/irq-generic.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-generic.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-generic.h
-
-$(PROJECT_INCLUDE)/bsp/irq-info.h: ../../shared/include/irq-info.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/irq-info.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/irq-info.h
-
-$(PROJECT_LIB)/start.$(OBJEXT): start.$(OBJEXT) $(PROJECT_LIB)/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_LIB)/start.$(OBJEXT)
-TMPINSTALL_FILES += $(PROJECT_LIB)/start.$(OBJEXT)
-
-$(PROJECT_LIB)/linkcmds: startup/linkcmds $(PROJECT_LIB)/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds
-PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds
-
-$(PROJECT_INCLUDE)/uart.h: ../../i386/shared/comm/uart.h $(PROJECT_INCLUDE)/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/uart.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/uart.h
-
-$(PROJECT_INCLUDE)/pcibios.h: ../../i386/shared/pci/pcibios.h $(PROJECT_INCLUDE)/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/pcibios.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/pcibios.h
-
diff --git a/c/src/lib/libbsp/i386/i386ex/start/80386ex.h b/c/src/lib/libbsp/i386/i386ex/start/80386ex.h
deleted file mode 100644
index a3ee4c7aba..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/start/80386ex.h
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Submitted by:
- *
- * Erik Ivanenko
- * University of Toronto
- * erik.ivanenko@utoronto.ca
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-/* REMAP ADDRESSING Registers */
-#define REMAPCFGH 0x0023
-#define REMAPCFGL 0x0022
-#define REMAPCFG 0x0022
-/* INTERRUPT CONTROL REGISTERS -- SLOT 15 ADDRESSES */
-#define ICW1M 0xF020
-#define ICW1S 0xF0A0
-#define ICW2M 0xF021
-#define ICW2S 0xF0A1
-#define ICW3M 0xF021
-#define ICW3S 0xF0A1
-#define ICW4M 0xF021
-#define ICW4S 0xF0A1
-#define OCW1M 0xF021
-#define OCW1S 0xF0A1
-#define OCW2M 0xF020
-#define OCW2S 0xF0A0
-#define OCW3M 0xF020
-#define OCW3S 0xF0A0
-/* INTERRUPT CONTROL REGISTERS -- SLOT 0 ADDRESSES */
-#define ICW1MDOS 0x0020
-#define ICW1SDOS 0x00A0
-#define ICW2MDOS 0x0021
-#define ICW2SDOS 0x00A1
-#define ICW3MDOS 0x0021
-#define ICW3SDOS 0x00A1
-#define ICW4MDOS 0x0021
-#define ICW4SDOS 0x00A1
-#define OCW1MDOS 0x0021
-#define OCW1SDOS 0x00A1
-#define OCW2MDOS 0x0020
-#define OCW2SDOS 0x00A0
-#define OCW3MDOS 0x0020
-#define OCW3SDOS 0x00A0
-
-/* CONFIGURATION Registers */
-#define DMACFG 0xF830
-#define INTCFG 0xF832
-#define TMRCFG 0xF834
-#define SIOCFG 0xF836
-#define P1CFG 0xF820
-#define P2CFG 0xF822
-#define P3CFG 0xF824
-#define PINCFG 0xF826
-
-/* WATCHDOG TIMER Registers */
-#define WDTRLDH 0xF4C0
-#define WDTRLDL 0xF4C2
-#define WDTCNTH 0xF4C4
-#define WDTCNTL 0xF4C6
-#define WDTCLR 0xF4C8
-#define WDTSTATUS 0xF4CA
-
-/* TIMER CONTROL REGISTERS -- SLOT 15 ADDRESSES */
-#define TMR0 0xF040
-#define TMR1 0xF041
-#define TMR2 0xF042
-#define TMRCON 0xF043
-/* TIMER CONTROL REGISTERS -- SLOT 0 ADDRESSES */
-#define TMR0DOS 0x0040
-#define TMR1DOS 0x0041
-#define TMR2DOS 0x0042
-#define TMRCONDOS 0x0043
-
-/* INPUT/OUTPUT PORT UNIT Registers */
-#define P1PIN 0xF860
-#define P1LTC 0xF862
-#define P1DIR 0xF864
-#define P2PIN 0xF868
-#define P2LTC 0xF86A
-#define P2DIR 0xF86C
-#define P3PIN 0xF870
-#define P3LTC 0xF872
-#define P3DIR 0xF874
-
-/* ASYNCHRONOUS SERIAL CHANNEL 0 -- SLOT 15 ADDRESSES */
-#define RBR0 0xF4F8
-#define THR0 0xF4F8
-#define TBR0 0xF4F8
-#define DLL0 0xF4F8
-#define IER0 0xF4F9
-#define DLH0 0xF4F9
-#define IIR0 0xF4FA
-#define LCR0 0xF4FB
-#define MCR0 0xF4FC
-#define LSR0 0xF4FD
-#define MSR0 0xF4FE
-#define SCR0 0xF4FF
-/* ASYNCHRONOUS SERIAL CHANNEL 0 -- SLOT 0 ADDRESSES */
-#define RBR0DOS 0x03F8
-#define THR0DOS 0x03F8
-#define TBR0DOS 0x03F8
-#define DLL0DOS 0x03F8
-#define IER0DOS 0x03F9
-#define DLH0DOS 0x03F9
-#define IIR0DOS 0x03FA
-#define LCR0DOS 0x03FB
-#define MCR0DOS 0x03FC
-#define LSR0DOS 0x03FD
-#define MSR0DOS 0x03FE
-#define SCR0DOS 0x03FF
-
-/* ASYNCHRONOUS SERIAL CHANNEL 1 -- SLOT 15 ADDRESSES */
-#define RBR1 0xF8F8
-#define THR1 0xF8F8
-#define TBR1 0XF8F8
-#define DLL1 0xF8F8
-#define IER1 0xF8F9
-#define DLH1 0xF8F9
-#define IIR1 0xF8FA
-#define LCR1 0xF8FB
-#define MCR1 0xF8FC
-#define LSR1 0xF8FD
-#define MSR1 0xF8FE
-#define SCR1 0xF8FF
-/* ASYNCHRONOUS SERIAL CHANNEL 1 -- SLOT 0 ADDRESSES */
-#define RBR1DOS 0x02F8
-#define THR1DOS 0x02F8
-#define TBR1DOS 0x02F8
-#define DLL1DOS 0x02F8
-#define IER1DOS 0x02F9
-#define DLH1DOS 0x02F9
-#define IIR1DOS 0x02FA
-#define LCR1DOS 0x02FB
-#define MCR1DOS 0x02FC
-#define LSR1DOS 0x02FD
-#define MSR1DOS 0x02FE
-#define SCR1DOS 0x02FF
-
-/* SYNCHRONOUS SERIAL CHANNEL REGISTERS */
-#define SSIOTBUF 0xF480
-#define SSIORBUF 0xF482
-#define SSIOBAUD 0xF484
-#define SSIOCON1 0xF486
-#define SSIOCON2 0xF488
-#define SSIOCTR 0xF48A
-
-/* CHIP SELECT UNIT Registers */
-#define CS0ADL 0xF400
-#define CS0ADH 0xF402
-#define CS0MSKL 0xF404
-#define CS0MSKH 0xF406
-#define CS1ADL 0xF408
-#define CS1ADH 0xF40A
-#define CS1MSKL 0xF40C
-#define CS1MSKH 0xF40E
-#define CS2ADL 0xF410
-#define CS2ADH 0xF412
-#define CS2MSKL 0xF414
-#define CS2MSKH 0xF416
-#define CS3ADL 0xF418
-#define CS3ADH 0xF41A
-#define CS3MSKL 0xF41C
-#define CS3MSKH 0xF41E
-#define CS4ADL 0xF420
-#define CS4ADH 0xF422
-#define CS4MSKL 0xF424
-#define CS4MSKH 0xF426
-#define CS5ADL 0xF428
-#define CS5ADH 0xF42A
-#define CS5MSKL 0xF42C
-#define CS5MSKH 0xF42E
-#define CS6ADL 0xF430
-#define CS6ADH 0xF432
-#define CS6MSKL 0xF434
-#define CS6MSKH 0xF436
-#define UCSADL 0xF438
-#define UCSADH 0xF43A
-#define UCSMSKL 0xF43C
-#define UCSMSKH 0xF43E
-
-/* REFRESH CONTROL UNIT Registers */
-
-#define RFSBAD 0xF4A0
-#define RFSCIR 0xF4A2
-#define RFSCON 0xF4A4
-#define RFSADD 0xF4A6
-
-/* POWER MANAGEMENT CONTROL Registers */
-
-#define PWRCON 0xF800
-#define CLKPRS 0xF804
-
-/* DMA UNIT REGISTERS -- SLOT 15 ADDRESSES */
-#define DMA0TAR 0xF000
-#define DMA0BYC 0xF001
-#define DMA1TAR 0xF002
-#define DMA1BYC 0xF003
-#define DMACMD1 0xF008
-#define DMASTS 0xF008
-#define DMASRR 0xF009
-#define DMAMSK 0xF00A
-#define DMAMOD1 0xF00B
-#define DMACLRBP 0xF00C
-#define DMACLR 0xF00D
-#define DMACLRMSK 0xF00E
-#define DMAGRPMSK 0xF00F
-#define DMA0REQL 0xF010
-#define DMA0REQH 0xF011
-#define DMA1REQL 0xF012
-#define DMA1REQH 0xF013
-#define DMABSR 0xF018
-#define DMACHR 0xF019
-#define DMAIS 0xF019
-#define DMACMD2 0xF01A
-#define DMAMOD2 0xF01B
-#define DMAIEN 0xF01C
-#define DMAOVFE 0xF01D
-#define DMACLRTC 0xF01E
-#define DMA1TARPL 0xF083
-#define DMA1TARPH 0xF085
-#define DMA0TARPH 0xF086
-#define DMA0TARPL 0xF087
-#define DMA0BYCH 0xF098
-#define DMA1BYCH 0xF099
-
-/* DMA UNIT REGISTERS -- SLOT 0 ADDRESSES */
-#define DMA0TARDOS 0x0000
-#define DMA0BYCDOS 0x0001
-#define DMA1TARDOS 0x0002
-#define DMA1BYCDOS 0x0003
-#define DMACMD1DOS 0x0008
-#define DMASTSDOS 0x0008
-#define DMASRRDOS 0x0009
-#define DMAMSKDOS 0x000A
-#define DMAMOD1DOS 0x000B
-#define DMACLRBPDOS 0x000C
-#define DMACLRDOS 0x000D
-#define DMACLRMSKDOS 0x000E
-#define DMAGRPMSKDOS 0x000F
-#define DMA1TARPLDOS 0x0083
-#define DMA0TARPLDOS 0x0087
-
-/* A20GATE AND FAST CPU RESET -- SLOT 15 ADDRESS */
-#define PORT92 0xF092
-/* A20GATE AND FAST CPU RESET -- SLOT 0 ADDRESS */
-#define PORT92DOS 0x0092
-
diff --git a/c/src/lib/libbsp/i386/i386ex/start/80386ex.inc b/c/src/lib/libbsp/i386/i386ex/start/80386ex.inc
deleted file mode 100644
index bec46baddf..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/start/80386ex.inc
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Submitted by:
- *
- * Erik Ivanenko
- * University of Toronto
- * erik.ivanenko@utoronto.ca
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-/* REMAP ADDRESSING Registers */
-.set REMAPCFGH , 0x0023
-.set REMAPCFGL , 0x0022
-.set REMAPCFG , 0x0022
-/* INTERRUPT CONTROL REGISTERS -- SLOT 15 ADDRESSES */
-.set ICW1M , 0xF020
-.set ICW1S , 0xF0A0
-.set ICW2M , 0xF021
-.set ICW2S , 0xF0A1
-.set ICW3M , 0xF021
-.set ICW3S , 0xF0A1
-.set ICW4M , 0xF021
-.set ICW4S , 0xF0A1
-.set OCW1M , 0xF021
-.set OCW1S , 0xF0A1
-.set OCW2M , 0xF020
-.set OCW2S , 0xF0A0
-.set OCW3M , 0xF020
-.set OCW3S , 0xF0A0
-/* INTERRUPT CONTROL REGISTERS -- SLOT 0 ADDRESSES */
-.set ICW1MDOS , 0x0020
-.set ICW1SDOS , 0x00A0
-.set ICW2MDOS , 0x0021
-.set ICW2SDOS , 0x00A1
-.set ICW3MDOS , 0x0021
-.set ICW3SDOS , 0x00A1
-.set ICW4MDOS , 0x0021
-.set ICW4SDOS , 0x00A1
-.set OCW1MDOS , 0x0021
-.set OCW1SDOS , 0x00A1
-.set OCW2MDOS , 0x0020
-.set OCW2SDOS , 0x00A0
-.set OCW3MDOS , 0x0020
-.set OCW3SDOS , 0x00A0
-
-
-/* CONFIGURATION Registers */
-.set DMACFG , 0xF830
-.set INTCFG , 0xF832
-.set TMRCFG , 0xF834
-.set SIOCFG , 0xF836
-.set P1CFG , 0xF820
-.set P2CFG , 0xF822
-.set P3CFG , 0xF824
-.set PINCFG , 0xF826
-
-/* WATCHDOG TIMER Registers */
-.set WDTRLDH , 0xF4C0
-.set WDTRLDL , 0xF4C2
-.set WDTCNTH , 0xF4C4
-.set WDTCNTL , 0xF4C6
-.set WDTCLR , 0xF4C8
-.set WDTSTATUS , 0xF4CA
-
-/* TIMER CONTROL REGISTERS -- SLOT 15 ADDRESSES */
-.set TMR0 , 0xF040
-.set TMR1 , 0xF041
-.set TMR2 , 0xF042
-.set TMRCON , 0xF043
-/* TIMER CONTROL REGISTERS -- SLOT 0 ADDRESSES */
-.set TMR0DOS , 0x0040
-.set TMR1DOS , 0x0041
-.set TMR2DOS , 0x0042
-.set TMRCONDOS , 0x0043
-
-/* INPUT/OUTPUT PORT UNIT Registers */
-.set P1PIN , 0xF860
-.set P1LTC , 0xF862
-.set P1DIR , 0xF864
-.set P2PIN , 0xF868
-.set P2LTC , 0xF86A
-.set P2DIR , 0xF86C
-.set P3PIN , 0xF870
-.set P3LTC , 0xF872
-.set P3DIR , 0xF874
-
-/* ASYNCHRONOUS SERIAL CHANNEL 0 -- SLOT 15 ADDRESSES */
-.set RBR0 , 0xF4F8
-.set THR0 , 0xF4F8
-.set TBR0 , 0xF4F8
-.set DLL0 , 0xF4F8
-.set IER0 , 0xF4F9
-.set DLH0 , 0xF4F9
-.set IIR0 , 0xF4FA
-.set LCR0 , 0xF4FB
-.set MCR0 , 0xF4FC
-.set LSR0 , 0xF4FD
-.set MSR0 , 0xF4FE
-.set SCR0 , 0xF4FF
-/* ASYNCHRONOUS SERIAL CHANNEL 0 -- SLOT 0 ADDRESSES */
-.set RBR0DOS , 0x03F8
-.set THR0DOS , 0x03F8
-.set TBR0DOS , 0x03F8
-.set DLL0DOS , 0x03F8
-.set IER0DOS , 0x03F9
-.set DLH0DOS , 0x03F9
-.set IIR0DOS , 0x03FA
-.set LCR0DOS , 0x03FB
-.set MCR0DOS , 0x03FC
-.set LSR0DOS , 0x03FD
-.set MSR0DOS , 0x03FE
-.set SCR0DOS , 0x03FF
-
-/* ASYNCHRONOUS SERIAL CHANNEL 1 -- SLOT 15 ADDRESSES */
-.set RBR1 , 0xF8F8
-.set THR1 , 0xF8F8
-.set TBR1 , 0XF8F8
-.set DLL1 , 0xF8F8
-.set IER1 , 0xF8F9
-.set DLH1 , 0xF8F9
-.set IIR1 , 0xF8FA
-.set LCR1 , 0xF8FB
-.set MCR1 , 0xF8FC
-.set LSR1 , 0xF8FD
-.set MSR1 , 0xF8FE
-.set SCR1 , 0xF8FF
-/* ASYNCHRONOUS SERIAL CHANNEL 1 -- SLOT 0 ADDRESSES */
-.set RBR1DOS , 0x02F8
-.set THR1DOS , 0x02F8
-.set TBR1DOS , 0x02F8
-.set DLL1DOS , 0x02F8
-.set IER1DOS , 0x02F9
-.set DLH1DOS , 0x02F9
-.set IIR1DOS , 0x02FA
-.set LCR1DOS , 0x02FB
-.set MCR1DOS , 0x02FC
-.set LSR1DOS , 0x02FD
-.set MSR1DOS , 0x02FE
-.set SCR1DOS , 0x02FF
-
-/* SYNCHRONOUS SERIAL CHANNEL REGISTERS */
-.set SSIOTBUF , 0xF480
-.set SSIORBUF , 0xF482
-.set SSIOBAUD , 0xF484
-.set SSIOCON1 , 0xF486
-.set SSIOCON2 , 0xF488
-.set SSIOCTR , 0xF48A
-
-/* CHIP SELECT UNIT Registers */
-.set CS0ADL , 0xF400
-.set CS0ADH , 0xF402
-.set CS0MSKL , 0xF404
-.set CS0MSKH , 0xF406
-.set CS1ADL , 0xF408
-.set CS1ADH , 0xF40A
-.set CS1MSKL , 0xF40C
-.set CS1MSKH , 0xF40E
-.set CS2ADL , 0xF410
-.set CS2ADH , 0xF412
-.set CS2MSKL , 0xF414
-.set CS2MSKH , 0xF416
-.set CS3ADL , 0xF418
-.set CS3ADH , 0xF41A
-.set CS3MSKL , 0xF41C
-.set CS3MSKH , 0xF41E
-.set CS4ADL , 0xF420
-.set CS4ADH , 0xF422
-.set CS4MSKL , 0xF424
-.set CS4MSKH , 0xF426
-.set CS5ADL , 0xF428
-.set CS5ADH , 0xF42A
-.set CS5MSKL , 0xF42C
-.set CS5MSKH , 0xF42E
-.set CS6ADL , 0xF430
-.set CS6ADH , 0xF432
-.set CS6MSKL , 0xF434
-.set CS6MSKH , 0xF436
-.set UCSADL , 0xF438
-.set UCSADH , 0xF43A
-.set UCSMSKL , 0xF43C
-.set UCSMSKH , 0xF43E
-
-/* REFRESH CONTROL UNIT Registers */
-
-.set RFSBAD , 0xF4A0
-.set RFSCIR , 0xF4A2
-.set RFSCON , 0xF4A4
-.set RFSADD , 0xF4A6
-
-/* POWER MANAGEMENT CONTROL Registers */
-
-.set PWRCON , 0xF800
-.set CLKPRS , 0xF804
-
-/* DMA UNIT REGISTERS -- SLOT 15 ADDRESSES */
-.set DMA0TAR , 0xF000
-.set DMA0BYC , 0xF001
-.set DMA1TAR , 0xF002
-.set DMA1BYC , 0xF003
-.set DMACMD1 , 0xF008
-.set DMASTS , 0xF008
-.set DMASRR , 0xF009
-.set DMAMSK , 0xF00A
-.set DMAMOD1 , 0xF00B
-.set DMACLRBP , 0xF00C
-.set DMACLR , 0xF00D
-.set DMACLRMSK , 0xF00E
-.set DMAGRPMSK , 0xF00F
-.set DMA0REQL , 0xF010
-.set DMA0REQH , 0xF011
-.set DMA1REQL , 0xF012
-.set DMA1REQH , 0xF013
-.set DMABSR , 0xF018
-.set DMACHR , 0xF019
-.set DMAIS , 0xF019
-.set DMACMD2 , 0xF01A
-.set DMAMOD2 , 0xF01B
-.set DMAIEN , 0xF01C
-.set DMAOVFE , 0xF01D
-.set DMACLRTC , 0xF01E
-.set DMA1TARPL , 0xF083
-.set DMA1TARPH , 0xF085
-.set DMA0TARPH , 0xF086
-.set DMA0TARPL , 0xF087
-.set DMA0BYCH , 0xF098
-.set DMA1BYCH , 0xF099
-
-/* DMA UNIT REGISTERS -- SLOT 0 ADDRESSES */
-.set DMA0TARDOS , 0x0000
-.set DMA0BYCDOS , 0x0001
-.set DMA1TARDOS , 0x0002
-.set DMA1BYCDOS , 0x0003
-.set DMACMD1DOS , 0x0008
-.set DMASTSDOS , 0x0008
-.set DMASRRDOS , 0x0009
-.set DMAMSKDOS , 0x000A
-.set DMAMOD1DOS , 0x000B
-.set DMACLRBPDOS , 0x000C
-.set DMACLRDOS , 0x000D
-.set DMACLRMSKDOS , 0x000E
-.set DMAGRPMSKDOS , 0x000F
-.set DMA1TARPLDOS , 0x0083
-.set DMA0TARPLDOS , 0x0087
-
-/* A20GATE AND FAST CPU RESET -- SLOT 15 ADDRESS */
-.set PORT92 , 0xF092
-/* A20GATE AND FAST CPU RESET -- SLOT 0 ADDRESS */
-.set PORT92DOS , 0x0092
diff --git a/c/src/lib/libbsp/i386/i386ex/start/macros.inc b/c/src/lib/libbsp/i386/i386ex/start/macros.inc
deleted file mode 100644
index 22b9572f55..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/start/macros.inc
+++ /dev/null
@@ -1,115 +0,0 @@
-/* macros.inc
- *
- * This file assists the board independent startup code
- * by initializing the chip-select channels to
- * reflect the proper memory configuration.
- *
- * NOTE: No stack has been established when this routine
- * is invoked. It returns to start.s through ldsegs
- *
- * Submitted by:
- *
- * Erik Ivanenko
- * University of Toronto
- * erik.ivanenko@utoronto.ca
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-.set GDT_CODE_PTR , 0x10
-.set GDT_DATA_PTR , 0x18
-
-.set BOARD_SELECT , 0x301
-.set BOARD_DATA , 0x302
-.set BOARD_LATCH , 0x303
-
-
-#define SetExRegByte(_register,_value) \
- movb $ ## _value, al; \
- movw $ ## _register, dx; \
- outb al, dx
-
-#define SetExRegWord(_register,_value) \
- movw $ ## _value, ax; \
- movw $ ## _register, dx ; \
- outw ax, dx
-
-
-#define DESC2(lim_0_15, bas_0_15, bas_16_23, access, gran, bas_24_31) \
- .word lim_0_15 ; \
- .word bas_0_15 ; \
- .byte bas_16_23 ; \
- .byte access ; \
- .byte gran ; \
- .byte bas_24_31
-
-#define DESC3( _base, _limit) \
-.word _limit ; \
-.long _base
-
-/* THE GET_ACCESS IS CHANGED FROM 8E TO 9E */
-
-#define INTERRUPT_GATE( _vector ) \
- .word _vector ; \
- .word GDT_CODE_PTR ; \
- .byte 0x0 ; \
- .byte 0x8E ; \
- .word 0x0
-
-#define rLOAD_INDEX( _selector, _segment_register) \
- movl _selector , _segment_register ; \
- addb al, ( eax )
-
-#define rLOAD_SEGMENT( _reg, _segment_register) \
- mov _reg , _segment_register ; \
-
-/* #define rLOAD_SEGMENT( _reg, _segment_register) \
- .code16 ; \
- mov _reg , _segment_register ; \
- .code32
-*/
-#define pLOAD_SEGMENT( _selector, _segment_register) \
- movl $ ## _selector , eax ; .code16 ; \
- mov ax, _segment_register ; .code32
-
-/* #define MOVE_WORD( _immed32, _reg ) \
- data16 ; \
- movl _immed32, _reg
-*/
-
-#define MOVE_WORD( _immed32, _reg ) \
- movw _immed32, _reg
-
-/* #define MOVE_IMMED_WORD( _immed32, _reg ) \
- data16 ; \
- mov $ ## _immed32, _reg
-
-#define CS_OFF( _cs_symbol, _reg ) \
- data16 ; \
- mov _cs_symbol, _reg ; \
- data16 ;\
- andl $0x000ffff, _reg
-
-#define _16_NOPS \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ; \
- nop ;
-*/
-
diff --git a/c/src/lib/libbsp/i386/i386ex/start/start.S b/c/src/lib/libbsp/i386/i386ex/start/start.S
deleted file mode 100644
index 5867d25c27..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/start/start.S
+++ /dev/null
@@ -1,480 +0,0 @@
-/*
- * This file is the main boot and configuration file for the i386ex. It is
- * solely responsible for initializing the internal register set to reflect
- * the proper board configuration. This version is the "generic" i386ex
- * startup:
- *
- * 1) 512K flask ROM @3f80000
- * 2) 1 Mb RAM @ 0x0
- * 3) Timer0 used as RTEMS clock ticker, 1 msec tick rate.
- * 4) READY# is generated by CPU
- *
- * The file is a multi-section file, with sections as follows:
- * 1) interrupt gates, in section "ints"
- * 2) interrupt descriptor table, in section "idt"
- * 3) global descriptor table, in section "gdt"
- * 4) reset in section "reset"
- * 5) and initial boot code in section " initial"
- *
- * Submitted by:
- *
- * Erik Ivanenko
- * University of Toronto
- * erik.ivanenko@utoronto.ca
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
-
-changes:
- SetExRegByte(ICW3S , 0x02 ) # MUST be 0x02 according to intel
- SetExRegByte(ICW3M , 0x04 ) # IR2 is cascaded internally: was 0x02 => IR1 is cascaded
-
- */
-
-#include <rtems/asm.h>
-#include "macros.inc"
-#include "80386ex.inc"
-
-/*
- * NEW_GAS Needed for binutils 2.9.1.0.7 and higher
- */
-
- EXTERN (boot_card) /* exits to bspstart */
- EXTERN (stack_start) /* defined in startup/linkcmds */
- EXTERN (Clock_exit)
-
- PUBLIC (Interrupt_descriptor_table)
- PUBLIC ( SYM(IDTR) )
-/* PUBLIC( SYM(_initInternalRegisters) ) */
-
-BEGIN_DATA
-SYM(IDTR): DESC3( SYM(Interrupt_descriptor_table), 0x07ff );
-
-SYM(Interrupt_descriptor_table): /* Now in data section */
- .rept 256
- .word 0,0,0,0
- .endr
-
-END_DATA
-
-BEGIN_DATA
- PUBLIC (_Global_descriptor_table)
-
-SYM(GDTR): DESC3( GDT_TABLE, 0x1f ); # one less than the size
-SYM (_Global_descriptor_table):
-SYM(GDT_TABLE): DESC2(0,0,0,0,0,0);
-SYM(GDT_ALIAS): DESC2(32,0x1000,0x0,0x93,0,0x0);
-SYM(GDT_CODE): DESC2(0xffff,0,0x0,0x9B,0xDF,0x00);
-SYM(GDT_DATA): DESC2(0xffff,0,0x0,0x92,0xDF,0x00); # was CF
-SYM(GDT_END):
-
-END_DATA
-
-/* This section is the section that is used by the interrupt
- descriptor table. It is used to provide the IDT with the
- correct vector offsets. It is for symbol definition only.
-*/
-
- .code16
- .section .reset, "ax"
- PUBLIC ( SYM(reset) )
-SYM(reset):
- nop
- cli
-#ifdef NEW_GAS
- data32 addr32 jmp SYM(_initInternalRegisters) /* different section in this file */
-#else
- jmp SYM(_initInternalRegisters) /* different section in this file */
-#endif
-/* .code32 in case this section moves */
- nop /* required by CHIP LAB to pad out size */
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
-
- .section .initial, "ax"
- /* nop */ /* required for linker -- initial jump is to "label - 2" */
- /* nop */ /* ie. _initInternalRegisters -2 ( which now == .initial ) */
-/*
- * Enable access to peripheral register at expanded I/O addresses
- */
-SYM(_initInternalRegisters):
-
- /* .code16 */
- movw $0x8000 , ax
- outb al , $REMAPCFGH
- xchg al , ah
- outb al,$REMAPCFGL
- outw ax, $REMAPCFG ;
-/*
- * Configure operation of the A20 Address Line
- */
-SYM(A20):
- movw $PORT92 , dx
-
- inb dx , al # clear A20 port reset
- andb $0xfe , al # b0 Fast Reset(0)=disabled,(1)=reset triggered
- orb $0x02 , al # Bit 1 Fast A20 = 0 (always 0) else enabled.
- outb al , dx
-
-SYM(Watchdog):
- movw $WDTSTATUS , dx # address the WDT status port
- inb dx , al # get the WDT status
- orb $0x01 , al # set the CLKDIS bit
- outb al , dx # disable the clock to the WDT
-
-/*
- * Initialize Refresh Control Unit for:
- * Refresh Address = 0x0000
-
- * Refresh gate between rows is 15.6 uSec
- * Using a CLK2 frequency of 50Mhz ( 25Mhz CPU )
- * The refresh unit is enabled
- * The refresh pin is not used.
- */
-
-SYM(InitRCU):
- SetExRegWord( RFSCIR , 390) # refresh interval was 390, tried 312
- SetExRegWord( RFSBAD , 0x0) # base address
- SetExRegWord( RFSADD , 0x0) # address register
- SetExRegWord( RFSCON , 0x8000) # enable bit
-
-/*
- * Initialize clock and power mgmt unit for:
- * Clock Frequency = 50 Mhz
- * Prescaled clock output = 1 Mhz
- * Normal halt instructions
- */
-
-SYM(InitClk):
- SetExRegByte( PWRCON, 0x0 )
- SetExRegWord( CLKPRS, 0x17) # 0x13 for 1.19318 MHz. 0x17 for 1MHz.
-
-/**************************************************************
- * Initialize the Pin Configurations
- *************************************************************/
-
-/*
- * Initialize I/O port 1 for:
- * PIN 0 = 1, DCD0# to package pin
- * PIN 1 = 1, RTS0# to package pin
- * PIN 2 = 1, DTR0# to package pin
- * PIN 3 = 1, DSR0# to package pin
- * PIN 4 = 1, RI0# to package pin
- * PIN 5 = 0, Outport (FLASH Vpp Enable, 0=Enable 1=Disable)
- * PIN 6 = 0, Outport (P16_HOLD to 386ex option header JP7 pin 5)
- * PIN 7 = 0, Outport (P17_HOLD to 386ex option header JP7 pin 3)
- */
-
-SYM(InitPort1):
- SetExRegByte( P1LTC , 0xff )
- SetExRegByte( P1DIR , 0x0 )
- SetExRegByte( P1CFG , 0x1f)
-
-/*
- * Initialize I/O port 2 for:
- * PIN 0 = 0, Outport (P20_CS0# to 386ex option header JP7 pin 11)
- * PIN 1 = 0, Outport (P21_CS1# to 386ex option header JP7 pin 9)
- * PIN 2 = 1, CS2# (SMRAM) If not using CS2 can be configured as.?
- * PIN 3 = 0, Outport ( no connect )
- * PIN 4 = 1, CS#4 (DRAM)
- * PIN 5 = 1, RXD0 input. See not for I/0 port 1 pins 1-4
- * PIN 6 = 1, TXD0 output.
- * PIN 7 = 1, CTS0# input.
- */
-
-SYM(InitPort2):
- SetExRegByte( P2LTC , 0xff )
- SetExRegByte( P2DIR , 0x0 )
- SetExRegByte( P2CFG , 0xfe)
-
-/*
- * Initialize I/O port 3 P3CFG
- * PIN 0 = 1, TMROUT0 to package pin
- * PIN 1 = 0, (TMROUT1 to 386ex option header JP7 pin 23)
- * PIN 2 = 0, INT0 (IR1) disabled, (P3.2 out to JP7 pin 21)
- * PIN 3 = 0, INT1 (IR5) disbled (P3.3 to option header JP7 pin 19)
- * PIN 4 = 0, INT2 (IR6) disbled (P3.4 to option header JP7 pin 17)
- * PIN 5 = 0, INT2 (IR7) disabled (P3.5 to 386ex header JP7 pin 15)
- * PIN 6 = 0, Inport (Debugger Break P3.6/PWRD to package pin )
- * P3.6 selected
- * PIN 7 = 0, COMCLK output disabled, 1.8432 Mhz OSC1 oscillator.
- * ( Debbugger uses COMCLK as the clocking source )
- * P3.7 connected to package pin.
- */
-
-SYM(InitPort3):
- SetExRegByte( P3LTC , 0xff )
- SetExRegByte( P3DIR , 0x41 )
- SetExRegByte( P3CFG , 0x09 ) # can check TMROUT0
-/*
- * Initialize Peripheral Pin Configurations:
- * PIN 0 = 1, RTS1# to package pin
- * PIN 1 = 1, DTR1# to package pin
- * PIN 2 = 1, TXD1 out to package pin
- * PIN 3 = 0, EOP#/TC
- * PIN 4 = 0, DACK0#
- * PIN 5 = 1, Timer2
- * PIN 6 = 0, 0 => CS6# connected to package pin
- * PIN 7 = 0, Don't care
- */
-
-SYM(InitPeriph):
- SetExRegByte( PINCFG , 0x24)
-
-/*
- * Initialize the Asynchronous Serial Ports:
- * BIT 7 = 1, Internal SIO1 modem signals
- * BIT 6 = 1, Internal SIO0 modem signals
- * BIT 2 = 0, PSCLK for SSIO clock
- * BIT 1 = 1, SERCLK for SIO1 clock
- * BIT 0 = 1, SERCLK for SIO0 clock
- */
-
-SYM(InitSIO):
- SetExRegByte( SIOCFG, 0xC3 ) # SIOn clocked internally
-
- SetExRegByte( LCR0, 0x80 ) # latch DLL0, DLH0
- SetExRegByte( DLL0, 0x51 ) # 0x51 sets to 9600 baud, 0x28=19.2k, 0x7 -> 115.2k
- SetExRegByte( DLH0, 0x00 ) # 0x145 is 2400 baud
- SetExRegByte( LCR0, 0x03 ) # enable r/w buffers, IER0 accessible
- # mode 8-n-1
- SetExRegByte( IER0, 0x00 ) # was 0x0f All interrupts detected
-
- SetExRegByte( LCR1, 0x80 ) # latch DLL0, DLH0
- SetExRegByte( DLL1, 0x51 ) # 0x51 set to 9600 baud, 0x7 = 115200
- SetExRegByte( DLH1, 0x00 ) # 0x145 is 2400 baud
- SetExRegByte( LCR1, 0x03 ) # enable r/w buffers, IER1 accessible
- # reg 8-n-1
- SetExRegByte( IER1, 0x00 ) # was 0x0f - All interrupts detected
-
-SYM(InitMCR):
-/*
- * Initialize Timer for:
- * BIT 7 = 1, Timer clocks disabled
- * BIT 6 = 0, Reserved
- * BIT 5 = 1, TMRCLK2 instead of Vcc to Gate2
- * BIT 4 = 0, PSCLK to CLK2
- * BIT 3 = 1, TMRCLK1 instead of Vcc to Gate1
- * BIT 2 = 0, PSCLK to Gate1
- * BIT 1 = 0, Vcc to Gate0
- * BIT 0 = 0, PSCLK to Gate0
- */
-
-SYM(InitTimer):
- SetExRegByte(TMRCFG , 0x80 ) # All counters disabled, Gates 0,1
- # and 2 are set to Vcc
-
- SetExRegByte(TMRCON , 0x34 ) # prepare to write counter 0 LSB,MSB
- SetExRegByte(TMR0 , 0x00 ) # sfa
- SetExRegByte(TMR0 , 0x00 ) # sfa
-
- SetExRegByte(TMRCON , 0x70 ) # mode 0 disables on Gate= Vcc
- SetExRegByte(TMR1 , 0x00 ) # sfa
- SetExRegByte(TMR1 , 0x00 ) # sfa
-
- SetExRegByte(TMRCON , 0xB0 ) # mode 0 disables on gate =Vcc
- SetExRegByte(TMR2 , 0x00 ) #
- SetExRegByte(TMR2 , 0x00 ) #
-
- SetExRegByte(TMRCFG , 0x80 ) # Enable = 0x00
-
-/*
- * Initialize the DMACFG register for:
- * BIT 7 = 1 , Disable DACK#1
- * BITs 6:4 = 100, TMROUT2 connected to DRQ1
- * BIT 3 = 1 , Disable DACK0#
- * BIT 2:0 = 000, Pin is connected to DRQ0
- */
-
- SetExRegByte(DMACFG , 0xC0 )
- SetExRegByte(DMACMD1, 0x00 ) # disable both DMA channels
- SetExRegByte(DMAMOD1, 0x40 )
-/*
- * Initialize the INTCFG register for:
- * BIT 7 = 0, 8259 cascade disabled
- * BIT 3 = 0, SLAVE IR6 connected to Vss
- * BIT 2 = 0, SLAVE IR5 connected to Vss
- * BIT 1 = 0, SLAVE IR1 connected to SSIOINT
- * BIT 0 = 0, SLAVE IR0 connected to Vss
- */
-
-SYM(InitInt):
-
- cli # !
-/* SetExRegByte(OCW3S, 0x20) # address the Slave status port
- movw $OCW3S , dx
- inb dx , al # Read the IRR.
-
- SetExRegByte(OCW3M, 0x20) # address the Master status port
- movw $OCW3M , dx
- inb dx , al # Read the IRR.
-*/
-
- SetExRegByte(ICW1S , 0x11 ) # EDGE TRIGGERED
- SetExRegByte(ICW2S , 0x28 ) # Slave base vector after Master
- SetExRegByte(ICW3S , 0x02 ) # slave cascaded to IR2 on master
- SetExRegByte(ICW4S , 0x01 ) # must be 0x01
-
- SetExRegByte(ICW1M , 0x11 ) # edge triggered
- SetExRegByte(ICW2M , 0x20 ) # base vector starts at byte 32
- SetExRegByte(ICW3M , 0x04) # IR2 is cascaded internally
- SetExRegByte(ICW4M , 0x01 ) # fully nested mode
-
- SetExRegByte(OCW1M , 0xde ) # IR0 only = 0xfe.
- # for IR5 and IR0 active use 0xde
- # for IR0 and IR2 use 0xfa
- SetExRegByte(INTCFG , 0x00 )
-
-SYM(SetCS4):
- SetExRegWord(CS4ADL , 0x702) #Configure chip select 4
- SetExRegWord(CS4ADH , 0x00)
- SetExRegWord(CS4MSKH, 0x03F)
- SetExRegWord(CS4MSKL, 0xFC01)
-
-SYM(SetUCS1):
- SetExRegWord(UCSADL , 0x0304) # 512K block starting at 0x80000 until 0x3f80000
- SetExRegWord(UCSADH , 0x03F8)
- SetExRegWord(UCSMSKH, 0x03F7)
- SetExRegWord(UCSMSKL, 0xFC01) # configure upper chip select
-
-/******************************************************
-* The GDT must be in RAM since it must be writeable,
-* So, move the whole data section down.
-********************************************************/
-
- movw $ _ram_data_offset , di
- movw $ _ram_data_segment, cx
- mov cx , es
-
- movw $ _data_size , cx
- movw $ _rom_data_segment, ax
- movw $ _rom_data_offset , si
- mov ax , ds
-
- repne
- movsb
-
-/*****************************
- * Load the Global Descriptor
- * Table Register
- ****************************/
-
-#ifdef NEW_GAS
- data32 addr32 lgdt SYM(GDTR) # location of GDT
-#else
- lgdt SYM(GDTR) # location of GDT
-#endif
-
-SYM(SetUCS):
- SetExRegWord(UCSADL, 0x0702) # now 512K starting at 0x3f80000.
- SetExRegWord(UCSADH, 0x03f8)
- SetExRegWord(UCSMSKH, 0x0007)
- SetExRegWord(UCSMSKL, 0xFC01) # configure upper chip select
-
- /*
- * SRAM chip select: 16 bit bus size,starting 16Mb, size 512k,
- * 4 waits
- */
-
-#ifdef UT_I386EX
-
-SYM(SetCS1):
- SetExRegWord(CS1ADL, 0x0000)
- SetExRegWord(CS1ADH, 0x000E)
- SetExRegWord(CS1MSKH, 0x0000)
- SetExRegWord(CS1MSKL, 0x0001)
-
-SYM(SetCS2):
- SetExRegWord(CS2ADL, 0x0704)
- SetExRegWord(CS2ADH, 0x0100)
- SetExRegWord(CS2MSKH, 0x0003)
- SetExRegWord(CS2MSKL, 0xfc01)
-
- /*
- * Real-time clock: 8 bit bus size, starting@16Mb+512K, size 32k
- * 4 waits
- */
-SYM(SetCS3):
- SetExRegWord(CS3ADL, 0x0504)
- SetExRegWord(CS3ADH, 0x0108)
- SetExRegWord(CS3MSKH, 0x0000)
- SetExRegWord(CS3MSKL, 0x7c01)
-
-#endif
-/***************************
- * Switch to Protected Mode
- ***************************/
-
- mov cr0, eax
- orw $0x1, ax
- mov eax, cr0
-
-/**************************
- * Flush prefetch queue,
- * and load CS selector
- *********************/
-
- ljmpl $ GDT_CODE_PTR , $ SYM(_load_segment_registers) # sets the code selector
-
-/*
- * Load the segment registers
- */
-SYM(_load_segment_registers):
- .code32
- pLOAD_SEGMENT( GDT_DATA_PTR, fs)
- pLOAD_SEGMENT( GDT_DATA_PTR, gs)
- pLOAD_SEGMENT( GDT_DATA_PTR, ss)
- pLOAD_SEGMENT( GDT_DATA_PTR, ds)
- pLOAD_SEGMENT( GDT_DATA_PTR, es)
-
-/*
- * Set up the stack
- */
-
-SYM(lidtr):
- lidt SYM(IDTR)
-
-SYM (_establish_stack):
- movl $end, eax # stack starts right after bss
- movl $stack_origin, esp # this is the high starting address
- movl $stack_origin, ebp
-
-/*
- * Zero out the BSS segment
- */
-SYM (zero_bss):
- cld # make direction flag count up
- movl $ SYM (end),ecx # find end of .bss
- movl $ SYM (_bss_start),edi # edi = beginning of .bss
- subl edi,ecx # ecx = size of .bss in bytes
- shrl ecx # size of .bss in longs
- shrl ecx
- xorl eax,eax # value to clear out memory
- repne # while ecx != 0
- stosl # clear a long in the bss
-
-/*
- * Transfer control to User's Board Support Package
- */
- pushl $0 # command line
-
- movw $0xFFFB, SYM(i8259s_cache) # ICU mask values reflect
- # initial ICU state
- call SYM(boot_card)
- addl $12,esp
-
- cli # stops interrupts from being processed after hlt!
- hlt # shutdown
-
-END
diff --git a/c/src/lib/libbsp/i386/i386ex/startup/README b/c/src/lib/libbsp/i386/i386ex/startup/README
deleted file mode 100644
index 17fde76a91..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/startup/README
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# $Id$
-#
-
-
-The requirements for this BSP are only that the GAS used supports the
-.code16 directive. The GAS released with any GCC version 2.8.0 or better
-is required. The BSP was built with an egcs snapshot pre-1.0.2 and
-post-1.0.1. However, any egcs should work.
-
-
-The only "real" differences are in bspstart.c, where the initialization now
-configures all available RAM, (after setting up the Workspaces) as heap.
-The location of the stack was changed so that the heap was not trapped
-between low memory and the stack; the stack comes before the heap.
-
-
diff --git a/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c b/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
deleted file mode 100644
index ad52160905..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This routine starts the application. It includes application,
- * board, and monitor specific initialization and configuration.
- * The generic CPU dependent initialization has been performed
- * before this routine is invoked.
- *
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * Ported to the i386ex and submitted by:
- *
- * Erik Ivanenko
- * University of Toronto
- * erik.ivanenko@utoronto.ca
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <bsp/irq.h>
-
-extern void rtems_irq_mngt_init(void);
-
-/*
- * bsp_start
- *
- * This routine does the bulk of the system initialization.
- */
-void bsp_start( void )
-{
- /*
- * Init rtems_interrupt_management
- */
- rtems_irq_mngt_init();
-}
diff --git a/c/src/lib/libbsp/i386/i386ex/startup/linkcmds b/c/src/lib/libbsp/i386/i386ex/startup/linkcmds
deleted file mode 100644
index a4a4cc6794..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/startup/linkcmds
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * This file contains directives for the GNU linker which are specific
- * to the Intel 386ex evaluation board.
- *
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- *
- * Memory layout:
- *
- * 0x3f80000 -> 0x3ff0000 : text section
- * 0x3ff0000 -> 0x3ff0028 : global descriptor table in ROM
- * 0x3ff0028 -> 0x3fff000 : data section ( copied by start.s to RAM )
- * 0x3fff000 -> 0x3fffff0 : initial section ( init 386ex, goto protected mode, copy ROM-RAM )
- * 0x3fffff0 -> 0x4000000 : reset section ( jmp to initial only )
- */
-
- ENTRY(reset) ;
-SECTIONS
-{
-
-/****************************************************************************************
- * data section:
- *
- * This section defines the locations of the data section in ROM as well as in RAM.
- * start.s copies the data section to RAM in real mode. This is done PRIOR to the lgdt
- * instruction since the data section contains the Global_descriptor_table and GDTR.
- ***********************************************************************************/
-
- _rom_data_start = 0x3ff0000;
-
- _rom_data_segment = 0xF000;
- _rom_data_offset = 0x0;
-
- _ram_data_segment = 0x0000 ;
- _ram_data_offset = 0x0;
- _ram_data_location = _ram_data_segment * 16 + _ram_data_offset;
-
-RamBase = DEFINED(RamBase) ? RamBase : _ram_data_location;
-RamSize = DEFINED(RamSize) ? RamSize : 1M;
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
-
- .init : { _init = .; *(.init) } = 0x9090
- .fini : { _fini = .; *(.fini) } = 0x9090
- .data :
- AT ( _rom_data_start )
- {
- _sdata = .;
- *(.data*);
- *(.gnu.linkonce.d*)
- *(.gcc_except_table*)
- _edata = .;
- }
- _data_start = ADDR(.data) ;
- data_start = _data_start ;
- _data_size = _edata - _sdata ;
-
-/**************************************************************************************
- * bss section:
- *
- * The bss section is the last section in RAM.
- *************************************************************************************/
- _edata = ALIGN( 0x10 );
- .bss :
- {
- _bss_start = .;
- *(.bss);
- *(COMMON);
- _ebss = ALIGN(0x10);
- end = _ebss;
- _end = end;
- __end = end;
- }
- _bss_size = _ebss - _bss_start ;
-
- . = ALIGN(0x10);
- WorkAreaBase = .;
-
-/**************************************************************************************
- * General variables:
- *
- * The stack_size variable is customizable here. The heap is located directly after
- * The stack in RAM. A routine within bspstart.c uses these variables to ensure that
- * the heap used by RTEMS is as large as the RAM remaining after all workspace configurations
- * are complete.
- *************************************************************************************/
- stack_size = 0x8000 ;
- stack_origin = end + stack_size ;
- heap_bottom = stack_origin + 4 ;
-
-/***************************************************************************************
- * text section:
- *
- * This section is NOT copied into RAM. It is left in ROM, as the flash ROM is quick enough.
- ***************************************************************************************/
- .text ( 0x3f80000 ):
- {
- CREATE_OBJECT_SYMBOLS
- text_start = . ;
- _text_start = . ;
- *(.text ) ;
- /*
- * Special FreeBSD sysctl sections.
- */
- . = ALIGN (16);
- __start_set_sysctl_set = .;
- *(set_sysctl_*);
- __stop_set_sysctl_set = ABSOLUTE(.);
- *(set_domain_*);
- *(set_pseudo_*);
-
- *(.eh_fram)
-
- . = ALIGN (16);
-
- /*
- * C++ constructors
- */
- __CTOR_LIST__ = .;
- LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
- *(.ctors)
- LONG(0)
- __CTOR_END__ = .;
- . = ALIGN (4) ;
- __DTOR_LIST__ = .;
- LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
- *(.dtors)
- LONG(0)
- __DTOR_END__ = .;
- _rodata_start = . ;
- *(.rodata*)
- *(.eh_frame)
- *(.gnu.linkonce.r*)
- _erodata = ALIGN( 0x10 ) ;
- _etext = ALIGN( 0x10 );
- _endtext = . ;
- }
-
-/*******************************************************************************************
- * initial section:
- *
- * This section is defined after the data section. It must be in the top 64K of memory
- * to enable the initial short jmp from the reset section while still in real-mode. It
- * initializes the i386ex, moves the gdt from ROM to RAM,loads the gdt,
- * jumps to protected mode, copies the data section from ROM to RAM and loads the idt.
- ******************************************************************************************/
-
- .initial _rom_data_start + _data_size :
- {
- *(.initial);
- }
-
-/*******************************************************************************************
- * board reset section:
- *
- * This section contains the short jmp from the reset section to the initial section. It is
- * the first code executed on reset/power on.
- ******************************************************************************************/
-
- .reset 0x3fffff0:
- {
- *(.reset);
- }
-
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
-
- /* DWARF debug sections.
- Symbols in the DWARF debugging sections are relative to the beginning
- of the section so we begin them at 0. */
- /* DWARF 1 */
- .debug 0 : { *(.debug) }
- .line 0 : { *(.line) }
-
- /* GNU DWARF 1 extensions */
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
-
- /* DWARF 1.1 and DWARF 2 */
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
-
- /* DWARF 2 */
- .debug_info 0 : { *(.debug_info) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line) }
- .debug_frame 0 : { *(.debug_frame) }
- .debug_str 0 : { *(.debug_str) }
- .debug_loc 0 : { *(.debug_loc) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
-
- /* SGI/MIPS DWARF 2 extensions */
- .debug_weaknames 0 : { *(.debug_weaknames) }
- .debug_funcnames 0 : { *(.debug_funcnames) }
- .debug_typenames 0 : { *(.debug_typenames) }
- .debug_varnames 0 : { *(.debug_varnames) }
- /* These must appear regardless of . */
-}
diff --git a/c/src/lib/libbsp/i386/i386ex/timer/timer.c b/c/src/lib/libbsp/i386/i386ex/timer/timer.c
deleted file mode 100644
index c4c9390648..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/timer/timer.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-#include <rtems.h>
-#include <bsp.h>
-#include <rtems/btimer.h>
-#include <stdlib.h>
-
-int Ttimer_val;
-bool benchmark_timer_find_average_overhead;
-
-extern void timerisr(void);
-extern int ClockIsOn(const rtems_raw_irq_connect_data*);
-
-#define TMR0 0xF040
-#define TMR1 0xF041
-#define TMR2 0xF042
-#define TMRCON 0xF043
-#define TMRCFG 0xF834
-
-void TimerOn(const rtems_raw_irq_connect_data* used)
-{
-
- Ttimer_val = 0; /* clear timer ISR count */
-
- outport_byte ( TMRCON , 0xb0 ); /* select tmr2, stay in mode 0 */
- outport_byte ( TMR1 , 0xfa ); /* set to 250 usec interval */
- outport_byte ( TMR1 , 0x00 );
- outport_byte ( TMRCON , 0x64 ); /* change to mode 2 ( starts timer ) */
- /* interrupts ARE enabled */
- /* outport_byte( IERA, 0x41 ); enable interrupt */
- /*
- * enable interrrupt at i8259 level
- */
- BSP_irq_enable_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
-}
-
-void TimerOff(const rtems_raw_irq_connect_data* used)
-{
- /*
- * disable interrrupt at i8259 level
- */
- BSP_irq_disable_at_i8259s(used->idtIndex - BSP_IRQ_VECTOR_BASE);
- /* reset timer mode to standard (DOS) value */
-}
-
-static rtems_raw_irq_connect_data timer_raw_irq_data = {
- BSP_RT_TIMER3 + BSP_IRQ_VECTOR_BASE,
- timerisr,
- TimerOn,
- TimerOff,
- ClockIsOn
-};
-
-void Timer_exit(void)
-{
- if (!i386_delete_idt_entry(&timer_raw_irq_data)) {
- printk("Timer_exit:Timer raw handler removal failed\n");
- rtems_fatal_error_occurred(1);
- }
-}
-
-void benchmark_timer_initialize(void)
-{
-
- static bool First = true;
-
- if (First)
- {
- First = false;
-
- atexit(Timer_exit); /* Try not to hose the system at exit. */
- if (!i386_set_idt_entry (&timer_raw_irq_data)) {
- printk("benchmark_timer_initialize: raw handler installation failed\n");
- rtems_fatal_error_occurred(1);
- }
- }
- /* wait for ISR to be called at least once */
- Ttimer_val = 0;
- while (Ttimer_val == 0)
- continue;
- Ttimer_val = 0;
-}
-
-#define AVG_OVERHEAD 3 /* It typically takes 3.0 microseconds */
- /* (3 ticks) to start/stop the timer. */
-#define LEAST_VALID 4 /* Don't trust a value lower than this */
-
-uint32_t benchmark_timer_read(void)
-{
- register uint32_t clicks;
- register uint32_t total;
-
-/* outport_byte( TBCR, 0x00 ); stop the timer -- not needed on intel */
-
- outport_byte ( TMRCON, 0x40 ); /* latch the count */
- inport_byte ( TMR1, clicks ); /* read the count */
-
- total = Ttimer_val + 250 - clicks;
-
-/* outport_byte( TBCR, 0x00 ); initial value */
-/* outport_byte( IERA, 0x40 ); disable interrupt */
-
- /* ??? Is "do not restore old vector" causing problems? */
-
- if ( benchmark_timer_find_average_overhead == true )
- return total; /* in one microsecond units */
-
- else {
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
- return (total - AVG_OVERHEAD);
- }
-}
-
-void benchmark_timer_disable_subtracting_average_overhead(
- bool find_flag
-)
-{
- benchmark_timer_find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/i386/i386ex/timer/timerisr.S b/c/src/lib/libbsp/i386/i386ex/timer/timerisr.S
deleted file mode 100644
index dec87300f8..0000000000
--- a/c/src/lib/libbsp/i386/i386ex/timer/timerisr.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* timer_isr()
- *
- * This routine provides the ISR for the Z8036 timer on the MVME136
- * board. The timer is set up to generate an interrupt at maximum
- * intervals.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-#include <rtems/asm.h>
-
- BEGIN_CODE
-
- EXTERN (Ttimer_val)
-
- PUBLIC (timerisr)
-SYM (timerisr):
- addl $250, SYM (Ttimer_val) # another 250 microseconds
- pushl eax
- movb 0xa0,al /* signal generic End Of Interrupt (EOI) to slave PIC */
- outb al, $0x20
- movb $0x20, al
- outb al, $0x20 /* signal generic EOI to Master PIC */
- popl eax
- iret
-
-END_CODE
-END