+++ /dev/null
-Make psignal prototype in libiberty match that in glibc.
-
-Fixes:
-
-gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
-gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
-/usr/include/signal.h:131: prototype declaration
-gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
-/usr/include/signal.h:131: prototype declaration
-gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
-mprotect... make[1]: *** [strsignal.o] Error 1
-make[1]: Leaving directory `/export/hda3/dkegel/queue/jobdir.produser_cpsm17/crosstool-0.32/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.1.3/build-binutils/libiberty'
-make: *** [all-libiberty] Error 2
-
-when building on red hat 7.1
-though it's a bit of a mystery why libiberty's psignal is being compiled at
-all, since red hat 7.1's glibc supports psignal (hence the error message)
-
---- binutils-2.15/libiberty/strsignal.c.old 2005-04-18 13:57:40.000000000 -0700
-+++ binutils-2.15/libiberty/strsignal.c 2005-04-18 13:59:09.000000000 -0700
-@@ -544,7 +544,7 @@
-
- /*
-
--@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
-+@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
-
- Print @var{message} to the standard error, followed by a colon,
- followed by the description of the signal specified by @var{signo},
-@@ -557,9 +557,7 @@
- #ifndef HAVE_PSIGNAL
-
- void
--psignal (signo, message)
-- unsigned signo;
-- char *message;
-+psignal (int signo, const char *message)
- {
- if (signal_names == NULL)
- {
+++ /dev/null
-Index: binutils-2.16.1/bfd/configure
-===================================================================
---- binutils-2.16.1.orig/bfd/configure
-+++ binutils-2.16.1/bfd/configure
-@@ -2834,7 +2834,7 @@ fi
-
- # Define the identity of the package.
- PACKAGE=bfd
-- VERSION=2.16.1
-+ VERSION=2.16.1.0
-
-
- cat >>confdefs.h <<_ACEOF
-Index: binutils-2.16.1/bfd/configure.in
-===================================================================
---- binutils-2.16.1.orig/bfd/configure.in
-+++ binutils-2.16.1/bfd/configure.in
-@@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([libbfd.c])
- AC_CANONICAL_TARGET
- AC_ISC_POSIX
-
--AM_INIT_AUTOMAKE(bfd, 2.16.1)
-+AM_INIT_AUTOMAKE(bfd, 2.16.1.0)
-
- dnl These must be called before AM_PROG_LIBTOOL, because it may want
- dnl to call AC_CHECK_PROG.
+++ /dev/null
-Index: binutils-2.16.1/binutils/dlltool.c
-===================================================================
---- binutils-2.16.1.orig/binutils/dlltool.c
-+++ binutils-2.16.1/binutils/dlltool.c
-@@ -389,7 +389,7 @@ static int verbose;
- static FILE *output_def;
- static FILE *base_file;
-
--#ifdef DLLTOOL_ARM
-+#if defined(DLLTOOL_ARM) && !defined(DLLTOOL_I386)
- #ifdef DLLTOOL_ARM_EPOC
- static const char *mname = "arm-epoc";
- #else
+++ /dev/null
-[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
-
-Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
-Fixes
-localealias.s:544: Error: junk at end of line, first unrecognized character is `,'
-when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
-
-Paths adjusted to match crosstool's patcher.
-
-Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
-From: Andreas Schwab <schwab at suse dot de>
-To: Nathan Sidwell <nathan at codesourcery dot com>
-Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
-Date: Fri, 23 Apr 2004 22:27:19 +0200
-Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
-
-Nathan Sidwell <nathan@codesourcery.com> writes:
-
-> Index: read.c
-> ===================================================================
-> RCS file: /cvs/src/src/gas/read.c,v
-> retrieving revision 1.76
-> diff -c -3 -p -r1.76 read.c
-> *** read.c 12 Mar 2004 17:48:12 -0000 1.76
-> --- read.c 18 Mar 2004 09:56:05 -0000
-> *************** read_a_source_file (char *name)
-> *** 1053,1059 ****
-> #endif
-> input_line_pointer--;
-> /* Report unknown char as ignored. */
-> ! ignore_rest_of_line ();
-> }
->
-> #ifdef md_after_pass_hook
-> --- 1053,1059 ----
-> #endif
-> input_line_pointer--;
-> /* Report unknown char as ignored. */
-> ! demand_empty_rest_of_line ();
-> }
->
-> #ifdef md_after_pass_hook
-
-This means that the unknown character is no longer ignored, despite the
-comment. As a side effect a line starting with a line comment character
-not followed by APP in NO_APP mode now triggers an error instead of just a
-warning, breaking builds of glibc on m68k-linux. Earlier in
-read_a_source_file where #APP is handled there is another comment that
-claims that unknown comments are ignored, when in fact they aren't (only
-the initial line comment character is skipped).
-
-Note that the presence of #APP will mess up the line counters, but
-that appears to be difficult to fix.
-
-Andreas.
-
-2004-04-23 Andreas Schwab <schwab@suse.de>
-
- * read.c (read_a_source_file): Ignore unknown text after line
- comment character. Fix misleading comment.
-
---- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200
-+++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200
-@@ -950,10 +950,14 @@ read_a_source_file (char *name)
- unsigned int new_length;
- char *tmp_buf = 0;
-
-- bump_line_counters ();
- s = input_line_pointer;
- if (strncmp (s, "APP\n", 4))
-- continue; /* We ignore it */
-+ {
-+ /* We ignore it */
-+ ignore_rest_of_line ();
-+ continue;
-+ }
-+ bump_line_counters ();
- s += 4;
-
- sb_new (&sbuf);
-@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
- continue;
- #endif
- input_line_pointer--;
-- /* Report unknown char as ignored. */
-+ /* Report unknown char as error. */
- demand_empty_rest_of_line ();
- }
-
-
---
-Andreas Schwab, SuSE Labs, schwab@suse.de
-SuSE Linux AG, MaxfeldstraÃe 5, 90409 NÃrnberg, Germany
-Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
-"And now for something completely different."
+++ /dev/null
---- binutils-2.15/configure.old 2004-07-21 21:36:47.000000000 -0700
-+++ binutils-2.15/configure 2004-07-21 21:37:08.000000000 -0700
-@@ -999,7 +999,7 @@
-
- # Some tools are only suitable for building in a "native" situation.
- # Remove these if host!=target.
--native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
-+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
-
- # Similarly, some are only suitable for cross toolchains.
- # Remove these if host=target.
---- binutils-2.15/configure.in.old 2004-07-21 21:37:19.000000000 -0700
-+++ binutils-2.15/configure.in 2004-07-21 21:37:34.000000000 -0700
-@@ -236,7 +236,7 @@
-
- # Some tools are only suitable for building in a "native" situation.
- # Remove these if host!=target.
--native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
-+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
-
- # Similarly, some are only suitable for cross toolchains.
- # Remove these if host=target.
+++ /dev/null
-binutils-2.15-psignal.patch
-binutils-skip-comments.patch
-cross-gprof.patch
-binutils-redefinition-mname.patch
-binutils-bfd-soname-mod.patch
--- /dev/null
+diff -uNr binutils-2.17.orig/bfd/bfd-in2.h binutils-2.17/bfd/bfd-in2.h
+--- binutils-2.17.orig/bfd/bfd-in2.h 2006-03-26 01:38:42.000000000 +0100
++++ binutils-2.17/bfd/bfd-in2.h 2006-10-21 13:53:23.000000000 +0200
+@@ -643,6 +643,12 @@
+ DYN_NO_NEEDED = 8
+ };
+
++enum notice_asneeded_action {
++ notice_as_needed,
++ notice_not_needed,
++ notice_needed
++};
++
+ extern bfd_boolean bfd_elf_record_link_assignment
+ (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
+ bfd_boolean);
+diff -uNr binutils-2.17.orig/bfd/bfd-in.h binutils-2.17/bfd/bfd-in.h
+--- binutils-2.17.orig/bfd/bfd-in.h 2006-03-16 13:20:15.000000000 +0100
++++ binutils-2.17/bfd/bfd-in.h 2006-10-21 13:53:23.000000000 +0200
+@@ -636,6 +636,12 @@
+ DYN_NO_NEEDED = 8
+ };
+
++enum notice_asneeded_action {
++ notice_as_needed,
++ notice_not_needed,
++ notice_needed
++};
++
+ extern bfd_boolean bfd_elf_record_link_assignment
+ (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
+ bfd_boolean);
+diff -uNr binutils-2.17.orig/bfd/ChangeLog binutils-2.17/bfd/ChangeLog
+--- binutils-2.17.orig/bfd/ChangeLog 2006-06-23 20:18:16.000000000 +0200
++++ binutils-2.17/bfd/ChangeLog 2006-10-21 13:53:23.000000000 +0200
+@@ -1,3 +1,25 @@
++2006-08-08 Nick Clifton <nickc@redhat.com>
++
++ PR binutils/2724
++ * coffcode.h (coff_new_section_hook): Only modify the section
++ symbol of sections which were created by the user.
++
++2006-07-19 Alan Modra <amodra@bigpond.net.au>
++
++ * bfd-in.h (enum notice_asneeded_action): Define.
++ * bfd-in2.h: Regenerate.
++ * elflink.c (elf_link_add_object_symbols): Call linker "notice"
++ function with NULL name for as-needed handling.
++
++2006-07-12 Matthew R. Dempsky <mrd@alkemio.org>
++
++ * cpu-m68k.c (bfd_m68k_compatible): Handle CPU32.
++
++2006-06-23 Daniel Jacobowitz <dan@codesourcery.com>
++
++ * Makefile.am: Clear RELEASE.
++ * Makefile.in: Regenerated.
++
+ 2006-06-23 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * configure.in: Update version to 2.17.
+diff -uNr binutils-2.17.orig/bfd/coffcode.h binutils-2.17/bfd/coffcode.h
+--- binutils-2.17.orig/bfd/coffcode.h 2005-10-25 19:40:09.000000000 +0200
++++ binutils-2.17/bfd/coffcode.h 2006-10-21 13:53:24.000000000 +0200
+@@ -1546,9 +1546,6 @@
+ static bfd_boolean
+ coff_new_section_hook (bfd * abfd, asection * section)
+ {
+- combined_entry_type *native;
+- bfd_size_type amt;
+-
+ section->alignment_power = COFF_DEFAULT_SECTION_ALIGNMENT_POWER;
+
+ #ifdef RS6000COFF_C
+@@ -1560,27 +1557,34 @@
+ section->alignment_power = bfd_xcoff_data_align_power (abfd);
+ #endif
+
+- /* Allocate aux records for section symbols, to store size and
+- related info.
+-
+- @@ The 10 is a guess at a plausible maximum number of aux entries
+- (but shouldn't be a constant). */
+- amt = sizeof (combined_entry_type) * 10;
+- native = bfd_zalloc (abfd, amt);
+- if (native == NULL)
+- return FALSE;
+-
+- /* We don't need to set up n_name, n_value, or n_scnum in the native
+- symbol information, since they'll be overridden by the BFD symbol
+- anyhow. However, we do need to set the type and storage class,
+- in case this symbol winds up getting written out. The value 0
+- for n_numaux is already correct. */
+-
+- native->u.syment.n_type = T_NULL;
+- native->u.syment.n_sclass = C_STAT;
++ /* PR binutils/2724: Only real sections have a symbol that
++ has the coff_symbol_type structure allocated for it. */
++ if (! bfd_is_const_section (section))
++ {
++ combined_entry_type *native;
++ bfd_size_type amt;
++
++ /* Allocate aux records for section symbols, to store size and
++ related info.
++
++ @@ The 10 is a guess at a plausible maximum number of aux entries
++ (but shouldn't be a constant). */
++ amt = sizeof (combined_entry_type) * 10;
++ native = bfd_zalloc (abfd, amt);
++ if (native == NULL)
++ return FALSE;
+
+- coffsymbol (section->symbol)->native = native;
++ /* We don't need to set up n_name, n_value, or n_scnum in the native
++ symbol information, since they'll be overridden by the BFD symbol
++ anyhow. However, we do need to set the type and storage class,
++ in case this symbol winds up getting written out. The value 0
++ for n_numaux is already correct. */
++ native->u.syment.n_type = T_NULL;
++ native->u.syment.n_sclass = C_STAT;
+
++ coffsymbol (section->symbol)->native = native;
++ }
++
+ coff_set_custom_section_alignment (abfd, section,
+ coff_section_alignment_table,
+ coff_section_alignment_table_size);
+diff -uNr binutils-2.17.orig/bfd/cpu-m68k.c binutils-2.17/bfd/cpu-m68k.c
+--- binutils-2.17.orig/bfd/cpu-m68k.c 2006-03-25 11:24:27.000000000 +0100
++++ binutils-2.17/bfd/cpu-m68k.c 2006-10-21 13:53:24.000000000 +0200
+@@ -202,6 +202,9 @@
+ if (a->mach <= bfd_mach_m68060 && b->mach <= bfd_mach_m68060)
+ /* Merge m68k machine. */
+ return a->mach > b->mach ? a : b;
++ else if (a->mach == bfd_mach_cpu32 && b->mach == bfd_mach_cpu32)
++ /* CPU32 is compatible with itself. */
++ return a;
+ else if (a->mach >= bfd_mach_mcf_isa_a_nodiv
+ && b->mach >= bfd_mach_mcf_isa_a_nodiv)
+ {
+diff -uNr binutils-2.17.orig/bfd/elflink.c binutils-2.17/bfd/elflink.c
+--- binutils-2.17.orig/bfd/elflink.c 2006-05-22 17:06:36.000000000 +0200
++++ binutils-2.17/bfd/elflink.c 2006-10-21 13:53:24.000000000 +0200
+@@ -3496,6 +3496,13 @@
+ if (alloc_mark == NULL)
+ goto error_free_vers;
+
++ /* Make a special call to the linker "notice" function to
++ tell it that we are about to handle an as-needed lib. */
++ if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
++ notice_as_needed))
++ return FALSE;
++
++
+ /* Clone the symbol table and sym hashes. Remember some
+ pointers into the symbol table, and dynamic symbol count. */
+ old_hash = (char *) old_tab + tabsize;
+@@ -4169,6 +4176,12 @@
+ }
+ }
+
++ /* Make a special call to the linker "notice" function to
++ tell it that symbols added for crefs may need to be removed. */
++ if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
++ notice_not_needed))
++ return FALSE;
++
+ free (old_tab);
+ objalloc_free_block ((struct objalloc *) htab->root.table.memory,
+ alloc_mark);
+@@ -4179,6 +4192,9 @@
+
+ if (old_tab != NULL)
+ {
++ if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
++ notice_needed))
++ return FALSE;
+ free (old_tab);
+ old_tab = NULL;
+ }
+diff -uNr binutils-2.17.orig/bfd/version.h binutils-2.17/bfd/version.h
+--- binutils-2.17.orig/bfd/version.h 2006-06-23 20:14:41.000000000 +0200
++++ binutils-2.17/bfd/version.h 2006-10-21 13:53:24.000000000 +0200
+@@ -1,3 +1,3 @@
+-#define BFD_VERSION_DATE 20060623
++#define BFD_VERSION_DATE 20061021
+ #define BFD_VERSION @bfd_version@
+ #define BFD_VERSION_STRING @bfd_version_string@
+diff -uNr binutils-2.17.orig/binutils/ChangeLog binutils-2.17/binutils/ChangeLog
+--- binutils-2.17.orig/binutils/ChangeLog 2006-06-12 15:05:03.000000000 +0200
++++ binutils-2.17/binutils/ChangeLog 2006-10-21 13:53:24.000000000 +0200
+@@ -1,3 +1,8 @@
++2006-08-15 Nick Clifton <nickc@redhat.com>
++
++ PR binutils/3039
++ * wrstabs.c (stab_tag_type): Initialize 'size'.
++
+ 2006-06-07 Joseph S. Myers <joseph@codesourcery.com>
+
+ * po/Make-in (pdf, ps): New dummy targets.
+diff -uNr binutils-2.17.orig/binutils/wrstabs.c binutils-2.17/binutils/wrstabs.c
+--- binutils-2.17.orig/binutils/wrstabs.c 2006-03-16 13:20:16.000000000 +0100
++++ binutils-2.17/binutils/wrstabs.c 2006-10-21 13:53:24.000000000 +0200
+@@ -1869,7 +1869,7 @@
+ {
+ struct stab_write_handle *info = (struct stab_write_handle *) p;
+ long index;
+- unsigned int size;
++ unsigned int size = 0;
+
+ index = stab_get_struct_index (info, name, id, kind, &size);
+ if (index < 0)
+diff -uNr binutils-2.17.orig/gas/ChangeLog binutils-2.17/gas/ChangeLog
+--- binutils-2.17.orig/gas/ChangeLog 2006-06-12 15:05:03.000000000 +0200
++++ binutils-2.17/gas/ChangeLog 2006-10-21 13:53:24.000000000 +0200
+@@ -1,3 +1,8 @@
++2006-07-19 Mat Hostetter <mat@lcs.mit.edu>
++
++ * symbols.c (report_op_error): Fix pasto. Don't use as_bad_where
++ when file and line unknown.
++
+ 2006-06-07 Joseph S. Myers <joseph@codesourcery.com>
+
+ * po/Make-in (pdf, ps): New dummy targets.
+diff -uNr binutils-2.17.orig/gas/symbols.c binutils-2.17/gas/symbols.c
+--- binutils-2.17.orig/gas/symbols.c 2006-01-09 18:14:40.000000000 +0100
++++ binutils-2.17/gas/symbols.c 2006-10-21 13:53:24.000000000 +0200
+@@ -928,13 +928,11 @@
+ && seg_right != undefined_section)
+ {
+ if (right)
+- as_bad_where (file, line,
+- _("invalid sections for operation on `%s' and `%s' setting `%s'"),
+- S_GET_NAME (left), S_GET_NAME (right), S_GET_NAME (symp));
++ as_bad (_("invalid sections for operation on `%s' and `%s' setting `%s'"),
++ S_GET_NAME (left), S_GET_NAME (right), S_GET_NAME (symp));
+ else
+- as_bad_where (file, line,
+- _("invalid section for operation on `%s' setting `%s'"),
+- S_GET_NAME (left), S_GET_NAME (symp));
++ as_bad (_("invalid section for operation on `%s' setting `%s'"),
++ S_GET_NAME (left), S_GET_NAME (symp));
+ }
+ }
+ }
+diff -uNr binutils-2.17.orig/ld/ChangeLog binutils-2.17/ld/ChangeLog
+--- binutils-2.17.orig/ld/ChangeLog 2006-06-12 15:07:28.000000000 +0200
++++ binutils-2.17/ld/ChangeLog 2006-10-21 13:53:24.000000000 +0200
+@@ -1,3 +1,20 @@
++2006-07-19 Alan Modra <amodra@bigpond.net.au>
++
++ * ld.h (handle_asneeded_cref): Declare.
++ * ldcref.c: Include objalloc.h.
++ (old_table, old_tab, alloc_mark): New variables.
++ (tabsize, entsize, refsize, old_symcount): Likewise.
++ (add_cref): Use bfd_hash_allocate for refs.
++ (handle_asneeded_cref): New function.
++ * ldmain.c (notice): Call handle_asneeded_cref for NULL name.
++
++2006-07-04 Daniel Jacobowitz <dan@codesourcery.com>
++
++ Backport:
++ 2006-05-19 Alan Modra <amodra@bigpond.net.au>
++ * ldlang.c (lang_size_sections_1): Don't check mem regions for
++ os->ignored sections.
++
+ 2006-06-12 Fred Fish <fnf@specifix.com>
+
+ * emulparams/elf32bmip.sh (OTHER_SECTIONS): Keep the
+diff -uNr binutils-2.17.orig/ld/configure.tgt binutils-2.17/ld/configure.tgt
+--- binutils-2.17.orig/ld/configure.tgt 2006-04-05 14:41:57.000000000 +0200
++++ binutils-2.17/ld/configure.tgt 2006-10-21 13:53:24.000000000 +0200
+@@ -83,7 +83,8 @@
+ avr-*-*) targ_emul=avr2
+ targ_extra_emuls="avr1 avr3 avr4 avr5"
+ ;;
+-bfin-*-elf) targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" ;;
++bfin-*-elf | bfin-*-rtems*)
++ targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" ;;
+ bfin-*-uclinux*) targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" ;;
+ cr16c-*-elf*) targ_emul=elf32cr16c
+ ;;
+diff -uNr binutils-2.17.orig/ld/emulparams/h8300elf.sh binutils-2.17/ld/emulparams/h8300elf.sh
+--- binutils-2.17.orig/ld/emulparams/h8300elf.sh 2005-12-22 18:43:34.000000000 +0100
++++ binutils-2.17/ld/emulparams/h8300elf.sh 2006-10-21 13:53:24.000000000 +0200
+@@ -17,7 +17,7 @@
+ TINY_DATA_SECTION=".tinydata 0xff8000 :
+ {
+ *(.tinydata)
+- _tinydata = .;
++ ${RELOCATING+ _tinydata = .; }
+ }"
+ TINY_BSS_SECTION=".tinybss : AT (_tinydata)
+ {
+diff -uNr binutils-2.17.orig/ld/ldcref.c binutils-2.17/ld/ldcref.c
+--- binutils-2.17.orig/ld/ldcref.c 2006-03-16 13:20:16.000000000 +0100
++++ binutils-2.17/ld/ldcref.c 2006-10-21 13:53:24.000000000 +0200
+@@ -27,6 +27,7 @@
+ #include "sysdep.h"
+ #include "bfdlink.h"
+ #include "libiberty.h"
++#include "objalloc.h"
+
+ #include "ld.h"
+ #include "ldmain.h"
+@@ -101,6 +102,15 @@
+
+ static size_t cref_symcount;
+
++/* Used to take a snapshot of the cref hash table when starting to
++ add syms from an as-needed library. */
++static struct bfd_hash_entry **old_table;
++static unsigned int old_size;
++static void *old_tab;
++static void *alloc_mark;
++static size_t tabsize, entsize, refsize;
++static size_t old_symcount;
++
+ /* Create an entry in a cref hash table. */
+
+ static struct bfd_hash_entry *
+@@ -165,7 +175,9 @@
+
+ if (r == NULL)
+ {
+- r = xmalloc (sizeof *r);
++ r = bfd_hash_allocate (&cref_table.root, sizeof *r);
++ if (r == NULL)
++ einfo (_("%X%P: cref alloc failed: %E\n"));
+ r->next = h->refs;
+ h->refs = r;
+ r->abfd = abfd;
+@@ -182,6 +194,123 @@
+ r->def = TRUE;
+ }
+
++/* Called before loading an as-needed library to take a snapshot of
++ the cref hash table, and after we have loaded or found that the
++ library was not needed. */
++
++bfd_boolean
++handle_asneeded_cref (bfd *abfd ATTRIBUTE_UNUSED,
++ enum notice_asneeded_action act)
++{
++ unsigned int i;
++
++ if (!cref_initialized)
++ return TRUE;
++
++ if (act == notice_as_needed)
++ {
++ char *old_ent, *old_ref;
++
++ for (i = 0; i < cref_table.root.size; i++)
++ {
++ struct bfd_hash_entry *p;
++ struct cref_hash_entry *c;
++ struct cref_ref *r;
++
++ for (p = cref_table.root.table[i]; p != NULL; p = p->next)
++ {
++ entsize += cref_table.root.entsize;
++ c = (struct cref_hash_entry *) p;
++ for (r = c->refs; r != NULL; r = r->next)
++ refsize += sizeof (struct cref_hash_entry);
++ }
++ }
++
++ tabsize = cref_table.root.size * sizeof (struct bfd_hash_entry *);
++ old_tab = xmalloc (tabsize + entsize + refsize);
++
++ alloc_mark = bfd_hash_allocate (&cref_table.root, 1);
++ if (alloc_mark == NULL)
++ return FALSE;
++
++ memcpy (old_tab, cref_table.root.table, tabsize);
++ old_ent = (char *) old_tab + tabsize;
++ old_ref = (char *) old_ent + entsize;
++ old_table = cref_table.root.table;
++ old_size = cref_table.root.size;
++ old_symcount = cref_symcount;
++
++ for (i = 0; i < cref_table.root.size; i++)
++ {
++ struct bfd_hash_entry *p;
++ struct cref_hash_entry *c;
++ struct cref_ref *r;
++
++ for (p = cref_table.root.table[i]; p != NULL; p = p->next)
++ {
++ memcpy (old_ent, p, cref_table.root.entsize);
++ old_ent = (char *) old_ent + cref_table.root.entsize;
++ c = (struct cref_hash_entry *) p;
++ for (r = c->refs; r != NULL; r = r->next)
++ {
++ memcpy (old_ref, r, sizeof (struct cref_hash_entry));
++ old_ref = (char *) old_ref + sizeof (struct cref_hash_entry);
++ }
++ }
++ }
++ return TRUE;
++ }
++
++ if (act == notice_not_needed)
++ {
++ char *old_ent, *old_ref;
++
++ if (old_tab == NULL)
++ {
++ /* The only way old_tab can be NULL is if the cref hash table
++ had not been initialised when notice_as_needed. */
++ bfd_hash_table_free (&cref_table.root);
++ cref_initialized = FALSE;
++ return TRUE;
++ }
++
++ old_ent = (char *) old_tab + tabsize;
++ old_ref = (char *) old_ent + entsize;
++ cref_table.root.table = old_table;
++ cref_table.root.size = old_size;
++ memcpy (cref_table.root.table, old_tab, tabsize);
++ cref_symcount = old_symcount;
++
++ for (i = 0; i < cref_table.root.size; i++)
++ {
++ struct bfd_hash_entry *p;
++ struct cref_hash_entry *c;
++ struct cref_ref *r;
++
++ for (p = cref_table.root.table[i]; p != NULL; p = p->next)
++ {
++ memcpy (p, old_ent, cref_table.root.entsize);
++ old_ent = (char *) old_ent + cref_table.root.entsize;
++ c = (struct cref_hash_entry *) p;
++ for (r = c->refs; r != NULL; r = r->next)
++ {
++ memcpy (r, old_ref, sizeof (struct cref_hash_entry));
++ old_ref = (char *) old_ref + sizeof (struct cref_hash_entry);
++ }
++ }
++ }
++
++ objalloc_free_block ((struct objalloc *) cref_table.root.memory,
++ alloc_mark);
++ }
++ else if (act != notice_needed)
++ return FALSE;
++
++ free (old_tab);
++ old_tab = NULL;
++ return TRUE;
++}
++
+ /* Copy the addresses of the hash table entries into an array. This
+ is called via cref_hash_traverse. We also fill in the demangled
+ name. */
+diff -uNr binutils-2.17.orig/ld/ld.h binutils-2.17/ld/ld.h
+--- binutils-2.17.orig/ld/ld.h 2005-09-30 13:42:04.000000000 +0200
++++ binutils-2.17/ld/ld.h 2006-10-21 13:53:24.000000000 +0200
+@@ -1,6 +1,6 @@
+ /* ld.h -- general linker header file
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+- 2001, 2002, 2003, 2004, 2005
++ 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This file is part of GLD, the Gnu Linker.
+@@ -282,6 +282,7 @@
+
+ extern int yyparse (void);
+ extern void add_cref (const char *, bfd *, asection *, bfd_vma);
++extern bfd_boolean handle_asneeded_cref (bfd *, enum notice_asneeded_action);
+ extern void output_cref (FILE *);
+ extern void check_nocrossrefs (void);
+ extern void ld_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
+diff -uNr binutils-2.17.orig/ld/ldlang.c binutils-2.17/ld/ldlang.c
+--- binutils-2.17.orig/ld/ldlang.c 2006-06-12 15:05:04.000000000 +0200
++++ binutils-2.17/ld/ldlang.c 2006-10-21 13:53:24.000000000 +0200
+@@ -4207,7 +4207,8 @@
+ /* If a loadable section is using the default memory
+ region, and some non default memory regions were
+ defined, issue an error message. */
+- if (!IGNORE_SECTION (os->bfd_section)
++ if (!os->ignored
++ && !IGNORE_SECTION (os->bfd_section)
+ && ! link_info.relocatable
+ && check_regions
+ && strcmp (os->region->name,
+diff -uNr binutils-2.17.orig/ld/ldmain.c binutils-2.17/ld/ldmain.c
+--- binutils-2.17.orig/ld/ldmain.c 2006-04-06 20:52:45.000000000 +0200
++++ binutils-2.17/ld/ldmain.c 2006-10-21 13:53:24.000000000 +0200
+@@ -1511,6 +1511,13 @@
+ asection *section,
+ bfd_vma value)
+ {
++ if (name == NULL)
++ {
++ if (command_line.cref || nocrossref_list != NULL)
++ return handle_asneeded_cref (abfd, value);
++ return TRUE;
++ }
++
+ if (! info->notice_all
+ || (info->notice_hash != NULL
+ && bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != NULL))
+diff -uNr binutils-2.17.orig/ld/testsuite/ChangeLog binutils-2.17/ld/testsuite/ChangeLog
+--- binutils-2.17.orig/ld/testsuite/ChangeLog 2006-06-12 15:44:33.000000000 +0200
++++ binutils-2.17/ld/testsuite/ChangeLog 2006-10-21 13:53:24.000000000 +0200
+@@ -1,3 +1,17 @@
++2006-07-12 Richard Sandiford <richard@codesourcery.com>
++
++ * ld-m68k/merge-ok-1c.d: New test.
++ * ld-m68k/m68k.exp: Run it.
++
++2006-07-04 Daniel Jacobowitz <dan@codesourcery.com>
++
++ Backport:
++ 2006-05-19 Alan Modra <amodra@bigpond.net.au>
++ * ld-scripts/empty-orphan.d: Update again.
++
++ * ld-scripts/empty-orphan.t: Discard .reginfo.
++ * ld-scripts/empty-orphan.d: Update.
++
+ 2006-06-12 Daniel Jacobowitz <dan@codesourcery.com>
+
+ Backport:
+diff -uNr binutils-2.17.orig/ld/testsuite/ld-m68k/m68k.exp binutils-2.17/ld/testsuite/ld-m68k/m68k.exp
+--- binutils-2.17.orig/ld/testsuite/ld-m68k/m68k.exp 2006-03-25 11:24:27.000000000 +0100
++++ binutils-2.17/ld/testsuite/ld-m68k/m68k.exp 2006-10-21 13:53:24.000000000 +0200
+@@ -53,3 +53,4 @@
+ run_dump_test "merge-error-1e"
+ run_dump_test "merge-ok-1a"
+ run_dump_test "merge-ok-1b"
++run_dump_test "merge-ok-1c"
+diff -uNr binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.d binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.d
+--- binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.d 2005-03-17 17:20:39.000000000 +0100
++++ binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.d 2006-10-21 13:53:24.000000000 +0200
+@@ -1,3 +1,6 @@
+ #source: empty-orphan.s
+ #ld: -T empty-orphan.t
+-#error: no memory region specified for loadable section
++#readelf: -l --wide
++#...
++ +LOAD +[x0-9a-f]+ [x0]+70000000 [x0]+70000000 [x0]+(2|4|8|10|20|40|80) .*
++#pass
+diff -uNr binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.t binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.t
+--- binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.t 2005-03-17 17:20:39.000000000 +0100
++++ binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.t 2006-10-21 13:53:24.000000000 +0200
+@@ -17,5 +17,6 @@
+ .text : { *(.text) } > text_mem : text_phdr
+ .data : { *(.data) } > data_mem : data_phdr
+ .bss : { *(.bss) } > data_mem : data_phdr
++ /DISCARD/ : { *(.reginfo) }
+ /* .orphan_data is an orphan */
+ }
--- /dev/null
+binutils-2.17-rtems4.8-20061021.diff
--- /dev/null
+diff -uNr gcc-4.1.2.orig/gcc/config/arm/rtems-elf.h gcc-4.1.2/gcc/config/arm/rtems-elf.h
+--- gcc-4.1.2.orig/gcc/config/arm/rtems-elf.h 2005-11-22 00:28:29.000000000 +0100
++++ gcc-4.1.2/gcc/config/arm/rtems-elf.h 2007-04-05 04:50:02.000000000 +0200
+@@ -27,6 +27,7 @@
+ #define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__rtems__"); \
++ builtin_define ("__USE_INIT_FINI__"); \
+ builtin_assert ("system=rtems"); \
+ } while (0)
+
+diff -uNr gcc-4.1.2.orig/gcc/config/c4x/rtems.h gcc-4.1.2/gcc/config/c4x/rtems.h
+--- gcc-4.1.2.orig/gcc/config/c4x/rtems.h 2005-06-25 03:22:41.000000000 +0200
++++ gcc-4.1.2/gcc/config/c4x/rtems.h 2007-04-05 04:50:02.000000000 +0200
+@@ -24,6 +24,5 @@
+ #define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__rtems__"); \
+- builtin_define ("__USE_INIT_FINI__"); \
+ builtin_assert ("system=rtems"); \
+ } while (0)
+diff -uNr gcc-4.1.2.orig/gcc/config/mips/elf.h gcc-4.1.2/gcc/config/mips/elf.h
+--- gcc-4.1.2.orig/gcc/config/mips/elf.h 2005-07-09 10:46:34.000000000 +0200
++++ gcc-4.1.2/gcc/config/mips/elf.h 2007-04-05 04:50:03.000000000 +0200
+@@ -48,5 +48,3 @@
+
+ #undef ENDFILE_SPEC
+ #define ENDFILE_SPEC "crtend%O%s crtn%O%s"
+-
+-#define NO_IMPLICIT_EXTERN_C 1
+diff -uNr gcc-4.1.2.orig/gcc/config/mips/mips.h gcc-4.1.2/gcc/config/mips/mips.h
+--- gcc-4.1.2.orig/gcc/config/mips/mips.h 2006-02-17 22:38:59.000000000 +0100
++++ gcc-4.1.2/gcc/config/mips/mips.h 2007-04-05 04:49:10.000000000 +0200
+@@ -450,6 +450,8 @@
+ #endif
+ #endif /* IN_LIBGCC2 */
+
++#define TARGET_LIBGCC_SDATA_SECTION ".sdata"
++
+ #ifndef MULTILIB_ENDIAN_DEFAULT
+ #if TARGET_ENDIAN_DEFAULT == 0
+ #define MULTILIB_ENDIAN_DEFAULT "EL"
+@@ -2712,7 +2714,6 @@
+ /* Define the strings to put out for each section in the object file. */
+ #define TEXT_SECTION_ASM_OP "\t.text" /* instructions */
+ #define DATA_SECTION_ASM_OP "\t.data" /* large data */
+-#define SDATA_SECTION_ASM_OP "\t.sdata" /* small data */
+
+ #undef READONLY_DATA_SECTION_ASM_OP
+ #define READONLY_DATA_SECTION_ASM_OP "\t.rdata" /* read-only data */
+diff -uNr gcc-4.1.2.orig/gcc/config.gcc gcc-4.1.2/gcc/config.gcc
+--- gcc-4.1.2.orig/gcc/config.gcc 2006-10-16 01:12:23.000000000 +0200
++++ gcc-4.1.2/gcc/config.gcc 2007-04-05 04:50:03.000000000 +0200
+@@ -761,6 +761,11 @@
+ tmake_file=bfin/t-bfin-elf
+ use_collect2=no
+ ;;
++bfin*-rtems*)
++ tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/rtems.h rtems.h"
++ tmake_file=bfin/t-bfin-elf
++ use_collect2=no
++ ;;
+ bfin*-*)
+ tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h"
+ tmake_file=bfin/t-bfin
+@@ -1560,7 +1565,7 @@
+ tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
+ use_fixproto=yes
+ ;;
+-mips*-*-rtems*)
++mips-*-rtems*)
+ tm_file="elfos.h ${tm_file} mips/elf.h mips/rtems.h rtems.h"
+ tmake_file="mips/t-elf t-rtems mips/t-rtems"
+ ;;
+diff -uNr gcc-4.1.2.orig/gcc/crtstuff.c gcc-4.1.2/gcc/crtstuff.c
+--- gcc-4.1.2.orig/gcc/crtstuff.c 2005-11-15 02:21:29.000000000 +0100
++++ gcc-4.1.2/gcc/crtstuff.c 2007-04-05 04:49:10.000000000 +0200
+@@ -225,6 +225,9 @@
+ in one DSO or the main program is not used in another object. The
+ dynamic linker takes care of this. */
+
++#ifdef TARGET_LIBGCC_SDATA_SECTION
++extern void *__dso_handle __attribute__ ((__section__ (TARGET_LIBGCC_SDATA_SECTION)));
++#endif
+ #ifdef HAVE_GAS_HIDDEN
+ extern void *__dso_handle __attribute__ ((__visibility__ ("hidden")));
+ #endif
+diff -uNr gcc-4.1.2.orig/Makefile.in gcc-4.1.2/Makefile.in
+--- gcc-4.1.2.orig/Makefile.in 2006-04-04 23:03:05.000000000 +0200
++++ gcc-4.1.2/Makefile.in 2007-04-05 04:50:03.000000000 +0200
+@@ -329,9 +329,9 @@
+ # CFLAGS will be just -g. We want to ensure that TARGET libraries
+ # (which we know are built with gcc) are built with optimizations so
+ # prepend -O2 when setting CFLAGS_FOR_TARGET.
+-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
++CFLAGS_FOR_TARGET = $(strip -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
+ SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
+-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
++CXXFLAGS_FOR_TARGET = $(strip $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET))
+ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
+ LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
+ LDFLAGS_FOR_TARGET =
--- /dev/null
+gcc-core-4.1.2-rtems4.8-20070405.diff
--- /dev/null
+diff -uNr newlib-1.15.0.orig/newlib/libc/include/inttypes.h newlib-1.15.0/newlib/libc/include/inttypes.h
+--- newlib-1.15.0.orig/newlib/libc/include/inttypes.h 2005-12-16 20:03:12.000000000 +0100
++++ newlib-1.15.0/newlib/libc/include/inttypes.h 2007-04-13 10:41:47.000000000 +0200
+@@ -242,9 +242,12 @@
+ #define SCNxMAX __SCNMAX(x)
+
+ /* ptr types */
+-#if __have_longlong64
+-#define __PRIPTR(x) __STRINGIFY(ll##x)
+-#define __SCNPTR(x) __STRINGIFY(ll##x)
++#if __ptrint_t_long_defined
++#define __PRIPTR(x) __STRINGIFY(l##x)
++#define __SCNPTR(x) __STRINGIFY(l##x)
++#elif __ptrint_t_int_defined
++#define __PRIPTR(x) __STRINGIFY(x)
++#define __SCNPTR(x) __STRINGIFY(x)
+ #elif __have_long64
+ #define __PRIPTR(x) __STRINGIFY(l##x)
+ #define __SCNPTR(x) __STRINGIFY(l##x)
+diff -uNr newlib-1.15.0.orig/newlib/libc/include/machine/setjmp.h newlib-1.15.0/newlib/libc/include/machine/setjmp.h
+--- newlib-1.15.0.orig/newlib/libc/include/machine/setjmp.h 2006-12-18 17:48:03.000000000 +0100
++++ newlib-1.15.0/newlib/libc/include/machine/setjmp.h 2007-04-13 10:41:47.000000000 +0200
+@@ -27,7 +27,7 @@
+
+ /* necv70 was 9 as well. */
+
+-#ifdef __mc68000__
++#if defined(__m68k__) || defined(__mc68000__)
+ /*
+ * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6,
+ * fp2-fp7 for 68881.
+diff -uNr newlib-1.15.0.orig/newlib/libc/include/stdint.h newlib-1.15.0/newlib/libc/include/stdint.h
+--- newlib-1.15.0.orig/newlib/libc/include/stdint.h 2006-08-16 23:39:43.000000000 +0200
++++ newlib-1.15.0/newlib/libc/include/stdint.h 2007-04-13 10:41:47.000000000 +0200
+@@ -393,6 +393,9 @@
+ #define UINTMAX_C(x) x##UL
+ #endif
+
++#ifdef __rtems__
++#include <machine/stdint.h>
++#endif
+
+ #ifdef __cplusplus
+ }
+diff -uNr newlib-1.15.0.orig/newlib/libc/include/sys/errno.h newlib-1.15.0/newlib/libc/include/sys/errno.h
+--- newlib-1.15.0.orig/newlib/libc/include/sys/errno.h 2002-09-24 16:10:12.000000000 +0200
++++ newlib-1.15.0/newlib/libc/include/sys/errno.h 2007-04-13 10:41:47.000000000 +0200
+@@ -148,6 +148,7 @@
+ #define ECASECLASH 137 /* Filename exists with different case */
+ #define EILSEQ 138
+ #define EOVERFLOW 139 /* Value too large for defined data type */
++#define ECANCELED 140 /* Operation canceled. */
+
+ /* From cygwin32. */
+ #define EWOULDBLOCK EAGAIN /* Operation would block */
+diff -uNr newlib-1.15.0.orig/newlib/libc/include/sys/features.h newlib-1.15.0/newlib/libc/include/sys/features.h
+--- newlib-1.15.0.orig/newlib/libc/include/sys/features.h 2006-09-14 00:09:27.000000000 +0200
++++ newlib-1.15.0/newlib/libc/include/sys/features.h 2007-04-13 10:41:47.000000000 +0200
+@@ -38,6 +38,7 @@
+ #define _POSIX_MEMLOCK_RANGE 1
+ #define _POSIX_MEMORY_PROTECTION 1
+ #define _POSIX_MESSAGE_PASSING 1
++#define _POSIX_MONOTONIC_CLOCK 200112L
+ #define _POSIX_PRIORITIZED_IO 1
+ #define _POSIX_PRIORITY_SCHEDULING 1
+ #define _POSIX_REALTIME_SIGNALS 1
+@@ -81,17 +82,89 @@
+ #endif
+
+ #ifdef __CYGWIN__
+-# define _POSIX_JOB_CONTROL 1
+-# define _POSIX_SAVED_IDS 0
+-# define _POSIX_VERSION 199009L
+-# define _POSIX_THREADS 1
+-# define _POSIX_THREAD_PROCESS_SHARED 1
+-# define _POSIX_THREAD_SAFE_FUNCTIONS 1
+-# define _POSIX_THREAD_PRIORITY_SCHEDULING 1
+-# define _POSIX_THREAD_ATTR_STACKSIZE 1
+-# define _POSIX_SEMAPHORES 1
+-# define _POSIX_TIMERS 1
+-# define _POSIX_MEMLOCK_RANGE 1
++#define _POSIX_VERSION 200112L
++#define _POSIX2_VERSION 200112L
++#define _XOPEN_VERSION 600
++
++#define _POSIX_ADVISORY_INFO 200112L
++/* #define _POSIX_ASYNCHRONOUS_IO -1 */
++/* #define _POSIX_BARRIERS -1 */
++#define _POSIX_CHOWN_RESTRICTED 1
++/* #define _POSIX_CLOCK_SELECTION -1 */
++/* #define _POSIX_CPUTIME -1 */
++#define _POSIX_FSYNC 200112L
++#define _POSIX_IPV6 200112L
++#define _POSIX_JOB_CONTROL 1
++#define _POSIX_MAPPED_FILES 200112L
++/* #define _POSIX_MEMLOCK -1 */
++#define _POSIX_MEMLOCK_RANGE 200112L
++#define _POSIX_MEMORY_PROTECTION 200112L
++/* #define _POSIX_MESSAGE_PASSING -1 */
++/* #define _POSIX_MONOTONIC_CLOCK -1 */
++#define _POSIX_NO_TRUNC 1
++/* #define _POSIX_PRIORITIZED_IO -1 */
++#define _POSIX_PRIORITY_SCHEDULING 200112L
++#define _POSIX_RAW_SOCKETS 200112L
++#define _POSIX_READER_WRITER_LOCKS 200112L
++#define _POSIX_REALTIME_SIGNALS 200112L
++#define _POSIX_REGEXP 1
++#define _POSIX_SAVED_IDS 1
++#define _POSIX_SEMAPHORES 1
++/* #define _POSIX_SHARED_MEMORY_OBJECTS -1 */
++#define _POSIX_SHELL 1
++/* #define _POSIX_SPAWN -1 */
++/* #define _POSIX_SPIN_LOCKS -1 */
++/* #define _POSIX_SPORADIC_SERVER -1 */
++#define _POSIX_SYNCHRONIZED_IO 200112L
++/* #define _POSIX_THREAD_ATTR_STACKADDR -1 */
++#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
++/* #define _POSIX_THREAD_CPUTIME -1 */
++/* #define _POSIX_THREAD_PRIO_INHERIT -1 */
++/* #define _POSIX_THREAD_PRIO_PROTECT -1 */
++#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
++#define _POSIX_THREAD_PROCESS_SHARED 200112L
++#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
++/* #define _POSIX_THREAD_SPORADIC_SERVER -1 */
++#define _POSIX_THREADS 200112L
++/* #define _POSIX_TIMEOUTS -1 */
++#define _POSIX_TIMERS 1
++/* #define _POSIX_TRACE -1 */
++/* #define _POSIX_TRACE_EVENT_FILTER -1 */
++/* #define _POSIX_TRACE_INHERIT -1 */
++/* #define _POSIX_TRACE_LOG -1 */
++/* #define _POSIX_TYPED_MEMORY_OBJECTS -1 */
++#define _POSIX_VDISABLE '\0'
++#define _POSIX2_C_BIND 200112L
++#define _POSIX2_C_DEV 200112L
++#define _POSIX2_CHAR_TERM 200112L
++/* #define _POSIX2_FORT_DEV -1 */
++/* #define _POSIX2_FORT_RUN -1 */
++/* #define _POSIX2_LOCALEDEF -1 */
++/* #define _POSIX2_PBS -1 */
++/* #define _POSIX2_PBS_ACCOUNTING -1 */
++/* #define _POSIX2_PBS_CHECKPOINT -1 */
++/* #define _POSIX2_PBS_LOCATE -1 */
++/* #define _POSIX2_PBS_MESSAGE -1 */
++/* #define _POSIX2_PBS_TRACK -1 */
++#define _POSIX2_SW_DEV 200112L
++#define _POSIX2_UPE 200112L
++/* #define _POSIX_V6_ILP32_OFF32 -1 */
++#define _XBS5_ILP32_OFF32 _POSIX_V6_ILP32_OFF32
++#define _POSIX_V6_ILP32_OFFBIG 1
++#define _XBS5_ILP32_OFFBIG _POSIX_V6_ILP32_OFFBIG
++/* #define _POSIX_V6_LP64_OFF64 -1 */
++#define _XBS5_LP64_OFF64 _POSIX_V6_LP64_OFF64
++/* #define _POSIX_V6_LPBIG_OFFBIG -1 */
++#define _XBS5_LPBIG_OFFBIG _POSIX_V6_LPBIG_OFFBIG
++#define _XOPEN_CRYPT 1
++#define _XOPEN_ENH_I18N 1
++/* #define _XOPEN_LEGACY -1 */
++/* #define _XOPEN_REALTIME -1 */
++/* #define _XOPEN_REALTIME_THREADS -1 */
++#define _XOPEN_SHM 1
++/* #define _XOPEN_STREAMS -1 */
++/* #define _XOPEN_UNIX -1 */
++
+ #endif
+
+ #ifdef __cplusplus
+diff -uNr newlib-1.15.0.orig/newlib/libc/include/sys/_types.h newlib-1.15.0/newlib/libc/include/sys/_types.h
+--- newlib-1.15.0.orig/newlib/libc/include/sys/_types.h 2004-06-11 22:37:09.000000000 +0200
++++ newlib-1.15.0/newlib/libc/include/sys/_types.h 2007-04-13 10:41:47.000000000 +0200
+@@ -39,4 +39,7 @@
+ /* Iconv descriptor type */
+ typedef void *_iconv_t;
+
++typedef long * __intptr_t;
++typedef unsigned long* __uintptr_t;
++
+ #endif /* _SYS__TYPES_H */
+diff -uNr newlib-1.15.0.orig/newlib/libc/include/sys/unistd.h newlib-1.15.0/newlib/libc/include/sys/unistd.h
+--- newlib-1.15.0.orig/newlib/libc/include/sys/unistd.h 2006-11-07 16:33:40.000000000 +0100
++++ newlib-1.15.0/newlib/libc/include/sys/unistd.h 2007-04-13 10:41:47.000000000 +0200
+@@ -200,7 +200,7 @@
+ int _EXFUN(getdtablesize, (void));
+ int _EXFUN(setdtablesize, (int));
+ useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval));
+-unsigned _EXFUN(usleep, (unsigned int __useconds));
++int _EXFUN(usleep, (useconds_t __useconds));
+ #if !(defined (_WINSOCK_H) || defined (__USE_W32_SOCKETS))
+ /* winsock[2].h defines as __stdcall, and with int as 2nd arg */
+ int _EXFUN(gethostname, (char *__name, size_t __len));
+@@ -212,7 +212,7 @@
+ int _EXFUN(sync, (void));
+ #endif
+ #endif
+-int _EXFUN(readlink, (const char *__path, char *__buf, int __buflen));
++ssize_t _EXFUN(readlink, (const char *__path, char *__buf, size_t __buflen));
+ int _EXFUN(symlink, (const char *__name1, const char *__name2));
+
+ #define F_OK 0
+@@ -231,63 +231,55 @@
+ #define STDERR_FILENO 2 /* standard error file descriptor */
+
+ /*
+- * 4.8.1 Get Configurable System Variables, P1003.1b-1993, p. 96
+- *
+- * NOTE: Table 4-2, Configurable System Variables, p. 96
+- */
+-
+-#define _SC_ARG_MAX 0
+-#define _SC_CHILD_MAX 1
+-#define _SC_CLK_TCK 2
+-#define _SC_NGROUPS_MAX 3
+-#define _SC_OPEN_MAX 4
+- /* no _SC_STREAM_MAX */
+-#define _SC_JOB_CONTROL 5
+-#define _SC_SAVED_IDS 6
+-#define _SC_VERSION 7
+-#define _SC_PAGESIZE 8
+-/* CYGWIN-specific values .. do not touch */
+-#define _SC_NPROCESSORS_CONF 9
+-#define _SC_NPROCESSORS_ONLN 10
+-#define _SC_PHYS_PAGES 11
+-#define _SC_AVPHYS_PAGES 12
+-/* end of CYGWIN-specific values */
+-#define _SC_MQ_OPEN_MAX 13
+-#define _SC_MQ_PRIO_MAX 14
+-#define _SC_RTSIG_MAX 15
+-#define _SC_SEM_NSEMS_MAX 16
+-#define _SC_SEM_VALUE_MAX 17
+-#define _SC_SIGQUEUE_MAX 18
+-#define _SC_TIMER_MAX 19
+-#define _SC_TZNAME_MAX 20
+-
+-#define _SC_ASYNCHRONOUS_IO 21
+-#define _SC_FSYNC 22
+-#define _SC_MAPPED_FILES 23
+-#define _SC_MEMLOCK 24
+-#define _SC_MEMLOCK_RANGE 25
+-#define _SC_MEMORY_PROTECTION 26
+-#define _SC_MESSAGE_PASSING 27
+-#define _SC_PRIORITIZED_IO 28
+-#define _SC_REALTIME_SIGNALS 29
+-#define _SC_SEMAPHORES 30
+-#define _SC_SHARED_MEMORY_OBJECTS 31
+-#define _SC_SYNCHRONIZED_IO 32
+-#define _SC_TIMERS 33
+-#define _SC_AIO_LISTIO_MAX 34
+-#define _SC_AIO_MAX 35
+-#define _SC_AIO_PRIO_DELTA_MAX 36
+-#define _SC_DELAYTIMER_MAX 37
+-
+-/*
+- * P1003.1c/D10, p. 52 adds the following.
++ * sysconf values per IEEE Std 1003.1, 2004 Edition
+ */
+
++#define _SC_ARG_MAX 0
++#define _SC_CHILD_MAX 1
++#define _SC_CLK_TCK 2
++#define _SC_NGROUPS_MAX 3
++#define _SC_OPEN_MAX 4
++#define _SC_JOB_CONTROL 5
++#define _SC_SAVED_IDS 6
++#define _SC_VERSION 7
++#define _SC_PAGESIZE 8
++#define _SC_PAGE_SIZE _SC_PAGESIZE
++/* These are non-POSIX values we accidentally introduced in 2000 without
++ guarding them. Keeping them unguarded for backward compatibility. */
++#define _SC_NPROCESSORS_CONF 9
++#define _SC_NPROCESSORS_ONLN 10
++#define _SC_PHYS_PAGES 11
++#define _SC_AVPHYS_PAGES 12
++/* End of non-POSIX values. */
++#define _SC_MQ_OPEN_MAX 13
++#define _SC_MQ_PRIO_MAX 14
++#define _SC_RTSIG_MAX 15
++#define _SC_SEM_NSEMS_MAX 16
++#define _SC_SEM_VALUE_MAX 17
++#define _SC_SIGQUEUE_MAX 18
++#define _SC_TIMER_MAX 19
++#define _SC_TZNAME_MAX 20
++#define _SC_ASYNCHRONOUS_IO 21
++#define _SC_FSYNC 22
++#define _SC_MAPPED_FILES 23
++#define _SC_MEMLOCK 24
++#define _SC_MEMLOCK_RANGE 25
++#define _SC_MEMORY_PROTECTION 26
++#define _SC_MESSAGE_PASSING 27
++#define _SC_PRIORITIZED_IO 28
++#define _SC_REALTIME_SIGNALS 29
++#define _SC_SEMAPHORES 30
++#define _SC_SHARED_MEMORY_OBJECTS 31
++#define _SC_SYNCHRONIZED_IO 32
++#define _SC_TIMERS 33
++#define _SC_AIO_LISTIO_MAX 34
++#define _SC_AIO_MAX 35
++#define _SC_AIO_PRIO_DELTA_MAX 36
++#define _SC_DELAYTIMER_MAX 37
+ #define _SC_THREAD_KEYS_MAX 38
+ #define _SC_THREAD_STACK_MIN 39
+ #define _SC_THREAD_THREADS_MAX 40
+ #define _SC_TTY_NAME_MAX 41
+-
+ #define _SC_THREADS 42
+ #define _SC_THREAD_ATTR_STACKADDR 43
+ #define _SC_THREAD_ATTR_STACKSIZE 44
+@@ -302,34 +294,99 @@
+ #define _SC_GETPW_R_SIZE_MAX 51
+ #define _SC_LOGIN_NAME_MAX 52
+ #define _SC_THREAD_DESTRUCTOR_ITERATIONS 53
+-
+-#if !defined(__rtems__)
+-#define _SC_STREAM_MAX 100
+-#endif
+-#if !defined(__CYGWIN__) && !defined(__rtems__)
+-#define _SC_PRIORITY_SCHEDULING 101
+-#endif
+-
+-# define _PC_LINK_MAX 0
+-# define _PC_MAX_CANON 1
+-# define _PC_MAX_INPUT 2
+-# define _PC_NAME_MAX 3
+-# define _PC_PATH_MAX 4
+-# define _PC_PIPE_BUF 5
+-# define _PC_CHOWN_RESTRICTED 6
+-# define _PC_NO_TRUNC 7
+-# define _PC_VDISABLE 8
+-# define _PC_ASYNC_IO 9
+-# define _PC_PRIO_IO 10
+-# define _PC_SYNC_IO 11
+-# define _PC_FILESIZEBITS 12
+-# define _PC_2_SYMLINKS 13
+-# define _PC_SYMLINK_MAX 14
++#define _SC_ADVISORY_INFO 54
++#define _SC_ATEXIT_MAX 55
++#define _SC_BARRIERS 56
++#define _SC_BC_BASE_MAX 57
++#define _SC_BC_DIM_MAX 58
++#define _SC_BC_SCALE_MAX 59
++#define _SC_BC_STRING_MAX 60
++#define _SC_CLOCK_SELECTION 61
++#define _SC_COLL_WEIGHTS_MAX 62
++#define _SC_CPUTIME 63
++#define _SC_EXPR_NEST_MAX 64
++#define _SC_HOST_NAME_MAX 65
++#define _SC_IOV_MAX 66
++#define _SC_IPV6 67
++#define _SC_LINE_MAX 68
++#define _SC_MONOTONIC_CLOCK 69
++#define _SC_RAW_SOCKETS 70
++#define _SC_READER_WRITER_LOCKS 71
++#define _SC_REGEXP 72
++#define _SC_RE_DUP_MAX 73
++#define _SC_SHELL 74
++#define _SC_SPAWN 75
++#define _SC_SPIN_LOCKS 76
++#define _SC_SPORADIC_SERVER 77
++#define _SC_SS_REPL_MAX 78
++#define _SC_SYMLOOP_MAX 79
++#define _SC_THREAD_CPUTIME 80
++#define _SC_THREAD_SPORADIC_SERVER 81
++#define _SC_TIMEOUTS 82
++#define _SC_TRACE 83
++#define _SC_TRACE_EVENT_FILTER 84
++#define _SC_TRACE_EVENT_NAME_MAX 85
++#define _SC_TRACE_INHERIT 86
++#define _SC_TRACE_LOG 87
++#define _SC_TRACE_NAME_MAX 88
++#define _SC_TRACE_SYS_MAX 89
++#define _SC_TRACE_USER_EVENT_MAX 90
++#define _SC_TYPED_MEMORY_OBJECTS 91
++#define _SC_V6_ILP32_OFF32 92
++#define _SC_XBS5_ILP32_OFF32 _SC_V6_ILP32_OFF32
++#define _SC_V6_ILP32_OFFBIG 93
++#define _SC_XBS5_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG
++#define _SC_V6_LP64_OFF64 94
++#define _SC_XBS5_LP64_OFF64 _SC_V6_LP64_OFF64
++#define _SC_V6_LPBIG_OFFBIG 95
++#define _SC_XBS5_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG
++#define _SC_XOPEN_CRYPT 96
++#define _SC_XOPEN_ENH_I18N 97
++#define _SC_XOPEN_LEGACY 98
++#define _SC_XOPEN_REALTIME 99
++#define _SC_STREAM_MAX 100
++#define _SC_PRIORITY_SCHEDULING 101
++#define _SC_XOPEN_REALTIME_THREADS 102
++#define _SC_XOPEN_SHM 103
++#define _SC_XOPEN_STREAMS 104
++#define _SC_XOPEN_UNIX 105
++#define _SC_XOPEN_VERSION 106
++#define _SC_2_CHAR_TERM 107
++#define _SC_2_C_BIND 108
++#define _SC_2_C_DEV 109
++#define _SC_2_FORT_DEV 110
++#define _SC_2_FORT_RUN 111
++#define _SC_2_LOCALEDEF 112
++#define _SC_2_PBS 113
++#define _SC_2_PBS_ACCOUNTING 114
++#define _SC_2_PBS_CHECKPOINT 115
++#define _SC_2_PBS_LOCATE 116
++#define _SC_2_PBS_MESSAGE 117
++#define _SC_2_PBS_TRACK 118
++#define _SC_2_SW_DEV 119
++#define _SC_2_UPE 120
++#define _SC_2_VERSION 121
++
++#define _PC_LINK_MAX 0
++#define _PC_MAX_CANON 1
++#define _PC_MAX_INPUT 2
++#define _PC_NAME_MAX 3
++#define _PC_PATH_MAX 4
++#define _PC_PIPE_BUF 5
++#define _PC_CHOWN_RESTRICTED 6
++#define _PC_NO_TRUNC 7
++#define _PC_VDISABLE 8
++#define _PC_ASYNC_IO 9
++#define _PC_PRIO_IO 10
++#define _PC_SYNC_IO 11
++#define _PC_FILESIZEBITS 12
++#define _PC_2_SYMLINKS 13
++#define _PC_SYMLINK_MAX 14
+ #ifdef __CYGWIN__
+ /* Ask for POSIX permission bits support. */
+-# define _PC_POSIX_PERMISSIONS 90
++#define _PC_POSIX_PERMISSIONS 90
+ /* Ask for full POSIX permission support including uid/gid settings. */
+-# define _PC_POSIX_SECURITY 91
++#define _PC_POSIX_SECURITY 91
+ #endif
+
+ /* FIXME: This is temporary until winsup gets sorted out. */
+diff -uNr newlib-1.15.0.orig/newlib/libc/include/time.h newlib-1.15.0/newlib/libc/include/time.h
+--- newlib-1.15.0.orig/newlib/libc/include/time.h 2005-11-18 16:57:24.000000000 +0100
++++ newlib-1.15.0/newlib/libc/include/time.h 2007-04-13 10:41:47.000000000 +0200
+@@ -226,6 +226,16 @@
+
+ #endif
+
++#if defined(_POSIX_MONOTONIC_CLOCK)
++
++/* The identifier for the system-wide monotonic clock, which is defined
++ as a clock whose value cannot be set via clock_settime() and which
++ cannot have backward clock jumps. */
++
++#define CLOCK_MONOTONIC (clockid_t)4
++
++#endif
++
+ #if defined(_POSIX_CPUTIME)
+
+ /* Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55 */
+diff -uNr newlib-1.15.0.orig/newlib/libc/machine/arm/machine/endian.h newlib-1.15.0/newlib/libc/machine/arm/machine/endian.h
+--- newlib-1.15.0.orig/newlib/libc/machine/arm/machine/endian.h 2004-05-07 22:29:24.000000000 +0200
++++ newlib-1.15.0/newlib/libc/machine/arm/machine/endian.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,12 +0,0 @@
+-/* ARM configuration file */
+-
+-#ifndef _MACHINE_ENDIAN_H
+-# define _MACHINE_ENDIAN_H
+-
+-#ifdef __ARMEB__
+-#define BYTE_ORDER BIG_ENDIAN
+-#else
+-#define BYTE_ORDER LITTLE_ENDIAN
+-#endif
+-
+-#endif
+diff -uNr newlib-1.15.0.orig/newlib/libc/search/db_local.h newlib-1.15.0/newlib/libc/search/db_local.h
+--- newlib-1.15.0.orig/newlib/libc/search/db_local.h 2002-06-25 01:05:08.000000000 +0200
++++ newlib-1.15.0/newlib/libc/search/db_local.h 2007-04-13 10:41:47.000000000 +0200
+@@ -50,7 +50,7 @@
+ #define MAX_PAGE_NUMBER 0xffffffff /* >= # of pages in a file */
+ typedef __uint32_t pgno_t;
+ #define MAX_PAGE_OFFSET 65535 /* >= # of bytes in a page */
+-typedef __uint16_t indx_t;
++typedef __uint_least16_t indx_t;
+ #define MAX_REC_NUMBER 0xffffffff /* >= # of records in a tree */
+ typedef __uint32_t recno_t;
+
+@@ -191,12 +191,12 @@
+ * P_16_COPY swap from one location to another
+ */
+ #define M_16_SWAP(a) { \
+- __uint16_t _tmp = a; \
++ __uint_least16_t _tmp = a; \
+ ((char *)&a)[0] = ((char *)&_tmp)[1]; \
+ ((char *)&a)[1] = ((char *)&_tmp)[0]; \
+ }
+ #define P_16_SWAP(a) { \
+- __uint16_t _tmp = *(__uint16_t *)a; \
++ __uint_least16_t _tmp = *(__uint_least16_t *)a; \
+ ((char *)a)[0] = ((char *)&_tmp)[1]; \
+ ((char *)a)[1] = ((char *)&_tmp)[0]; \
+ }
+diff -uNr newlib-1.15.0.orig/newlib/libc/search/extern.h newlib-1.15.0/newlib/libc/search/extern.h
+--- newlib-1.15.0.orig/newlib/libc/search/extern.h 2002-06-20 21:51:31.000000000 +0200
++++ newlib-1.15.0/newlib/libc/search/extern.h 2007-04-13 10:41:47.000000000 +0200
+@@ -48,7 +48,7 @@
+ int __delpair(HTAB *, BUFHEAD *, int);
+ int __expand_table(HTAB *);
+ int __find_bigpair(HTAB *, BUFHEAD *, int, char *, int);
+-__uint16_t __find_last_page(HTAB *, BUFHEAD **);
++__uint_least16_t __find_last_page(HTAB *, BUFHEAD **);
+ void __free_ovflpage(HTAB *, BUFHEAD *);
+ BUFHEAD *__get_buf(HTAB *, __uint32_t, BUFHEAD *, int);
+ int __get_page(HTAB *, char *, __uint32_t, int, int, int);
+diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash_bigkey.c newlib-1.15.0/newlib/libc/search/hash_bigkey.c
+--- newlib-1.15.0.orig/newlib/libc/search/hash_bigkey.c 2006-06-07 21:22:59.000000000 +0200
++++ newlib-1.15.0/newlib/libc/search/hash_bigkey.c 2007-04-13 10:41:47.000000000 +0200
+@@ -92,13 +92,13 @@
+ BUFHEAD *bufp;
+ const DBT *key, *val;
+ {
+- __uint16_t *p;
++ __uint_least16_t *p;
+ int key_size, n, val_size;
+- __uint16_t space, move_bytes, off;
++ __uint_least16_t space, move_bytes, off;
+ char *cp, *key_data, *val_data;
+
+ cp = bufp->page; /* Character pointer of p. */
+- p = (__uint16_t *)cp;
++ p = (__uint_least16_t *)cp;
+
+ key_data = (char *)key->data;
+ key_size = key->size;
+@@ -136,7 +136,7 @@
+ OFFSET(p) = off;
+ } else
+ p[n - 2] = FULL_KEY;
+- p = (__uint16_t *)bufp->page;
++ p = (__uint_least16_t *)bufp->page;
+ cp = bufp->page;
+ bufp->flags |= BUF_MOD;
+ }
+@@ -166,7 +166,7 @@
+ if (!bufp)
+ return (-1);
+ cp = bufp->page;
+- p = (__uint16_t *)cp;
++ p = (__uint_least16_t *)cp;
+ } else
+ p[n] = FULL_KEY_DATA;
+ bufp->flags |= BUF_MOD;
+@@ -191,12 +191,12 @@
+ BUFHEAD *bufp;
+ {
+ BUFHEAD *last_bfp, *rbufp;
+- __uint16_t *bp, pageno;
++ __uint_least16_t *bp, pageno;
+ int key_done, n;
+
+ rbufp = bufp;
+ last_bfp = NULL;
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ pageno = 0;
+ key_done = 0;
+
+@@ -219,7 +219,7 @@
+ last_bfp = rbufp;
+ if (!rbufp)
+ return (-1); /* Error. */
+- bp = (__uint16_t *)rbufp->page;
++ bp = (__uint_least16_t *)rbufp->page;
+ }
+
+ /*
+@@ -234,7 +234,7 @@
+ pageno = bp[n - 1];
+
+ /* Now, bp is the first page of the pair. */
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ if (n > 2) {
+ /* There is an overflow page. */
+ bp[1] = pageno;
+@@ -272,13 +272,13 @@
+ char *key;
+ int size;
+ {
+- __uint16_t *bp;
++ __uint_least16_t *bp;
+ char *p;
+ int ksize;
+- __uint16_t bytes;
++ __uint_least16_t bytes;
+ char *kkey;
+
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ p = bufp->page;
+ ksize = size;
+ kkey = key;
+@@ -294,7 +294,7 @@
+ if (!bufp)
+ return (-3);
+ p = bufp->page;
+- bp = (__uint16_t *)p;
++ bp = (__uint_least16_t *)p;
+ ndx = 1;
+ }
+
+@@ -316,17 +316,17 @@
+ * of the pair; 0 if there isn't any (i.e. big pair is the last key in the
+ * bucket)
+ */
+-extern __uint16_t
++extern __uint_least16_t
+ __find_last_page(hashp, bpp)
+ HTAB *hashp;
+ BUFHEAD **bpp;
+ {
+ BUFHEAD *bufp;
+- __uint16_t *bp, pageno;
++ __uint_least16_t *bp, pageno;
+ int n;
+
+ bufp = *bpp;
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ for (;;) {
+ n = bp[0];
+
+@@ -343,7 +343,7 @@
+ bufp = __get_buf(hashp, pageno, bufp, 0);
+ if (!bufp)
+ return (0); /* Need to indicate an error! */
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ }
+
+ *bpp = bufp;
+@@ -366,15 +366,15 @@
+ int set_current;
+ {
+ BUFHEAD *save_p;
+- __uint16_t *bp, len, off, save_addr;
++ __uint_least16_t *bp, len, off, save_addr;
+ char *tp;
+
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ while (bp[ndx + 1] == PARTIAL_KEY) {
+ bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
+ if (!bufp)
+ return (-1);
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ ndx = 1;
+ }
+
+@@ -382,7 +382,7 @@
+ bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
+ if (!bufp)
+ return (-1);
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ save_p = bufp;
+ save_addr = save_p->addr;
+ off = bp[1];
+@@ -403,7 +403,7 @@
+ bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
+ if (!bufp)
+ return (-1);
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ } else {
+ /* The data is all on one page. */
+ tp = (char *)bp;
+@@ -422,7 +422,7 @@
+ if (!hashp->cpage)
+ return (-1);
+ hashp->cndx = 1;
+- if (!((__uint16_t *)
++ if (!((__uint_least16_t *)
+ hashp->cpage->page)[0]) {
+ hashp->cbucket++;
+ hashp->cpage = NULL;
+@@ -454,14 +454,14 @@
+ BUFHEAD *bufp;
+ int len, set;
+ {
+- __uint16_t *bp;
++ __uint_least16_t *bp;
+ char *p;
+ BUFHEAD *xbp;
+- __uint16_t save_addr;
++ __uint_least16_t save_addr;
+ int mylen, totlen;
+
+ p = bufp->page;
+- bp = (__uint16_t *)p;
++ bp = (__uint_least16_t *)p;
+ mylen = hashp->BSIZE - bp[1];
+ save_addr = bufp->addr;
+
+@@ -481,7 +481,7 @@
+ __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
+ if (!hashp->cpage)
+ return (-1);
+- else if (!((__uint16_t *)hashp->cpage->page)[0]) {
++ else if (!((__uint_least16_t *)hashp->cpage->page)[0]) {
+ hashp->cbucket++;
+ hashp->cpage = NULL;
+ }
+@@ -533,10 +533,10 @@
+ BUFHEAD *xbp;
+ char *p;
+ int mylen, totlen;
+- __uint16_t *bp, save_addr;
++ __uint_least16_t *bp, save_addr;
+
+ p = bufp->page;
+- bp = (__uint16_t *)p;
++ bp = (__uint_least16_t *)p;
+ mylen = hashp->BSIZE - bp[1];
+
+ save_addr = bufp->addr;
+@@ -579,11 +579,11 @@
+ SPLIT_RETURN *ret;
+ {
+ BUFHEAD *tmpp;
+- __uint16_t *tp;
++ __uint_least16_t *tp;
+ BUFHEAD *bp;
+ DBT key, val;
+ __uint32_t change;
+- __uint16_t free_space, n, off;
++ __uint_least16_t free_space, n, off;
+
+ bp = big_keyp;
+
+@@ -615,14 +615,14 @@
+ (tmpp->ovfl ? tmpp->ovfl->addr : 0), (bp ? bp->addr : 0));
+ #endif
+ tmpp->ovfl = bp; /* one of op/np point to big_keyp */
+- tp = (__uint16_t *)tmpp->page;
++ tp = (__uint_least16_t *)tmpp->page;
+ #ifdef DEBUG
+ assert(FREESPACE(tp) >= OVFLSIZE);
+ #endif
+ n = tp[0];
+ off = OFFSET(tp);
+ free_space = FREESPACE(tp);
+- tp[++n] = (__uint16_t)addr;
++ tp[++n] = (__uint_least16_t)addr;
+ tp[++n] = OVFLPAGE;
+ tp[0] = n;
+ OFFSET(tp) = off;
+@@ -638,7 +638,7 @@
+ ret->newp = np;
+ ret->oldp = op;
+
+- tp = (__uint16_t *)big_keyp->page;
++ tp = (__uint_least16_t *)big_keyp->page;
+ big_keyp->flags |= BUF_MOD;
+ if (tp[0] > 2) {
+ /*
+diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash_buf.c newlib-1.15.0/newlib/libc/search/hash_buf.c
+--- newlib-1.15.0.orig/newlib/libc/search/hash_buf.c 2004-05-26 19:57:10.000000000 +0200
++++ newlib-1.15.0/newlib/libc/search/hash_buf.c 2007-04-13 10:41:47.000000000 +0200
+@@ -176,7 +176,7 @@
+ BUFHEAD *next_xbp;
+ SEGMENT segp;
+ int segment_ndx;
+- __uint16_t oaddr, *shortp;
++ __uint_least16_t oaddr, *shortp;
+
+ oaddr = 0;
+ bp = LRU;
+@@ -212,7 +212,7 @@
+ * Set oaddr before __put_page so that you get it
+ * before bytes are swapped.
+ */
+- shortp = (__uint16_t *)bp->page;
++ shortp = (__uint_least16_t *)bp->page;
+ if (shortp[0])
+ oaddr = shortp[shortp[0] - 1];
+ if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page,
+@@ -255,7 +255,7 @@
+ (oaddr != xbp->addr))
+ break;
+
+- shortp = (__uint16_t *)xbp->page;
++ shortp = (__uint_least16_t *)xbp->page;
+ if (shortp[0])
+ /* set before __put_page */
+ oaddr = shortp[shortp[0] - 1];
+diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash.c newlib-1.15.0/newlib/libc/search/hash.c
+--- newlib-1.15.0.orig/newlib/libc/search/hash.c 2004-05-26 19:57:10.000000000 +0200
++++ newlib-1.15.0/newlib/libc/search/hash.c 2007-04-13 10:41:47.000000000 +0200
+@@ -628,10 +628,10 @@
+ {
+ BUFHEAD *rbufp;
+ BUFHEAD *bufp, *save_bufp;
+- __uint16_t *bp;
++ __uint_least16_t *bp;
+ int n, ndx, off, size;
+ char *kp;
+- __uint16_t pageno;
++ __uint_least16_t pageno;
+
+ #ifdef HASH_STATISTICS
+ hash_accesses++;
+@@ -647,7 +647,7 @@
+
+ /* Pin the bucket chain */
+ rbufp->flags |= BUF_PIN;
+- for (bp = (__uint16_t *)rbufp->page, n = *bp++, ndx = 1; ndx < n;)
++ for (bp = (__uint_least16_t *)rbufp->page, n = *bp++, ndx = 1; ndx < n;)
+ if (bp[1] >= REAL_KEY) {
+ /* Real key/data pair */
+ if (size == off - *bp &&
+@@ -666,7 +666,7 @@
+ return (ERROR);
+ }
+ /* FOR LOOP INIT */
+- bp = (__uint16_t *)rbufp->page;
++ bp = (__uint_least16_t *)rbufp->page;
+ n = *bp++;
+ ndx = 1;
+ off = hashp->BSIZE;
+@@ -688,7 +688,7 @@
+ return (ERROR);
+ }
+ /* FOR LOOP INIT */
+- bp = (__uint16_t *)rbufp->page;
++ bp = (__uint_least16_t *)rbufp->page;
+ n = *bp++;
+ ndx = 1;
+ off = hashp->BSIZE;
+@@ -722,7 +722,7 @@
+ save_bufp->flags &= ~BUF_PIN;
+ return (ABNORMAL);
+ case HASH_GET:
+- bp = (__uint16_t *)rbufp->page;
++ bp = (__uint_least16_t *)rbufp->page;
+ if (bp[ndx + 1] < REAL_KEY) {
+ if (__big_return(hashp, rbufp, ndx, val, 0))
+ return (ERROR);
+@@ -758,7 +758,7 @@
+ __uint32_t bucket;
+ BUFHEAD *bufp;
+ HTAB *hashp;
+- __uint16_t *bp, ndx;
++ __uint_least16_t *bp, ndx;
+
+ hashp = (HTAB *)dbp->internal;
+ if (flag && flag != R_FIRST && flag != R_NEXT) {
+@@ -783,7 +783,7 @@
+ if (!bufp)
+ return (ERROR);
+ hashp->cpage = bufp;
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ if (bp[0])
+ break;
+ }
+@@ -793,7 +793,7 @@
+ return (ABNORMAL);
+ }
+ } else
+- bp = (__uint16_t *)hashp->cpage->page;
++ bp = (__uint_least16_t *)hashp->cpage->page;
+
+ #ifdef DEBUG
+ assert(bp);
+@@ -804,7 +804,7 @@
+ __get_buf(hashp, bp[hashp->cndx], bufp, 0);
+ if (!bufp)
+ return (ERROR);
+- bp = (__uint16_t *)(bufp->page);
++ bp = (__uint_least16_t *)(bufp->page);
+ hashp->cndx = 1;
+ }
+ if (!bp[0]) {
+diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash.h newlib-1.15.0/newlib/libc/search/hash.h
+--- newlib-1.15.0.orig/newlib/libc/search/hash.h 2002-07-02 20:18:58.000000000 +0200
++++ newlib-1.15.0/newlib/libc/search/hash.h 2007-04-13 10:41:47.000000000 +0200
+@@ -102,7 +102,7 @@
+ #define NCACHED 32 /* number of bit maps and spare
+ * points */
+ int spares[NCACHED];/* spare pages for overflow */
+- __uint16_t bitmaps[NCACHED]; /* address of overflow page
++ __uint_least16_t bitmaps[NCACHED]; /* address of overflow page
+ * bitmaps */
+ } HASHHDR;
+
+diff -uNr newlib-1.15.0.orig/newlib/libc/search/hash_page.c newlib-1.15.0/newlib/libc/search/hash_page.c
+--- newlib-1.15.0.orig/newlib/libc/search/hash_page.c 2002-09-19 23:28:51.000000000 +0200
++++ newlib-1.15.0/newlib/libc/search/hash_page.c 2007-04-13 10:41:47.000000000 +0200
+@@ -77,16 +77,16 @@
+ static __uint32_t *fetch_bitmap(HTAB *, int);
+ static __uint32_t first_free(__uint32_t);
+ static int open_temp(HTAB *);
+-static __uint16_t overflow_page(HTAB *);
++static __uint_least16_t overflow_page(HTAB *);
+ static void putpair(char *, const DBT *, const DBT *);
+-static void squeeze_key(__uint16_t *, const DBT *, const DBT *);
++static void squeeze_key(__uint_least16_t *, const DBT *, const DBT *);
+ static int ugly_split
+ (HTAB *, __uint32_t, BUFHEAD *, BUFHEAD *, int, int);
+
+ #define PAGE_INIT(P) { \
+- ((__uint16_t *)(P))[0] = 0; \
+- ((__uint16_t *)(P))[1] = hashp->BSIZE - 3 * sizeof(__uint16_t); \
+- ((__uint16_t *)(P))[2] = hashp->BSIZE; \
++ ((__uint_least16_t *)(P))[0] = 0; \
++ ((__uint_least16_t *)(P))[1] = hashp->BSIZE - 3 * sizeof(__uint_least16_t); \
++ ((__uint_least16_t *)(P))[2] = hashp->BSIZE; \
+ }
+
+ /*
+@@ -99,9 +99,9 @@
+ char *p;
+ const DBT *key, *val;
+ {
+- __uint16_t *bp, n, off;
++ __uint_least16_t *bp, n, off;
+
+- bp = (__uint16_t *)p;
++ bp = (__uint_least16_t *)p;
+
+ /* Enter the key first. */
+ n = bp[0];
+@@ -117,7 +117,7 @@
+
+ /* Adjust page info. */
+ bp[0] = n;
+- bp[n + 1] = off - ((n + 3) * sizeof(__uint16_t));
++ bp[n + 1] = off - ((n + 3) * sizeof(__uint_least16_t));
+ bp[n + 2] = off;
+ }
+
+@@ -132,11 +132,11 @@
+ BUFHEAD *bufp;
+ int ndx;
+ {
+- __uint16_t *bp, newoff;
++ __uint_least16_t *bp, newoff;
+ int n;
+- __uint16_t pairlen;
++ __uint_least16_t pairlen;
+
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ n = bp[0];
+
+ if (bp[ndx + 1] < REAL_KEY)
+@@ -167,7 +167,7 @@
+ }
+ /* Finally adjust the page data */
+ bp[n] = OFFSET(bp) + pairlen;
+- bp[n - 1] = bp[n + 1] + pairlen + 2 * sizeof(__uint16_t);
++ bp[n - 1] = bp[n + 1] + pairlen + 2 * sizeof(__uint_least16_t);
+ bp[0] = n - 2;
+ hashp->NKEYS--;
+
+@@ -185,15 +185,15 @@
+ __uint32_t obucket, nbucket;
+ {
+ BUFHEAD *new_bufp, *old_bufp;
+- __uint16_t *ino;
++ __uint_least16_t *ino;
+ char *np;
+ DBT key, val;
+ int n, ndx, retval;
+- __uint16_t copyto, diff, off, moved;
++ __uint_least16_t copyto, diff, off, moved;
+ char *op;
+
+- copyto = (__uint16_t)hashp->BSIZE;
+- off = (__uint16_t)hashp->BSIZE;
++ copyto = (__uint_least16_t)hashp->BSIZE;
++ off = (__uint_least16_t)hashp->BSIZE;
+ old_bufp = __get_buf(hashp, obucket, NULL, 0);
+ if (old_bufp == NULL)
+ return (-1);
+@@ -204,7 +204,7 @@
+ old_bufp->flags |= (BUF_MOD | BUF_PIN);
+ new_bufp->flags |= (BUF_MOD | BUF_PIN);
+
+- ino = (__uint16_t *)(op = old_bufp->page);
++ ino = (__uint_least16_t *)(op = old_bufp->page);
+ np = new_bufp->page;
+
+ moved = 0;
+@@ -246,13 +246,13 @@
+
+ /* Now clean up the page */
+ ino[0] -= moved;
+- FREESPACE(ino) = copyto - sizeof(__uint16_t) * (ino[0] + 3);
++ FREESPACE(ino) = copyto - sizeof(__uint_least16_t) * (ino[0] + 3);
+ OFFSET(ino) = copyto;
+
+ #ifdef DEBUG3
+ (void)fprintf(stderr, "split %d/%d\n",
+- ((__uint16_t *)np)[0] / 2,
+- ((__uint16_t *)op)[0] / 2);
++ ((__uint_least16_t *)np)[0] / 2,
++ ((__uint_least16_t *)op)[0] / 2);
+ #endif
+ /* unpin both pages */
+ old_bufp->flags &= ~BUF_PIN;
+@@ -284,22 +284,22 @@
+ int moved; /* Number of pairs moved to new page. */
+ {
+ BUFHEAD *bufp; /* Buffer header for ino */
+- __uint16_t *ino; /* Page keys come off of */
+- __uint16_t *np; /* New page */
+- __uint16_t *op; /* Page keys go on to if they aren't moving */
++ __uint_least16_t *ino; /* Page keys come off of */
++ __uint_least16_t *np; /* New page */
++ __uint_least16_t *op; /* Page keys go on to if they aren't moving */
+
+ BUFHEAD *last_bfp; /* Last buf header OVFL needing to be freed */
+ DBT key, val;
+ SPLIT_RETURN ret;
+- __uint16_t n, off, ov_addr, scopyto;
++ __uint_least16_t n, off, ov_addr, scopyto;
+ char *cino; /* Character value of ino */
+
+ bufp = old_bufp;
+- ino = (__uint16_t *)old_bufp->page;
+- np = (__uint16_t *)new_bufp->page;
+- op = (__uint16_t *)old_bufp->page;
++ ino = (__uint_least16_t *)old_bufp->page;
++ np = (__uint_least16_t *)new_bufp->page;
++ op = (__uint_least16_t *)old_bufp->page;
+ last_bfp = NULL;
+- scopyto = (__uint16_t)copyto; /* ANSI */
++ scopyto = (__uint_least16_t)copyto; /* ANSI */
+
+ n = ino[0] - 1;
+ while (n < ino[0]) {
+@@ -310,16 +310,16 @@
+ old_bufp = ret.oldp;
+ if (!old_bufp)
+ return (-1);
+- op = (__uint16_t *)old_bufp->page;
++ op = (__uint_least16_t *)old_bufp->page;
+ new_bufp = ret.newp;
+ if (!new_bufp)
+ return (-1);
+- np = (__uint16_t *)new_bufp->page;
++ np = (__uint_least16_t *)new_bufp->page;
+ bufp = ret.nextp;
+ if (!bufp)
+ return (0);
+ cino = (char *)bufp->page;
+- ino = (__uint16_t *)cino;
++ ino = (__uint_least16_t *)cino;
+ last_bfp = ret.nextp;
+ } else if (ino[n + 1] == OVFLPAGE) {
+ ov_addr = ino[n];
+@@ -329,14 +329,14 @@
+ */
+ ino[0] -= (moved + 2);
+ FREESPACE(ino) =
+- scopyto - sizeof(__uint16_t) * (ino[0] + 3);
++ scopyto - sizeof(__uint_least16_t) * (ino[0] + 3);
+ OFFSET(ino) = scopyto;
+
+ bufp = __get_buf(hashp, ov_addr, bufp, 0);
+ if (!bufp)
+ return (-1);
+
+- ino = (__uint16_t *)bufp->page;
++ ino = (__uint_least16_t *)bufp->page;
+ n = 1;
+ scopyto = hashp->BSIZE;
+ moved = 0;
+@@ -364,7 +364,7 @@
+ __add_ovflpage(hashp, old_bufp);
+ if (!old_bufp)
+ return (-1);
+- op = (__uint16_t *)old_bufp->page;
++ op = (__uint_least16_t *)old_bufp->page;
+ putpair((char *)op, &key, &val);
+ }
+ old_bufp->flags |= BUF_MOD;
+@@ -377,7 +377,7 @@
+ __add_ovflpage(hashp, new_bufp);
+ if (!new_bufp)
+ return (-1);
+- np = (__uint16_t *)new_bufp->page;
++ np = (__uint_least16_t *)new_bufp->page;
+ putpair((char *)np, &key, &val);
+ }
+ new_bufp->flags |= BUF_MOD;
+@@ -402,10 +402,10 @@
+ BUFHEAD *bufp;
+ const DBT *key, *val;
+ {
+- __uint16_t *bp, *sop;
++ __uint_least16_t *bp, *sop;
+ int do_expand;
+
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ do_expand = 0;
+ while (bp[0] && (bp[2] < REAL_KEY || bp[bp[0]] < REAL_KEY))
+ /* Exception case */
+@@ -417,7 +417,7 @@
+ bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
+ if (!bufp)
+ return (-1);
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ } else
+ /* Try to squeeze key on this page */
+ if (FREESPACE(bp) > PAIRSIZE(key, val)) {
+@@ -427,7 +427,7 @@
+ bufp = __get_buf(hashp, bp[bp[0] - 1], bufp, 0);
+ if (!bufp)
+ return (-1);
+- bp = (__uint16_t *)bufp->page;
++ bp = (__uint_least16_t *)bufp->page;
+ }
+
+ if (PAIRFITS(bp, key, val))
+@@ -437,7 +437,7 @@
+ bufp = __add_ovflpage(hashp, bufp);
+ if (!bufp)
+ return (-1);
+- sop = (__uint16_t *)bufp->page;
++ sop = (__uint_least16_t *)bufp->page;
+
+ if (PAIRFITS(sop, key, val))
+ putpair((char *)sop, key, val);
+@@ -468,12 +468,12 @@
+ HTAB *hashp;
+ BUFHEAD *bufp;
+ {
+- __uint16_t *sp;
+- __uint16_t ndx, ovfl_num;
++ __uint_least16_t *sp;
++ __uint_least16_t ndx, ovfl_num;
+ #ifdef DEBUG1
+ int tmp1, tmp2;
+ #endif
+- sp = (__uint16_t *)bufp->page;
++ sp = (__uint_least16_t *)bufp->page;
+
+ /* Check if we are dynamically determining the fill factor */
+ if (hashp->FFACTOR == DEF_FFACTOR) {
+@@ -525,7 +525,7 @@
+ {
+ int fd, page, size;
+ int rsize;
+- __uint16_t *bp;
++ __uint_least16_t *bp;
+
+ fd = hashp->fp;
+ size = hashp->BSIZE;
+@@ -541,7 +541,7 @@
+ if ((lseek(fd, (off_t)page << hashp->BSHIFT, SEEK_SET) == -1) ||
+ ((rsize = read(fd, p, size)) == -1))
+ return (-1);
+- bp = (__uint16_t *)p;
++ bp = (__uint_least16_t *)p;
+ if (!rsize)
+ bp[0] = 0; /* We hit the EOF, so initialize a new page */
+ else
+@@ -600,9 +600,9 @@
+ for (i = 0; i < max; i++)
+ M_32_SWAP(((int *)p)[i]);
+ } else {
+- max = ((__uint16_t *)p)[0] + 2;
++ max = ((__uint_least16_t *)p)[0] + 2;
+ for (i = 0; i <= max; i++)
+- M_16_SWAP(((__uint16_t *)p)[i]);
++ M_16_SWAP(((__uint_least16_t *)p)[i]);
+ }
+ }
+ if (is_bucket)
+@@ -643,7 +643,7 @@
+ hashp->BSIZE - clearbytes);
+ ip[clearints - 1] = ALL_SET << (nbits & BYTE_MASK);
+ SETBIT(ip, 0);
+- hashp->BITMAPS[ndx] = (__uint16_t)pnum;
++ hashp->BITMAPS[ndx] = (__uint_least16_t)pnum;
+ hashp->mapp[ndx] = ip;
+ return (0);
+ }
+@@ -663,13 +663,13 @@
+ return (i);
+ }
+
+-static __uint16_t
++static __uint_least16_t
+ overflow_page(hashp)
+ HTAB *hashp;
+ {
+ __uint32_t *freep;
+ int max_free, offset, splitnum;
+- __uint16_t addr;
++ __uint_least16_t addr;
+ int bit, first_page, free_bit, free_page, i, in_use_bits, j;
+ #ifdef DEBUG2
+ int tmp1, tmp2;
+@@ -816,16 +816,16 @@
+ HTAB *hashp;
+ BUFHEAD *obufp;
+ {
+- __uint16_t addr;
++ __uint_least16_t addr;
+ __uint32_t *freep;
+ int bit_address, free_page, free_bit;
+- __uint16_t ndx;
++ __uint_least16_t ndx;
+
+ addr = obufp->addr;
+ #ifdef DEBUG1
+ (void)fprintf(stderr, "Freeing %d\n", addr);
+ #endif
+- ndx = (((__uint16_t)addr) >> SPLITSHIFT);
++ ndx = (((__uint_least16_t)addr) >> SPLITSHIFT);
+ bit_address =
+ (ndx ? hashp->SPARES[ndx - 1] : 0) + (addr & SPLITMASK) - 1;
+ if (bit_address < hashp->LAST_FREED)
+@@ -883,11 +883,11 @@
+ */
+ static void
+ squeeze_key(sp, key, val)
+- __uint16_t *sp;
++ __uint_least16_t *sp;
+ const DBT *key, *val;
+ {
+ char *p;
+- __uint16_t free_space, n, off, pageno;
++ __uint_least16_t free_space, n, off, pageno;
+
+ p = (char *)sp;
+ n = sp[0];
+diff -uNr newlib-1.15.0.orig/newlib/libc/search/page.h newlib-1.15.0/newlib/libc/search/page.h
+--- newlib-1.15.0.orig/newlib/libc/search/page.h 2002-06-20 21:51:31.000000000 +0200
++++ newlib-1.15.0/newlib/libc/search/page.h 2007-04-13 10:41:47.000000000 +0200
+@@ -74,20 +74,20 @@
+ * You might as well do this up front.
+ */
+
+-#define PAIRSIZE(K,D) (2*sizeof(__uint16_t) + (K)->size + (D)->size)
+-#define BIGOVERHEAD (4*sizeof(__uint16_t))
+-#define KEYSIZE(K) (4*sizeof(__uint16_t) + (K)->size);
+-#define OVFLSIZE (2*sizeof(__uint16_t))
++#define PAIRSIZE(K,D) (2*sizeof(__uint_least16_t) + (K)->size + (D)->size)
++#define BIGOVERHEAD (4*sizeof(__uint_least16_t))
++#define KEYSIZE(K) (4*sizeof(__uint_least16_t) + (K)->size);
++#define OVFLSIZE (2*sizeof(__uint_least16_t))
+ #define FREESPACE(P) ((P)[(P)[0]+1])
+ #define OFFSET(P) ((P)[(P)[0]+2])
+ #define PAIRFITS(P,K,D) \
+ (((P)[2] >= REAL_KEY) && \
+ (PAIRSIZE((K),(D)) + OVFLSIZE) <= FREESPACE((P)))
+-#define PAGE_META(N) (((N)+3) * sizeof(__uint16_t))
++#define PAGE_META(N) (((N)+3) * sizeof(__uint_least16_t))
+
+ typedef struct {
+ BUFHEAD *newp;
+ BUFHEAD *oldp;
+ BUFHEAD *nextp;
+- __uint16_t next_addr;
++ __uint_least16_t next_addr;
+ } SPLIT_RETURN;
+diff -uNr newlib-1.15.0.orig/newlib/libc/sys/rtems/machine/stdint.h newlib-1.15.0/newlib/libc/sys/rtems/machine/stdint.h
+--- newlib-1.15.0.orig/newlib/libc/sys/rtems/machine/stdint.h 1970-01-01 01:00:00.000000000 +0100
++++ newlib-1.15.0/newlib/libc/sys/rtems/machine/stdint.h 2007-04-13 10:41:47.000000000 +0200
+@@ -0,0 +1,31 @@
++/*
++ *
++ */
++#ifndef _MACHINE_STDINT_H
++#define _MACHINE_STDINT_H
++
++#ifndef _STDINT_H
++#error machine/stdint.h is an internal file and must not be directly included
++#endif
++
++#if defined(__sparc__) \
++ || defined(__powerpc__) || defined(__PPC__) \
++ || defined(__mips__) \
++ || defined(__sh__) \
++ || defined(__AVR__) \
++ || defined(_C4x) || defined(_C3x) \
++ || defined(__H8300__)
++/* PTRDIFF_TYPE = int */
++#define __ptrint_t_int_defined 1
++#endif
++
++#if defined(__i386__) \
++ || defined(__m68k__) \
++ || defined(__bfin__) \
++ || defined(__arm__) \
++ || defined(__H8300S__) || defined(__H8300H__)
++/* PTRDIFF_TYPE = long */
++#define __ptrint_t_long_defined 1
++#endif
++
++#endif
+diff -uNr newlib-1.15.0.orig/newlib/libc/sys/rtems/sys/param.h newlib-1.15.0/newlib/libc/sys/rtems/sys/param.h
+--- newlib-1.15.0.orig/newlib/libc/sys/rtems/sys/param.h 2004-05-07 22:29:24.000000000 +0200
++++ newlib-1.15.0/newlib/libc/sys/rtems/sys/param.h 2007-04-13 10:41:47.000000000 +0200
+@@ -93,7 +93,6 @@
+ #include <sys/resource.h>
+ #include <sys/ucred.h>
+ #include <sys/uio.h>
+-#include <sys/rtprio.h>
+
+ #ifndef FALSE
+ #define FALSE 0
+diff -uNr newlib-1.15.0.orig/newlib/Makefile.am newlib-1.15.0/newlib/Makefile.am
+--- newlib-1.15.0.orig/newlib/Makefile.am 2006-06-05 19:42:57.000000000 +0200
++++ newlib-1.15.0/newlib/Makefile.am 2007-04-13 10:41:47.000000000 +0200
+@@ -81,7 +81,7 @@
+ libc.a
+ endif
+
+-noinst_DATA = stmp-targ-include
++BUILT_SOURCES = stmp-targ-include
+
+ toollib_DATA = $(CRT0) $(CRT1)
+
+@@ -186,9 +186,6 @@
+
+ $(CRT1_DIR)$(CRT1): ; @true
+
+-
+-all-recursive: stmp-targ-include
+-
+ # The targ-include directory just holds the includes files for the
+ # particular system and machine we have been configured for. It is
+ # used while building.
+diff -uNr newlib-1.15.0.orig/newlib/Makefile.in newlib-1.15.0/newlib/Makefile.in
+--- newlib-1.15.0.orig/newlib/Makefile.in 2006-12-18 21:32:41.000000000 +0100
++++ newlib-1.15.0/newlib/Makefile.in 2007-04-13 10:41:47.000000000 +0200
+@@ -103,7 +103,7 @@
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ toollibDATA_INSTALL = $(INSTALL_DATA)
+-DATA = $(noinst_DATA) $(toollib_DATA)
++DATA = $(toollib_DATA)
+ ETAGS = etags
+ CTAGS = ctags
+ DEJATOOL = $(PACKAGE)
+@@ -205,12 +205,7 @@
+ USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@
+ USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@
+ VERSION = @VERSION@
+-ac_ct_AR = @ac_ct_AR@
+-ac_ct_AS = @ac_ct_AS@
+ ac_ct_CC = @ac_ct_CC@
+-ac_ct_RANLIB = @ac_ct_RANLIB@
+-ac_ct_READELF = @ac_ct_READELF@
+-ac_ct_STRIP = @ac_ct_STRIP@
+ aext = @aext@
+ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+@@ -226,12 +221,16 @@
+ build_os = @build_os@
+ build_vendor = @build_vendor@
+ datadir = @datadir@
++datarootdir = @datarootdir@
++docdir = @docdir@
++dvidir = @dvidir@
+ exec_prefix = @exec_prefix@
+ host = @host@
+ host_alias = @host_alias@
+ host_cpu = @host_cpu@
+ host_os = @host_os@
+ host_vendor = @host_vendor@
++htmldir = @htmldir@
+ includedir = @includedir@
+ infodir = @infodir@
+ install_sh = @install_sh@
+@@ -240,6 +239,7 @@
+ libdir = @libdir@
+ libexecdir = @libexecdir@
+ libm_machine_dir = @libm_machine_dir@
++localedir = @localedir@
+ localstatedir = @localstatedir@
+ lpfx = @lpfx@
+ machine_dir = @machine_dir@
+@@ -248,8 +248,10 @@
+ newlib_basedir = @newlib_basedir@
+ oext = @oext@
+ oldincludedir = @oldincludedir@
++pdfdir = @pdfdir@
+ prefix = @prefix@
+ program_transform_name = @program_transform_name@
++psdir = @psdir@
+ sbindir = @sbindir@
+ sharedstatedir = @sharedstatedir@
+ subdirs = @subdirs@
+@@ -323,7 +325,7 @@
+ @USE_LIBTOOL_FALSE@toollib_LIBRARIES = libm.a \
+ @USE_LIBTOOL_FALSE@ libc.a
+
+-noinst_DATA = stmp-targ-include
++BUILT_SOURCES = stmp-targ-include
+ toollib_DATA = $(CRT0) $(CRT1)
+
+ # The functions ldexp, frexp and modf are traditionally supplied in
+@@ -382,7 +384,7 @@
+
+ # dejagnu support
+ RUNTESTFLAGS =
+-all: newlib.h
++all: $(BUILT_SOURCES) newlib.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+ .SUFFIXES:
+@@ -687,14 +689,16 @@
+ done
+ check-am:
+ $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
+-check: check-recursive
++check: $(BUILT_SOURCES)
++ $(MAKE) $(AM_MAKEFLAGS) check-recursive
+ all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) newlib.h
+ installdirs: installdirs-recursive
+ installdirs-am:
+ for dir in "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)" "$(DESTDIR)$(toollibdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+-install: install-recursive
++install: $(BUILT_SOURCES)
++ $(MAKE) $(AM_MAKEFLAGS) install-recursive
+ install-exec: install-exec-recursive
+ install-data: install-data-recursive
+ uninstall: uninstall-recursive
+@@ -719,6 +723,7 @@
+ maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
++ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+ clean: clean-recursive
+
+ clean-am: clean-generic clean-libtool clean-toollibLIBRARIES \
+@@ -837,8 +842,6 @@
+
+ $(CRT1_DIR)$(CRT1): ; @true
+
+-all-recursive: stmp-targ-include
+-
+ # The targ-include directory just holds the includes files for the
+ # particular system and machine we have been configured for. It is
+ # used while building.
--- /dev/null
+newlib-1.15.0-rtems4.8-20070413.diff
--host=i586-pc-linux-gnu \
--target=arm-rtems \
--with-gnu-ld --exec-prefix=/usr --prefix=/usr \
---enable-shared --enable-commonbfdlib --verbose \
+--verbose \
--with-mmap --enable-64-bit-bfd \
---enable-targets=i586-pc-linux-gnu,i586-pc-linux-gnulibc1,\
-i386-coff,i586-msdosdjgpp,\
-m68k-linux-elf,m68k-rtems,m68k-coff,m68k-a.out-linux,\
-powerpc-rtems,powerpc-linux,m68hc11-elf,m68hc12-elf,\
-h8300-coff,h8300-elf,sh-coff,sh-rtemself,sh64-linux,\
-or32-elf,openrisc-elf,alpha-linux-gnu,\
-ia64-linux-gnu,x86_64-linux-gnu,\
-arm-rtems,arm-linux,arm-pe,arm-coff,avr-elf,\
-sparc-linux-elf,i586-win-pe,\
-tic30-ti-coff,tic30-ti-aout,tic4x-ti-coff,tic54x-ti-coff,msp430
+--enable-targets=arm-rtems,arm-linux,arm-coff
#i586-go32,
#--ieee,
#srec,symbolsrec,tekhex,binary,ihex,trad-core
--- /dev/null
+Package: binutils-arm-rtems
+Version: 2.17-1
+Architecture: amd64
+Source: binutils-2.17
+Section: cross-dev
+Priority: extra
+Maintainer: Pavel Pisa <pisa@cmp.felk.cvut.cz>
+Priority: extra
+Description: Binutils for target arm-rtems
+ .
+ GNU binutils targetting arm-rtems
--- /dev/null
+Package: gcc-arm-rtems
+Version: 4.1.2-1
+Architecture: amd64
+Source: gcc-4.1.2
+Section: cross-dev
+Priority: extra
+Maintainer: Pavel Pisa <pisa@cmp.felk.cvut.cz>
+Priority: extra
+Description: GCC for target arm-rtems
+ .
+ GNU binutils targetting arm-rtems
--verbose \
--disable-nls \
--host=i586-pc-linux-gnu \
- --with-newlib
+ --with-newlib \
+ --enable-version-specific-runtime-libs
--- /dev/null
+Package: rtems-csb336
+Version: 4.7.1
+Architecture: all
+Source: rtems-4.7.1
+Section: cross-dev
+Priority: extra
+Maintainer: Pavel Pisa <pisa@cmp.felk.cvut.cz>
+Priority: extra
+Description: RTEMS executive for target board CSB336/PiMX1 (arm-rtems)
+ .
+ RTEMS targetting board CSB336/PiMX1 (arm-rtems)
--- /dev/null
+Package: rtems-common
+Version: 4.7.1
+Architecture: amd64
+Source: rtems-4.7.1
+Section: cross-dev
+Priority: extra
+Maintainer: Pavel Pisa <pisa@cmp.felk.cvut.cz>
+Priority: extra
+Description: RTEMS executive common files
+ .
+ RTEMS support files common to all target architectures
+---
+ c/src/lib/libbsp/m68k/mo376/ChangeLog | 455 +++
+ c/src/lib/libbsp/m68k/mo376/Makefile.am | 68
+ c/src/lib/libbsp/m68k/mo376/README | 24
+ c/src/lib/libbsp/m68k/mo376/bsp_specs | 16
+ c/src/lib/libbsp/m68k/mo376/clock/ckinit.c | 128 +
+ c/src/lib/libbsp/m68k/mo376/configure.ac | 20
+ c/src/lib/libbsp/m68k/mo376/console/console.c | 174 +
+ c/src/lib/libbsp/m68k/mo376/console/sci.c | 1596 ++++++++++++++
+ c/src/lib/libbsp/m68k/mo376/console/sci.h | 234 ++
+ c/src/lib/libbsp/m68k/mo376/include/bsp.h | 139 +
+ c/src/lib/libbsp/m68k/mo376/include/bspopts.h.in | 16
+ c/src/lib/libbsp/m68k/mo376/include/mrm332.h | 70
+ c/src/lib/libbsp/m68k/mo376/include/tm27.h | 34
+ c/src/lib/libbsp/m68k/mo376/misc/dotests | 15
+ c/src/lib/libbsp/m68k/mo376/misc/gdbinit68 | 16
+ c/src/lib/libbsp/m68k/mo376/misc/interr.c | 99
+ c/src/lib/libbsp/m68k/mo376/preinstall.am | 66
+ c/src/lib/libbsp/m68k/mo376/spurious/spinit.c | 105
+ c/src/lib/libbsp/m68k/mo376/start/start.S | 150 +
+ c/src/lib/libbsp/m68k/mo376/startup/bspclean.c | 27
+ c/src/lib/libbsp/m68k/mo376/startup/bspstart.c | 82
+ c/src/lib/libbsp/m68k/mo376/startup/except_vect_332_ROM.S | 293 ++
+ c/src/lib/libbsp/m68k/mo376/startup/linkcmds | 164 +
+ c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM | 200 +
+ c/src/lib/libbsp/m68k/mo376/startup/start_c.c | 125 +
+ c/src/lib/libbsp/m68k/mo376/timer/timer.c | 81
+ c/src/lib/libbsp/m68k/mo376/times | 195 +
+ make/custom/mo376.cfg | 67
+ 28 files changed, 4659 insertions(+)
+
Index: rtems/make/custom/mo376.cfg
===================================================================
---- /dev/null
-+++ rtems/make/custom/mo376.cfg
-@@ -0,0 +1,68 @@
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/make/custom/mo376.cfg 2007-08-14 17:20:30.000000000 +0200
+@@ -0,0 +1,67 @@
+#
+# Config file for the mrm332 BSP
+#
-+# $Id: mrm332.cfg,v 1.8 2004/02/04 16:50:30 ralf Exp $
++# $Id: mrm332.cfg,v 1.9.2.3 2007/01/18 11:27:07 ralf Exp $
+#
+
+include $(RTEMS_ROOT)/make/custom/default.cfg
+# and (hopefully) optimize for it.
+CPU_CFLAGS = -mcpu32
+
-+# optimize flag: typically -0, could use -O4 or -fast, -O4 is ok for RTEMS
-+CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
++# optimize flag: typically -O2
++CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
+
+# The following are definitions of make-exe which will work using ld as
-+# is currently required. It is expected that as of gcc 2.8, the end user
-+# will be able to override parts of the compilers specs and link using gcc.
++# is currently required.
+
+ifeq ($(MRM_IN_ROM),yes)
+# Build a rommable image - move the .data section after the .text section
+ /\.text/ { base = $$4 ; size = $$3 };\
+ END { printf("0x%x", h2d(base) + h2d(size)) }'\
+ ` $(basename $@).pxe $(basename $@).nxe
-+ $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
-+ sed -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
++ $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).srec
++ sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \
+ $(PACKHEX) > $(basename $@).exe
+ $(NM) -g -n $(basename $@).pxe > $(basename $@).pnum
+ $(NM) -g -n $(basename $@).nxe > $(basename $@).num
+define make-exe
+ $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) -o $(basename $@).nxe \
+ $(LINK_OBJS) $(LINK_LIBS)
-+ $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).i
++ $(OBJCOPY) -O srec $(basename $@).nxe $(basename $@).srec
+# m68k-rtems-objdump -dxC $(basename $@).nxe > $(basename $@).dump
-+ sed -e 's/.$$//' -e '/^S0/d' $(basename $@).i | \
++ sed -e 's/.$$//' -e '/^S0/d' $(basename $@).srec | \
+ $(PACKHEX) > $(basename $@).exe
+ $(NM) -g -n $(basename $@).nxe > $(basename $@).num
+ $(SIZE) $(basename $@).nxe
+# Miscellaneous additions go here
Index: rtems/c/src/lib/libbsp/m68k/mo376/console/sci.h
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/console/sci.h
-@@ -0,0 +1,231 @@
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/console/sci.h 2007-08-14 17:20:30.000000000 +0200
+@@ -0,0 +1,234 @@
+/****************************************************************************
+* File: sci.h
+*
+*
+* Note: See bsp.h,confdefs.h,system.h for installing drivers into RTEMS.
+*
-+* $Id: sci.h,v 1.4 2004/04/21 16:01:35 ralf Exp $
++* $Id: sci.h,v 1.5 2006/09/11 21:43:55 joel Exp $
+****************************************************************************/
+
+#ifndef _sci_h_
+ I'm still working on these...
+*******************************************************************************/
+
-+#define SCI_IOCTL_PARITY_NONE 0x00 // no parity bit after the data bits
-+#define SCI_IOCTL_PARITY_ODD 0x01 // parity bit added after data bits
-+#define SCI_IOCTL_PARITY_EVEN 0x02 // parity bit added after data bits
-+#define SCI_IOCTL_PARITY_MARK 0x03 // parity bit is lo, -12 volts, logical 1
-+#define SCI_IOCTL_PARITY_SPACE 0x04 // parity bit is hi, +12 volts, logical 0
-+#define SCI_IOCTL_PARITY_FORCED_ON 0x03 // parity bit is forced hi or lo
-+#define SCI_IOCTL_PARITY_FORCED_OFF 0x04 // parity bit is forced hi or lo
++#define SCI_IOCTL_PARITY_NONE 0x00 /* no parity bit after the data bits */
++#define SCI_IOCTL_PARITY_ODD 0x01 /* parity bit added after data bits */
++#define SCI_IOCTL_PARITY_EVEN 0x02 /* parity bit added after data bits */
++#define SCI_IOCTL_PARITY_MARK 0x03 /* parity bit is lo, -12 volts, logical 1 */
++#define SCI_IOCTL_PARITY_SPACE 0x04 /* parity bit is hi, +12 volts, logical 0 */
++#define SCI_IOCTL_PARITY_FORCED_ON 0x03 /* parity bit is forced hi or lo */
++#define SCI_IOCTL_PARITY_FORCED_OFF 0x04 /* parity bit is forced hi or lo */
+
-+#define SCI_IOCTL_BAUD_RATE 0x20 // set the baud rate, arg is baud
++#define SCI_IOCTL_BAUD_RATE 0x20 /* set the baud rate, arg is baud */
+
-+#define SCI_IOCTL_DATA_BITS 0x30 // set the data bits, arg is # bits
++#define SCI_IOCTL_DATA_BITS 0x30 /* set the data bits, arg is # bits */
+
-+#define SCI_IOCTL_STOP_BITS_1 0x40 // 1 stop bit after char frame
-+#define SCI_IOCTL_STOP_BITS_2 0x41 // 2 stop bit after char frame
++#define SCI_IOCTL_STOP_BITS_1 0x40 /* 1 stop bit after char frame */
++#define SCI_IOCTL_STOP_BITS_2 0x41 /* 2 stop bit after char frame */
+
-+#define SCI_IOCTL_MODE_NORMAL 0x50 // normal operating mode
-+#define SCI_IOCTL_MODE_LOOP 0x51 // internal loopback mode
++#define SCI_IOCTL_MODE_NORMAL 0x50 /* normal operating mode */
++#define SCI_IOCTL_MODE_LOOP 0x51 /* internal loopback mode */
+
-+#define SCI_IOCTL_FLOW_NONE 0x60 // no flow control
-+#define SCI_IOCTL_FLOW_RTS_CTS 0x61 // hardware flow control
++#define SCI_IOCTL_FLOW_NONE 0x60 /* no flow control */
++#define SCI_IOCTL_FLOW_RTS_CTS 0x61 /* hardware flow control */
+
-+#define SCI_IOCTL_SEND_BREAK 0x70 // send an rs-232 break
++#define SCI_IOCTL_SEND_BREAK 0x70 /* send an rs-232 break */
+
-+#define SCI_IOCTL_MODE_1200 0x80 // 1200,n,8,1 download mode
-+#define SCI_IOCTL_MODE_9600 0x81 // 9600,n,8,1 download mode
-+#define SCI_IOCTL_MODE_9_BIT 0x82 // 9600,forced,8,1 command mode
++#define SCI_IOCTL_MODE_1200 0x80 /* 1200,n,8,1 download mode */
++#define SCI_IOCTL_MODE_9600 0x81 /* 9600,n,8,1 download mode */
++#define SCI_IOCTL_MODE_9_BIT 0x82 /* 9600,forced,8,1 command mode */
+\f
+
+/*******************************************************************************
+ SCI Registers
+*******************************************************************************/
+
-+// SCI Control Register 0 (SCCR0) $FFFC08
-+
-+// 8 4 2 1 - 8 4 2 1 - 8 4 2 1 - 8 4 2 1
-+// ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
-+// | | | | | | | | | | | | | | | |
-+// | | | | | | | | | | | | | | | +----- 0 baud rate divisor
-+// | | | | | | | | | | | | | | +------- 1 baud rate divisor
-+// | | | | | | | | | | | | | +--------- 2 baud rate divisor
-+// | | | | | | | | | | | | +----------- 3 baud rate divisor
-+// | | | | | | | | | | | |
-+// | | | | | | | | | | | +--------------- 4 baud rate divisor
-+// | | | | | | | | | | +----------------- 5 baud rate divisor
-+// | | | | | | | | | +------------------- 6 baud rate divisor
-+// | | | | | | | | +--------------------- 7 baud rate divisor
-+// | | | | | | | |
-+// | | | | | | | +------------------------- 8 baud rate divisor
-+// | | | | | | +--------------------------- 9 baud rate divisor
-+// | | | | | +----------------------------- 10 baud rate divisor
-+// | | | | +------------------------------- 11 baud rate divisor
-+// | | | |
-+// | | | +----------------------------------- 12 baud rate divisor
-+// | | +------------------------------------- 13 unused
-+// | +--------------------------------------- 14 unused
-+// +----------------------------------------- 15 unused
-+
-+// 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 1 0 0 reset value - (64k baud?)
++/* SCI Control Register 0 (SCCR0) $FFFC08
++
++ 8 4 2 1 - 8 4 2 1 - 8 4 2 1 - 8 4 2 1
++ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
++ | | | | | | | | | | | | | | | |
++ | | | | | | | | | | | | | | | +----- 0 baud rate divisor
++ | | | | | | | | | | | | | | +------- 1 baud rate divisor
++ | | | | | | | | | | | | | +--------- 2 baud rate divisor
++ | | | | | | | | | | | | +----------- 3 baud rate divisor
++ | | | | | | | | | | | |
++ | | | | | | | | | | | +--------------- 4 baud rate divisor
++ | | | | | | | | | | +----------------- 5 baud rate divisor
++ | | | | | | | | | +------------------- 6 baud rate divisor
++ | | | | | | | | +--------------------- 7 baud rate divisor
++ | | | | | | | |
++ | | | | | | | +------------------------- 8 baud rate divisor
++ | | | | | | +--------------------------- 9 baud rate divisor
++ | | | | | +----------------------------- 10 baud rate divisor
++ | | | | +------------------------------- 11 baud rate divisor
++ | | | |
++ | | | +----------------------------------- 12 baud rate divisor
++ | | +------------------------------------- 13 unused
++ | +--------------------------------------- 14 unused
++ +----------------------------------------- 15 unused
++
++ 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 1 0 0 reset value - (64k baud?)
++ */
+
+#define SCI_BAUD_57_6K 9
+#define SCI_BAUD_38_4K 14
+#define SCI_BAUD_1200 437
+\f
+
-+// SCI Control Register 1 (SCCR1) $FFFC0A
-+
-+// 8 4 2 1 - 8 4 2 1 - 8 4 2 1 - 8 4 2 1
-+// ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
-+// | | | | | | | | | | | | | | | |
-+// | | | | | | | | | | | | | | | +----- 0 send a break
-+// | | | | | | | | | | | | | | +------- 1 rcvr wakeup mode
-+// | | | | | | | | | | | | | +--------- 2 rcvr enable
-+// | | | | | | | | | | | | +----------- 3 xmtr enable
-+// | | | | | | | | | | | |
-+// | | | | | | | | | | | +--------------- 4 idle line intr enable
-+// | | | | | | | | | | +----------------- 5 rcvr intr enable
-+// | | | | | | | | | +------------------- 6 xmit complete intr enable
-+// | | | | | | | | +--------------------- 7 xmtr intr enable
-+// | | | | | | | |
-+// | | | | | | | +------------------------- 8 wakeup on address mark
-+// | | | | | | +--------------------------- 9 mode 1=9 bits, 0=8 bits
-+// | | | | | +----------------------------- 10 parity enable 1=on, 0=off
-+// | | | | +------------------------------- 11 parity type 1=odd, 0=even
-+// | | | |
-+// | | | +----------------------------------- 12 idle line select
-+// | | +------------------------------------- 13 wired-or mode
-+// | +--------------------------------------- 14 loop mode
-+// +----------------------------------------- 15 unused
-+
-+// 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 reset value
-+
-+#define SCI_SEND_BREAK 0x0001 // 0000-0000-0000-0001
-+#define SCI_RCVR_WAKEUP 0x0002 // 0000-0000-0000-0010
-+#define SCI_ENABLE_RCVR 0x0004 // 0000-0000-0000-0100
-+#define SCI_ENABLE_XMTR 0x0008 // 0000-0000-0000-1000
-+
-+#define SCI_DISABLE_RCVR 0xFFFB // 1111-1111-1111-1011
-+#define SCI_DISABLE_XMTR 0xFFF7 // 1111-1111-1111-0111
-+
-+#define SCI_ENABLE_INT_IDLE 0x0010 // 0000-0000-0001-0000
-+#define SCI_ENABLE_INT_RX 0x0020 // 0000-0000-0010-0000
-+#define SCI_ENABLE_INT_TX_DONE 0x0040 // 0000-0000-0100-0000
-+#define SCI_ENABLE_INT_TX 0x0080 // 0000-0000-1000-0000
-+
-+#define SCI_DISABLE_INT_ALL 0xFF00 // 1111-1111-0000-0000 ???
-+
-+#define SCI_DISABLE_INT_RX 0xFFDF // 1111-1111-1101-1111
-+#define SCI_CLEAR_RX_INT 0xFFBF // 1111-1111-1011-1111
-+#define SCI_DISABLE_INT_TX 0xFF7F // 1111-1111-0111-1111
-+#define SCI_CLEAR_TDRE 0xFEFF // 1111-1110-1111-1111
-+
-+#define SCI_RCVR_WAKE_ON_MARK 0x0100 // 0000-0001-0000-0000
-+#define SCI_9_DATA_BITS 0x0200 // 0000-0010-0000-0000
-+#define SCI_PARITY_ENABLE 0x0400 // 0000-0100-0000-0000
-+#define SCI_PARITY_ODD 0x0800 // 0000-1000-0000-0000
-+
-+#define SCI_RCVR_WAKE_ON_IDLE 0xFEFF // 1111-1110-1111-1111
-+#define SCI_8_DATA_BITS 0xFDFF // 1111-1101-1111-1111
-+#define SCI_PARITY_DISABLE 0xFBFF // 1111-1011-1111-1111
-+#define SCI_PARITY_EVEN 0xF7FF // 1111-0111-1111-1111
-+
-+#define SCI_PARITY_NONE 0xF3FF // 1111-0011-1111-1111
-+
-+#define SCI_IDLE_LINE_LONG 0x1000 // 0001-0000-0000-0000
-+#define SCI_TXD_OPEN_DRAIN 0x2000 // 0010-0000-0000-0000
-+#define SCI_LOOPBACK_MODE 0x4000 // 0100-0000-0000-0000
-+#define SCI_SCCR1_UNUSED 0x8000 // 1000-0000-0000-0000
++/* SCI Control Register 1 (SCCR1) $FFFC0A
++
++ 8 4 2 1 - 8 4 2 1 - 8 4 2 1 - 8 4 2 1
++ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
++ | | | | | | | | | | | | | | | |
++ | | | | | | | | | | | | | | | +----- 0 send a break
++ | | | | | | | | | | | | | | +------- 1 rcvr wakeup mode
++ | | | | | | | | | | | | | +--------- 2 rcvr enable
++ | | | | | | | | | | | | +----------- 3 xmtr enable
++ | | | | | | | | | | | |
++ | | | | | | | | | | | +--------------- 4 idle line intr enable
++ | | | | | | | | | | +----------------- 5 rcvr intr enable
++ | | | | | | | | | +------------------- 6 xmit complete intr enable
++ | | | | | | | | +--------------------- 7 xmtr intr enable
++ | | | | | | | |
++ | | | | | | | +------------------------- 8 wakeup on address mark
++ | | | | | | +--------------------------- 9 mode 1=9 bits, 0=8 bits
++ | | | | | +----------------------------- 10 parity enable 1=on, 0=off
++ | | | | +------------------------------- 11 parity type 1=odd, 0=even
++ | | | |
++ | | | +----------------------------------- 12 idle line select
++ | | +------------------------------------- 13 wired-or mode
++ | +--------------------------------------- 14 loop mode
++ +----------------------------------------- 15 unused
++
++ 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 reset value
++*/
++
++#define SCI_SEND_BREAK 0x0001 /* 0000-0000-0000-0001 */
++#define SCI_RCVR_WAKEUP 0x0002 /* 0000-0000-0000-0010 */
++#define SCI_ENABLE_RCVR 0x0004 /* 0000-0000-0000-0100 */
++#define SCI_ENABLE_XMTR 0x0008 /* 0000-0000-0000-1000 */
++
++#define SCI_DISABLE_RCVR 0xFFFB /* 1111-1111-1111-1011 */
++#define SCI_DISABLE_XMTR 0xFFF7 /* 1111-1111-1111-0111 */
++
++#define SCI_ENABLE_INT_IDLE 0x0010 /* 0000-0000-0001-0000 */
++#define SCI_ENABLE_INT_RX 0x0020 /* 0000-0000-0010-0000 */
++#define SCI_ENABLE_INT_TX_DONE 0x0040 /* 0000-0000-0100-0000 */
++#define SCI_ENABLE_INT_TX 0x0080 /* 0000-0000-1000-0000 */
++
++#define SCI_DISABLE_INT_ALL 0xFF00 /* 1111-1111-0000-0000 ??? */
++
++#define SCI_DISABLE_INT_RX 0xFFDF /* 1111-1111-1101-1111 */
++#define SCI_CLEAR_RX_INT 0xFFBF /* 1111-1111-1011-1111 */
++#define SCI_DISABLE_INT_TX 0xFF7F /* 1111-1111-0111-1111 */
++#define SCI_CLEAR_TDRE 0xFEFF /* 1111-1110-1111-1111 */
++
++#define SCI_RCVR_WAKE_ON_MARK 0x0100 /* 0000-0001-0000-0000 */
++#define SCI_9_DATA_BITS 0x0200 /* 0000-0010-0000-0000 */
++#define SCI_PARITY_ENABLE 0x0400 /* 0000-0100-0000-0000 */
++#define SCI_PARITY_ODD 0x0800 /* 0000-1000-0000-0000 */
++
++#define SCI_RCVR_WAKE_ON_IDLE 0xFEFF /* 1111-1110-1111-1111 */
++#define SCI_8_DATA_BITS 0xFDFF /* 1111-1101-1111-1111 */
++#define SCI_PARITY_DISABLE 0xFBFF /* 1111-1011-1111-1111 */
++#define SCI_PARITY_EVEN 0xF7FF /* 1111-0111-1111-1111 */
++
++#define SCI_PARITY_NONE 0xF3FF /* 1111-0011-1111-1111 */
++
++#define SCI_IDLE_LINE_LONG 0x1000 /* 0001-0000-0000-0000 */
++#define SCI_TXD_OPEN_DRAIN 0x2000 /* 0010-0000-0000-0000 */
++#define SCI_LOOPBACK_MODE 0x4000 /* 0100-0000-0000-0000 */
++#define SCI_SCCR1_UNUSED 0x8000 /* 1000-0000-0000-0000 */
+\f
+
-+// SCI Status Register (SCSR) $FFFC0C
-+
-+// 8 4 2 1 - 8 4 2 1 - 8 4 2 1 - 8 4 2 1
-+// ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
-+// | | | | | | | | | | | | | | | |
-+// | | | | | | | | | | | | | | | +----- 0 PF - parity error
-+// | | | | | | | | | | | | | | +------- 1 FE - framing error
-+// | | | | | | | | | | | | | +--------- 2 NF - noise flag
-+// | | | | | | | | | | | | +----------- 3 OR - overrun flag
-+// | | | | | | | | | | | |
-+// | | | | | | | | | | | +--------------- 4 IDLE - idle line detected
-+// | | | | | | | | | | +----------------- 5 RAF - rcvr active flag
-+// | | | | | | | | | +------------------- 6 RDRF - rcv data reg full
-+// | | | | | | | | +--------------------- 7 TC - xmt complete flag
-+// | | | | | | | |
-+// | | | | | | | +------------------------- 8 TDRE - xmt data reg empty
-+// | | | | | | +--------------------------- 9 always zero
-+// | | | | | +----------------------------- 10 always zero
-+// | | | | +------------------------------- 11 always zero
-+// | | | |
-+// | | | +----------------------------------- 12 always zero
-+// | | +------------------------------------- 13 always zero
-+// | +--------------------------------------- 14 always zero
-+// +----------------------------------------- 15 always zero
-+
-+// 0 0 0 0 - 0 0 0 1 - 1 0 0 0 - 0 0 0 0 reset value
-+
-+#define SCI_ERROR_PARITY 0x0001 // 0000-0000-0000-0001
-+#define SCI_ERROR_FRAMING 0x0002 // 0000-0000-0000-0010
-+#define SCI_ERROR_NOISE 0x0004 // 0000-0000-0000-0100
-+#define SCI_ERROR_OVERRUN 0x0008 // 0000-0000-0000-1000
-+
-+#define SCI_IDLE_LINE 0x0010 // 0000-0000-0001-0000
-+#define SCI_RCVR_ACTIVE 0x0020 // 0000-0000-0010-0000
-+#define SCI_RCVR_READY 0x0040 // 0000-0000-0100-0000
-+#define SCI_XMTR_IDLE 0x0080 // 0000-0000-1000-0000
-+
-+#define SCI_CLEAR_RX_INT 0xFFBF // 1111-1111-1011-1111
-+
-+#define SCI_XMTR_READY 0x0100 // 0000-0001-0000-0000
-+
-+#define SCI_CLEAR_TDRE 0xFEFF // 1111-1110-1111-1111
-+
-+#define SCI_XMTR_AVAILABLE 0x0180 // 0000-0001-1000-0000
++/* SCI Status Register (SCSR) $FFFC0C
++
++ 8 4 2 1 - 8 4 2 1 - 8 4 2 1 - 8 4 2 1
++ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
++ | | | | | | | | | | | | | | | |
++ | | | | | | | | | | | | | | | +----- 0 PF - parity error
++ | | | | | | | | | | | | | | +------- 1 FE - framing error
++ | | | | | | | | | | | | | +--------- 2 NF - noise flag
++ | | | | | | | | | | | | +----------- 3 OR - overrun flag
++ | | | | | | | | | | | |
++ | | | | | | | | | | | +--------------- 4 IDLE - idle line detected
++ | | | | | | | | | | +----------------- 5 RAF - rcvr active flag
++ | | | | | | | | | +------------------- 6 RDRF - rcv data reg full
++ | | | | | | | | +--------------------- 7 TC - xmt complete flag
++ | | | | | | | |
++ | | | | | | | +------------------------- 8 TDRE - xmt data reg empty
++ | | | | | | +--------------------------- 9 always zero
++ | | | | | +----------------------------- 10 always zero
++ | | | | +------------------------------- 11 always zero
++ | | | |
++ | | | +----------------------------------- 12 always zero
++ | | +------------------------------------- 13 always zero
++ | +--------------------------------------- 14 always zero
++ +----------------------------------------- 15 always zero
++
++ 0 0 0 0 - 0 0 0 1 - 1 0 0 0 - 0 0 0 0 reset value
++*/
++
++#define SCI_ERROR_PARITY 0x0001 /* 0000-0000-0000-0001 */
++#define SCI_ERROR_FRAMING 0x0002 /* 0000-0000-0000-0010 */
++#define SCI_ERROR_NOISE 0x0004 /* 0000-0000-0000-0100 */
++#define SCI_ERROR_OVERRUN 0x0008 /* 0000-0000-0000-1000 */
++
++#define SCI_IDLE_LINE 0x0010 /* 0000-0000-0001-0000 */
++#define SCI_RCVR_ACTIVE 0x0020 /* 0000-0000-0010-0000 */
++#define SCI_RCVR_READY 0x0040 /* 0000-0000-0100-0000 */
++#define SCI_XMTR_IDLE 0x0080 /* 0000-0000-1000-0000 */
++
++#define SCI_CLEAR_RX_INT 0xFFBF /* 1111-1111-1011-1111 */
++
++#define SCI_XMTR_READY 0x0100 /* 0000-0001-0000-0000 */
++
++#define SCI_CLEAR_TDRE 0xFEFF /* 1111-1110-1111-1111 */
++
++#define SCI_XMTR_AVAILABLE 0x0180 /* 0000-0001-1000-0000 */
+
+\f
+
+extern "C" {
+#endif
+
-+// look at console_open to see how this is called
++/* look at console_open to see how this is called */
+
+const rtems_termios_callbacks * SciGetTermiosHandlers( int32_t polled );
+
+/* SCI interrupt */
+
-+//rtems_isr SciIsr( rtems_vector_number vector );
++/*rtems_isr SciIsr( rtems_vector_number vector ); */
+
-+//int32_t SciOpenPolled ( int32_t major, int32_t minor, void *arg );
-+//int32_t SciOpenInterrupt ( int32_t major, int32_t minor, void *arg );
++/*int32_t SciOpenPolled ( int32_t major, int32_t minor, void *arg ); */
++/*int32_t SciOpenInterrupt ( int32_t major, int32_t minor, void *arg ); */
+
-+//int32_t SciClose ( int32_t major, int32_t minor, void *arg );
++/*int32_t SciClose ( int32_t major, int32_t minor, void *arg ); */
+
-+//int32_t SciWritePolled ( int32_t minor, const char *buf, int32_t len );
-+//int32_t SciWriteInterrupt( int32_t minor, const char *buf, int32_t len );
++/*int32_t SciWritePolled ( int32_t minor, const char *buf, int32_t len ); */
++/*int32_t SciWriteInterrupt( int32_t minor, const char *buf, int32_t len ); */
+
-+//int32_t SciReadPolled ( int32_t minor );
++/*int32_t SciReadPolled ( int32_t minor ); */
+
-+//int32_t SciSetAttributes ( int32_t minor, const struct termios *t );
++/*int32_t SciSetAttributes ( int32_t minor, const struct termios *t ); */
+
+#ifdef __cplusplus
+}
+#endif
+
-+#endif // _sci_h_
++#endif /* _sci_h_ */
Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,200 @@
+/* linkcmds
+ *
+}
Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/except_vect_332_ROM.S
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/startup/except_vect_332_ROM.S
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/startup/except_vect_332_ROM.S 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,293 @@
+/*
+ * $Id: except_vect_332_ROM.S,v 1.3 2004/04/21 16:01:35 ralf Exp $
+ not vectored to reboot or did not return. */
Index: rtems/c/src/lib/libbsp/m68k/mo376/console/console.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/console/console.c
-@@ -0,0 +1,176 @@
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/console/console.c 2007-08-14 17:20:30.000000000 +0200
+@@ -0,0 +1,174 @@
+/*
+ * This file contains the generic console driver shell used
+ * by all console drivers using libchip.
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
-+ * $Id: console.c,v 1.7 2004/04/21 16:01:35 ralf Exp $
++ * $Id: console.c,v 1.8 2006/09/11 21:43:53 joel Exp $
+ */
+
+#include <bsp.h>
+#include <rtems/libio.h>
+#include <termios.h>
+#include "sci.h"
-+//#include "../../../../../../rtems/c/src/lib/libbsp/m68k/opti/console/duart.h"
-+//#include "../../../../../../rtems/c/src/lib/libc/libio_.h"
+
+/*PAGE
+ *
+
+ return RTEMS_SUCCESSFUL;
+}
-Index: rtems/c/src/lib/libbsp/m68k/mo376/.cvsignore
-===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/.cvsignore
-@@ -0,0 +1,14 @@
-+aclocal.m4
-+autom4te*.cache
-+config.cache
-+config.guess
-+config.log
-+config.status
-+config.sub
-+configure
-+depcomp
-+install-sh
-+Makefile
-+Makefile.in
-+missing
-+mkinstalldirs
Index: rtems/c/src/lib/libbsp/m68k/mo376/start/start.S
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/start/start.S
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/start/start.S 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,150 @@
+/*
+ * $Id
+#endif
Index: rtems/c/src/lib/libbsp/m68k/mo376/misc/dotests
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/misc/dotests
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/misc/dotests 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,15 @@
+#! /bin/bash
+#
+kill -9 $cpJob
Index: rtems/c/src/lib/libbsp/m68k/mo376/include/bsp.h
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/include/bsp.h
-@@ -0,0 +1,140 @@
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/include/bsp.h 2007-08-14 17:20:30.000000000 +0200
+@@ -0,0 +1,139 @@
+/* bsp.h
+ *
+ * This include file contains all mrm board IO definitions.
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
-+ * $Id: bsp.h,v 1.13 2005/05/26 05:31:17 ralf Exp $
++ * $Id: bsp.h,v 1.14 2006/03/17 10:11:36 ralf Exp $
+ */
+
+#ifndef _BSP_H
+#endif
+
+#endif
-+/* end of include file */
Index: rtems/c/src/lib/libbsp/m68k/mo376/misc/interr.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/misc/interr.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/misc/interr.c 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,99 @@
+/*
+ * Internal Error Handler
+}
Index: rtems/c/src/lib/libbsp/m68k/mo376/ChangeLog
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/ChangeLog
-@@ -0,0 +1,437 @@
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/ChangeLog 2007-08-14 17:20:30.000000000 +0200
+@@ -0,0 +1,455 @@
++2006-12-02 Ralf Corsépius <ralf.corsepius@rtems.org>
++
++ * configure.ac: New BUG-REPORT address.
++
++2006-10-20 Ralf Corsépius <ralf.corsepius@rtems.org>
++
++ * Makefile.am: Remove superfluous -DASM.
++
++2006-10-19 Ralf Corsépius <ralf.corsepius@rtems.org>
++
++ * configure.ac: Require automake-1.10. Require autoconf-2.60.
++
++2006-09-11 Joel Sherrill <joel@OARcorp.com>
++
++ * console/console.c, console/sci.c, console/sci.h, spurious/spinit.c,
++ startup/bspclean.c, startup/start_c.c: Convert C++ style comments to
++ C style.
++
+2006-02-08 Joel Sherrill <joel@OARcorp.com>
+
+ * startup/linkcmds, startup/linkcmds_ROM: Add sections required by
+
Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/bspclean.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/startup/bspclean.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/startup/bspclean.c 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,27 @@
+/* bsp_cleanup()
+ *
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
-+ * $Id: bspclean.c,v 1.4 2004/04/21 10:42:52 ralf Exp $
++ * $Id: bspclean.c,v 1.5 2006/09/11 21:43:56 joel Exp $
+ */
+
+#include <bsp.h>
+{
+ /* interrupt driven stdio must be flushed */
+ _CPU_ISR_Set_level( 7 );
-+ //_UART_flush();
++ /*_UART_flush(); */
+}
Index: rtems/c/src/lib/libbsp/m68k/mo376/timer/timer.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/timer/timer.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/timer/timer.c 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,81 @@
+/* Timer_init()
+ *
+}
Index: rtems/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,128 @@
+/* Clock_init()
+ *
+}
Index: rtems/c/src/lib/libbsp/m68k/mo376/misc/gdbinit68
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/misc/gdbinit68
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/misc/gdbinit68 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,16 @@
+#
+# $Id: gdbinit68,v 1.1 2001/05/25 16:28:46 joel Exp $
+q
Index: rtems/c/src/lib/libbsp/m68k/mo376/configure.ac
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/configure.ac
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/configure.ac 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,20 @@
+## Process this file with autoconf to produce a configure script.
+##
-+## $Id: configure.ac,v 1.14 2004/09/24 06:32:09 ralf Exp $
++## $Id: configure.ac,v 1.14.2.2 2006/12/02 06:04:46 ralf Exp $
+
-+AC_PREREQ(2.59)
-+AC_INIT([rtems-c-src-lib-libbsp-m68k-mrm332],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
++AC_PREREQ(2.60)
++AC_INIT([rtems-c-src-lib-libbsp-m68k-mrm332],[_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.9])
++AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.10])
+RTEMS_BSP_CONFIGURE
+
+RTEMS_PROG_CC_FOR_TARGET
+AC_OUTPUT
Index: rtems/c/src/lib/libbsp/m68k/mo376/README
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/README
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/README 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,24 @@
+#
+# $Id: README,v 1.1 2001/05/25 16:28:46 joel Exp $
+
Index: rtems/c/src/lib/libbsp/m68k/mo376/Makefile.am
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/Makefile.am
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/Makefile.am 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,68 @@
+##
-+## $Id: Makefile.am,v 1.24 2006/01/12 10:12:30 ralf Exp $
++## $Id: Makefile.am,v 1.24.2.1 2006/10/20 11:54:57 ralf Exp $
+##
+
+ACLOCAL_AMFLAGS = -I ../../../../aclocal
+
+EXTRA_DIST += start/start.S
+start.$(OBJEXT): start/start.S
-+ $(CPPASCOMPILE) -DASM -o $@ -c $<
++ $(CPPASCOMPILE) -o $@ -c $<
+
+project_lib_DATA = start.$(OBJEXT)
+
+include $(top_srcdir)/../../../../automake/local.am
Index: rtems/c/src/lib/libbsp/m68k/mo376/console/sci.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/console/sci.c
-@@ -0,0 +1,1620 @@
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/console/sci.c 2007-08-14 17:20:30.000000000 +0200
+@@ -0,0 +1,1596 @@
+/*****************************************************************************
+* File: sci.c
+*
+*
+* Note: See bsp.h,confdefs.h,system.h for installing drivers into RTEMS.
+*
-+* $Id: sci.c,v 1.10 2005/01/05 18:12:35 ralf Exp $
++* $Id: sci.c,v 1.11 2006/09/11 21:43:53 joel Exp $
+*
+*****************************************************************************/
+\f
-+
-+/*****************************************************************************
-+ Compiler Options for the incurably curious
-+*****************************************************************************/
-+
-+/*
-+/opt/rtems/bin/m68k-rtems-gcc
-+ --pipe # use pipes, not tmp files
-+ -B../../../../../../../../opti/lib/ # where the library is
-+ -specs bsp_specs # ???
-+ -qrtems # ???
-+ -g # add debugging info
-+ -Wall # issue all warnings
-+ -fasm # allow inline asm???
-+ -DCONSOLE_SCI # for opti-r box/rev b proto
-+ -mcpu32 # machine = motorola cpu 32
-+ -c # compile, don't link
-+ -O4 # max optimization
-+ -fomit-frame-pointer # stack frames are optional
-+ -o o-optimize/sci.o # the object file
-+ ../../../../../../../../../rtems/c/src/lib/libbsp/m68k/opti/console/sci.c
-+*/
-+\f
-+
+/*****************************************************************************
+ Overview of serial port console terminal input/output
+*****************************************************************************/
+#include <libchip/serial.h>
+#include <libchip/sersupp.h>
+#include "sci.h"
-+//#include "../misc/include/cpu332.h"
++/*#include "../misc/include/cpu332.h" */
+\f
+
+/*****************************************************************************
+ Section B - Manifest Constants
+*****************************************************************************/
+
-+#define SCI_MINOR 0 // minor device number
++#define SCI_MINOR 0 /* minor device number */
+
-+// IMPORTANT - if the device driver api is opened, it means the sci is being
-+// used for direct hardware access, so other users (like termios) get ignored
-+
-+#define DRIVER_CLOSED 0 // the device driver api is closed
-+#define DRIVER_OPENED 1 // the device driver api is opened
++/* IMPORTANT - if the device driver api is opened, it means the sci is being
++ * used for direct hardware access, so other users (like termios) get ignored
++ */
++#define DRIVER_CLOSED 0 /* the device driver api is closed */
++#define DRIVER_OPENED 1 /* the device driver api is opened */
+
-+// system clock definitions, i dont have documentation on this...
++/* system clock definitions, i dont have documentation on this... */
+
-+#if 0 // Not needed, this is provided in mrm332.h
-+#define XTAL 32768.0 // crystal frequency in Hz
-+#define NUMB_W 0 // system clock parameters
++#if 0 /* Not needed, this is provided in mrm332.h */
++#define XTAL 32768.0 /* crystal frequency in Hz */
++#define NUMB_W 0 /* system clock parameters */
+#define NUMB_X 1
-+//efine NUMB_Y 0x38 // for 14.942 Mhz
-+#define NUMB_Y 0x3F // for 16.777 Mhz
++#define NUMB_Y 0x38 /* for 14.942 Mhz */
++#define NUMB_Y 0x3F /* for 16.777 Mhz */
+
+#define SYS_CLOCK (XTAL * 4.0 * (NUMB_Y+1) * (1 << (2 * NUMB_W + NUMB_X)))
+
+
+void SCI_output_char(char c);
+
-+rtems_isr SciIsr( rtems_vector_number vector ); // interrupt handler
++/*rtems_isr SciIsr( rtems_vector_number vector ); interrupt handler */
+
+const rtems_termios_callbacks * SciGetTermiosHandlers( int32_t polled );
+
-+rtems_device_driver SciInitialize (); // device driver api
-+rtems_device_driver SciOpen (); // device driver api
-+rtems_device_driver SciClose (); // device driver api
-+rtems_device_driver SciRead (); // device driver api
-+rtems_device_driver SciWrite (); // device driver api
-+rtems_device_driver SciControl (); // device driver api
-+
-+int32_t SciInterruptOpen(); // termios api
-+int32_t SciInterruptClose(); // termios api
-+int32_t SciInterruptWrite(); // termios api
++rtems_device_driver SciInitialize( /* device driver api */
++ rtems_device_major_number, rtems_device_minor_number, void *);
++rtems_device_driver SciOpen( /* device driver api */
++ rtems_device_major_number, rtems_device_minor_number, void *);
++rtems_device_driver SciClose( /* device driver api */
++ rtems_device_major_number, rtems_device_minor_number, void *);
++rtems_device_driver SciRead( /* device driver api */
++ rtems_device_major_number, rtems_device_minor_number, void *);
++rtems_device_driver SciWrite( /* device driver api */
++ rtems_device_major_number, rtems_device_minor_number, void *);
++rtems_device_driver SciControl( /* device driver api */
++ rtems_device_major_number, rtems_device_minor_number, void *);
++rtems_device_driver SciRead (
++ rtems_device_major_number, rtems_device_minor_number, void *);
+
-+int32_t SciSetAttributes(); // termios api
++int SciInterruptOpen(int, int, void *); /* termios api */
++int SciInterruptClose(int, int, void *); /* termios api */
++int SciInterruptWrite(int, const char *, int); /* termios api */
+
-+int32_t SciPolledOpen(); // termios api
-+int32_t SciPolledClose(); // termios api
-+int32_t SciPolledRead(); // termios api
-+int32_t SciPolledWrite(); // termios api
++int SciSetAttributes(int, const struct termios*); /* termios api */
++int SciPolledOpen(int, int, void *); /* termios api */
++int SciPolledClose(int, int, void *); /* termios api */
++int SciPolledRead(int); /* termios api */
++int SciPolledWrite(int, const char *, int); /* termios api */
+
-+static void SciSetBaud(uint32_t rate); // hardware routine
-+static void SciSetDataBits(uint16_t bits); // hardware routine
-+static void SciSetParity(uint16_t parity); // hardware routine
++static void SciSetBaud(uint32_t rate); /* hardware routine */
++static void SciSetDataBits(uint16_t bits); /* hardware routine */
++static void SciSetParity(uint16_t parity); /* hardware routine */
+
-+static void inline SciDisableAllInterrupts( void ); // hardware routine
-+static void inline SciDisableTransmitInterrupts( void );// hardware routine
-+static void inline SciDisableReceiveInterrupts( void ); // hardware routine
++static void inline SciDisableAllInterrupts( void ); /* hardware routine */
++static void inline SciDisableTransmitInterrupts( void );/* hardware routine */
++static void inline SciDisableReceiveInterrupts( void ); /* hardware routine */
+
-+static void inline SciEnableTransmitInterrupts( void ); // hardware routine
-+static void inline SciEnableReceiveInterrupts( void ); // hardware routine
++static void inline SciEnableTransmitInterrupts( void ); /* hardware routine */
++static void inline SciEnableReceiveInterrupts( void ); /* hardware routine */
+
-+static void inline SciDisableReceiver( void ); // hardware routine
-+static void inline SciDisableTransmitter( void ); // hardware routine
++static void inline SciDisableReceiver( void ); /* hardware routine */
++static void inline SciDisableTransmitter( void ); /* hardware routine */
+
-+static void inline SciEnableReceiver( void ); // hardware routine
-+static void inline SciEnableTransmitter( void ); // hardware routine
++static void inline SciEnableReceiver( void ); /* hardware routine */
++static void inline SciEnableTransmitter( void ); /* hardware routine */
+
-+void SciWriteCharWait ( uint8_t); // hardware routine
-+void SciWriteCharNoWait( uint8_t); // hardware routine
++void SciWriteCharWait ( uint8_t ); /* hardware routine */
++void SciWriteCharNoWait( uint8_t ); /* hardware routine */
+
-+uint8_t inline SciCharAvailable( void ); // hardware routine
++uint8_t inline SciCharAvailable( void ); /* hardware routine */
+
-+uint8_t inline SciReadCharWait( void ); // hardware routine
-+uint8_t inline SciReadCharNoWait( void ); // hardware routine
++uint8_t inline SciReadCharWait( void ); /* hardware routine */
++uint8_t inline SciReadCharNoWait( void ); /* hardware routine */
+
-+void SciSendBreak( void ); // test routine
++void SciSendBreak( void ); /* test routine */
+
-+static int8_t SciRcvBufGetChar(); // circular rcv buf
-+static void SciRcvBufPutChar( uint8_t); // circular rcv buf
-+//atic void SciRcvBufFlush( void ); // circular rcv buf
++static int8_t SciRcvBufGetChar(); /* circular rcv buf */
++static void SciRcvBufPutChar( uint8_t); /* circular rcv buf */
++#if 0
++static void SciRcvBufFlush( void ); /* unused routine */
++#endif
+
-+void SciUnitTest(); // test routine
-+void SciPrintStats(); // test routine
++void SciUnitTest(); /* test routine */
++void SciPrintStats(); /* test routine */
+\f
+
+/*****************************************************************************
+
+static struct rtems_termios_tty *SciTermioTty;
+
-+static uint8_t SciInited = 0; // has the driver been inited
++static uint8_t SciInited = 0; /* has the driver been inited */
+
-+static uint8_t SciOpened; // has the driver been opened
++static uint8_t SciOpened; /* has the driver been opened */
+
-+static uint8_t SciMajor; // major device number
++static uint8_t SciMajor; /* major device number */
+
-+static uint16_t SciBaud; // current value in baud register
++static uint16_t SciBaud; /* current value in baud register */
+
-+static uint32_t SciBytesIn = 0; // bytes received
-+static uint32_t SciBytesOut = 0; // bytes transmitted
++static uint32_t SciBytesIn = 0; /* bytes received */
++static uint32_t SciBytesOut = 0; /* bytes transmitted */
+
-+static uint32_t SciErrorsParity = 0; // error counter
-+static uint32_t SciErrorsNoise = 0; // error counter
-+static uint32_t SciErrorsFraming = 0; // error counter
-+static uint32_t SciErrorsOverrun = 0; // error counter
++static uint32_t SciErrorsParity = 0; /* error counter */
++static uint32_t SciErrorsNoise = 0; /* error counter */
++static uint32_t SciErrorsFraming = 0; /* error counter */
++static uint32_t SciErrorsOverrun = 0; /* error counter */
+
+#if defined(CONSOLE_SCI)
+
-+// this is what rtems printk uses to do polling based output
++/* this is what rtems printk uses to do polling based output */
+
+BSP_output_char_function_type BSP_output_char = SCI_output_char;
+BSP_polling_getchar_function_type BSP_poll_char = NULL;
+
+#endif
+
-+// cvs id string so you can use the unix ident command on the object
++/* cvs id string so you can use the unix ident command on the object */
+
+#ifdef ID_STRINGS
-+static const char SciIdent[]="$Id: sci.c,v 1.10 2005/01/05 18:12:35 ralf Exp $";
++static const char SciIdent[]="$Id: sci.c,v 1.11 2006/09/11 21:43:53 joel Exp $";
+#endif
+\f
+
+ Section G - A circular buffer for rcv chars when the driver interface is used.
+*****************************************************************************/
+
-+// it is trivial to wrap your buffer pointers when size is a power of two
-+
-+#define SCI_RCV_BUF_SIZE 256 // must be a power of 2 !!!
++/* it is trivial to wrap your buffer pointers when size is a power of two */
+
-+// if someone opens the sci device using the device driver interface,
-+// then the receive data interrupt handler will put characters in this buffer
-+// instead of sending them up to the termios module for the console
++#define SCI_RCV_BUF_SIZE 256 /* must be a power of 2 !!! */
+
++/* if someone opens the sci device using the device driver interface,
++ * then the receive data interrupt handler will put characters in this buffer
++ * instead of sending them up to the termios module for the console
++ */
+static uint8_t SciRcvBuffer[SCI_RCV_BUF_SIZE];
+
-+static uint8_t SciRcvBufPutIndex = 0; // array index to put in next char
++static uint8_t SciRcvBufPutIndex = 0; /* array index to put in next char */
+
-+static uint8_t SciRcvBufGetIndex = 0; // array index to take out next char
++static uint8_t SciRcvBufGetIndex = 0; /* array index to take out next char */
+
-+static uint16_t SciRcvBufCount = 0; // how many bytes are in the buffer
++static uint16_t SciRcvBufCount = 0; /* how many bytes are in the buffer */
+
+\f
+
+
+static const rtems_termios_callbacks SciInterruptCallbacks =
+{
-+ SciInterruptOpen, // first open
-+ SciInterruptClose, // last close
-+ NULL, // polled read (not required)
-+ SciInterruptWrite, // write
-+ SciSetAttributes, // set attributes
-+ NULL, // stop remote xmit
-+ NULL, // start remote xmit
-+ TRUE // output uses interrupts
++ SciInterruptOpen, /* first open */
++ SciInterruptClose, /* last close */
++ NULL, /* polled read (not required) */
++ SciInterruptWrite, /* write */
++ SciSetAttributes, /* set attributes */
++ NULL, /* stop remote xmit */
++ NULL, /* start remote xmit */
++ TRUE /* output uses interrupts */
+};
+
+/*****************************************************************************
+
+static const rtems_termios_callbacks SciPolledCallbacks =
+{
-+ SciPolledOpen, // first open
-+ SciPolledClose, // last close
-+ SciPolledRead, // polled read
-+ SciPolledWrite, // write
-+ SciSetAttributes, // set attributes
-+ NULL, // stop remote xmit
-+ NULL, // start remote xmit
-+ FALSE // output uses interrupts
++ SciPolledOpen, /* first open */
++ SciPolledClose, /* last close */
++ SciPolledRead, /* polled read */
++ SciPolledWrite, /* write */
++ SciSetAttributes, /* set attributes */
++ NULL, /* stop remote xmit */
++ NULL, /* start remote xmit */
++ FALSE /* output uses interrupts */
+};
+\f
+
-+/////////////////////////////////////////////////////////////////////////////
-+//
-+// SECTION 0
-+// MISCELLANEOUS ROUTINES
-+//
-+/////////////////////////////////////////////////////////////////////////////
++/*
++ * SECTION 0
++ * MISCELLANEOUS ROUTINES
++ */
+
+/****************************************************************************
-+* Func: SCI_output_char
-+* Desc: used by rtems printk function to send a char to the uart
-+* Inputs: the character to transmit
-+* Outputs: none
-+* Errors: none
-+* Scope: public
-+****************************************************************************/
++ * Func: SCI_output_char
++ * Desc: used by rtems printk function to send a char to the uart
++ * Inputs: the character to transmit
++ * Outputs: none
++ * Errors: none
++ * Scope: public
++ ****************************************************************************/
+
+void SCI_output_char(char c)
+{
-+// ( minor device number, pointer to the character, length )
++/* ( minor device number, pointer to the character, length ) */
+
+ SciPolledWrite( SCI_MINOR, &c, 1);
+
+{
+ if ( polled )
+ {
-+ return &SciPolledCallbacks; // polling based
++ return &SciPolledCallbacks; /* polling based */
+ }
+ else
+ {
-+ return &SciInterruptCallbacks; // interrupt driven
++ return &SciInterruptCallbacks; /* interrupt driven */
+ }
+}
+\f
+ if ( (*SCSR) & SCI_ERROR_NOISE ) SciErrorsNoise ++;
+ if ( (*SCSR) & SCI_ERROR_OVERRUN ) SciErrorsOverrun ++;
+
-+ // see if it was a transmit interrupt
++ /* see if it was a transmit interrupt */
+
-+ if ( (*SCSR) & SCI_XMTR_AVAILABLE ) // data reg empty, xmt complete
++ if ( (*SCSR) & SCI_XMTR_AVAILABLE ) /* data reg empty, xmt complete */
+ {
+ SciDisableTransmitInterrupts();
+
-+ // tell termios module that the charcter was sent
-+ // he will call us later to transmit more if there are any
++ /* tell termios module that the charcter was sent */
++ /* he will call us later to transmit more if there are any */
+
+ if (rtems_termios_dequeue_characters( SciTermioTty, 1 ))
+ {
-+ // there are more bytes to transmit so enable TX interrupt
++ /* there are more bytes to transmit so enable TX interrupt */
+
+ SciEnableTransmitInterrupts();
+ }
+ }
+
-+ // see if it was a receive interrupt
-+ // on the sci uart we just get one character per interrupt
++ /* see if it was a receive interrupt */
++ /* on the sci uart we just get one character per interrupt */
+
-+ while ( SciCharAvailable() ) // char in data register?
++ while ( SciCharAvailable() ) /* char in data register? */
+ {
-+ ch = SciReadCharNoWait(); // get the char from the uart
++ ch = SciReadCharNoWait(); /* get the char from the uart */
+
-+ // IMPORTANT!!!
-+ // either send it to the termios module or keep it locally
++ /* IMPORTANT!!! */
++ /* either send it to the termios module or keep it locally */
+
-+ if ( SciOpened == DRIVER_OPENED ) // the driver is open
++ if ( SciOpened == DRIVER_OPENED ) /* the driver is open */
+ {
-+ SciRcvBufPutChar(ch); // keep it locally
++ SciRcvBufPutChar(ch); /* keep it locally */
+ }
-+ else // put in termios buffer
++ else /* put in termios buffer */
+ {
-+ rtems_termios_enqueue_raw_characters( SciTermioTty, &ch, 1 );
++ char c = (char) ch;
++ rtems_termios_enqueue_raw_characters( SciTermioTty, &c, 1 );
+ }
+
-+ *SCSR &= SCI_CLEAR_RX_INT; // clear the interrupt
++ *SCSR &= SCI_CLEAR_RX_INT; /* clear the interrupt */
+ }
+}
+\f
+
-+/////////////////////////////////////////////////////////////////////////////
-+//
-+// SECTION 1
-+// ROUTINES TO MANIPULATE THE CIRCULAR BUFFER
-+//
-+/////////////////////////////////////////////////////////////////////////////
++/*
++ * SECTION 1
++ * ROUTINES TO MANIPULATE THE CIRCULAR BUFFER
++ */
+
+/****************************************************************************
+* Func: SciRcvBufGetChar
+
+ if ( SciRcvBufCount == 0 )
+ {
-+ rtems_fatal_error_occurred(0xDEAD); // check the count first!
++ rtems_fatal_error_occurred(0xDEAD); /* check the count first! */
+ }
+
-+ rtems_interrupt_disable( level ); // disable interrupts
++ rtems_interrupt_disable( level ); /* disable interrupts */
+
-+ ch = SciRcvBuffer[SciRcvBufGetIndex]; // get next byte
++ ch = SciRcvBuffer[SciRcvBufGetIndex]; /* get next byte */
+
-+ SciRcvBufGetIndex++; // bump the index
++ SciRcvBufGetIndex++; /* bump the index */
+
-+ SciRcvBufGetIndex &= SCI_RCV_BUF_SIZE - 1; // and wrap it
++ SciRcvBufGetIndex &= SCI_RCV_BUF_SIZE - 1; /* and wrap it */
+
-+ SciRcvBufCount--; // decrement counter
++ SciRcvBufCount--; /* decrement counter */
+
-+ rtems_interrupt_enable( level ); // restore interrupts
++ rtems_interrupt_enable( level ); /* restore interrupts */
+
-+ return ch; // return the char
++ return ch; /* return the char */
+}
+\f
+
+{
+ rtems_interrupt_level level;
+
-+ if ( SciRcvBufCount == SCI_RCV_BUF_SIZE ) // is there room?
++ if ( SciRcvBufCount == SCI_RCV_BUF_SIZE ) /* is there room? */
+ {
-+ return; // no, throw it away
++ return; /* no, throw it away */
+ }
+
-+ rtems_interrupt_disable( level ); // disable interrupts
++ rtems_interrupt_disable( level ); /* disable interrupts */
+
-+ SciRcvBuffer[SciRcvBufPutIndex] = ch; // put it in the buf
++ SciRcvBuffer[SciRcvBufPutIndex] = ch; /* put it in the buf */
+
-+ SciRcvBufPutIndex++; // bump the index
++ SciRcvBufPutIndex++; /* bump the index */
+
-+ SciRcvBufPutIndex &= SCI_RCV_BUF_SIZE - 1; // and wrap it
++ SciRcvBufPutIndex &= SCI_RCV_BUF_SIZE - 1; /* and wrap it */
+
-+ SciRcvBufCount++; // increment counter
++ SciRcvBufCount++; /* increment counter */
+
-+ rtems_interrupt_enable( level ); // restore interrupts
++ rtems_interrupt_enable( level ); /* restore interrupts */
+
-+ return; // return
++ return; /* return */
+}
+\f
+
+* Scope: private
+****************************************************************************/
+
-+#if 0 // prevents compiler warning
++#if 0 /* prevents compiler warning */
+static void SciRcvBufFlush( void )
+{
+ rtems_interrupt_level level;
+
-+ rtems_interrupt_disable( level ); // disable interrupts
++ rtems_interrupt_disable( level ); /* disable interrupts */
+
+ memset( SciRcvBuffer, 0, sizeof(SciRcvBuffer) );
+
-+ SciRcvBufPutIndex = 0; // clear
++ SciRcvBufPutIndex = 0; /* clear */
+
-+ SciRcvBufGetIndex = 0; // clear
++ SciRcvBufGetIndex = 0; /* clear */
+
-+ SciRcvBufCount = 0; // clear
++ SciRcvBufCount = 0; /* clear */
+
-+ rtems_interrupt_enable( level ); // restore interrupts
++ rtems_interrupt_enable( level ); /* restore interrupts */
+
-+ return; // return
++ return; /* return */
+}
+#endif
+\f
+
-+/////////////////////////////////////////////////////////////////////////////
-+//
-+// SECTION 2
-+// INTERRUPT BASED ENTRY POINTS FOR THE TERMIOS MODULE
-+//
-+/////////////////////////////////////////////////////////////////////////////
++/*
++ *
++ * SECTION 2
++ * INTERRUPT BASED ENTRY POINTS FOR THE TERMIOS MODULE
++ */
+
+/****************************************************************************
+* Func: SciInterruptOpen
+* Scope: public API
+****************************************************************************/
+
-+int32_t SciInterruptOpen(
-+ int32_t major,
-+ int32_t minor,
-+ void *arg
++int SciInterruptOpen(
++ int major,
++ int minor,
++ void *arg
+)
+{
+ rtems_libio_open_close_args_t * args = arg;
+ rtems_isr_entry old_vector;
+
-+ if ( minor != SCI_MINOR ) // check minor device num
++ if ( minor != SCI_MINOR ) /* check minor device num */
+ {
+ return -1;
+ }
+
-+ if ( !args ) // must have args
++ if ( !args ) /* must have args */
+ {
+ return -1;
+ }
+
-+ SciTermioTty = args->iop->data1; // save address of struct
++ SciTermioTty = args->iop->data1; /* save address of struct */
+
-+ SciDisableAllInterrupts(); // turn off sci interrupts
++ SciDisableAllInterrupts(); /* turn off sci interrupts */
+
-+ // THIS IS ACTUALLY A BAD THING - SETTING LINE PARAMETERS HERE
-+ // IT SHOULD BE DONE THROUGH TCSETATTR() WHEN THE CONSOLE IS OPENED!!!
++ /* THIS IS ACTUALLY A BAD THING - SETTING LINE PARAMETERS HERE */
++ /* IT SHOULD BE DONE THROUGH TCSETATTR() WHEN THE CONSOLE IS OPENED!!! */
+
-+// SciSetBaud(115200); // set the baud rate
-+// SciSetBaud( 57600); // set the baud rate
-+// SciSetBaud( 38400); // set the baud rate
-+SciSetBaud( 19200); // set the baud rate
-+// SciSetBaud( 9600); // set the baud rate
++/* SciSetBaud(115200); set the baud rate */
++/* SciSetBaud( 57600); set the baud rate */
++/* SciSetBaud( 38400); set the baud rate */
++ SciSetBaud( 19200); /* set the baud rate */
++/* SciSetBaud( 9600); set the baud rate */
+
-+ SciSetParity(SCI_PARITY_NONE); // set parity to none
++ SciSetParity(SCI_PARITY_NONE); /* set parity to none */
+
-+ SciSetDataBits(SCI_8_DATA_BITS); // set data bits to 8
++ SciSetDataBits(SCI_8_DATA_BITS); /* set data bits to 8 */
+
-+ // Install our interrupt handler into RTEMS, where does 66 come from?
++ /* Install our interrupt handler into RTEMS, where does 66 come from? */
+
+ rtems_interrupt_catch( SciIsr, 66, &old_vector );
+
+ *QIVR &= 0xf8;
+ *QILR |= 0x06 & 0x07;
+
-+ SciEnableTransmitter(); // enable the transmitter
++ SciEnableTransmitter(); /* enable the transmitter */
+
-+ SciEnableReceiver(); // enable the receiver
++ SciEnableReceiver(); /* enable the receiver */
+
-+ SciEnableReceiveInterrupts(); // enable rcv interrupts
++ SciEnableReceiveInterrupts(); /* enable rcv interrupts */
+
+ return RTEMS_SUCCESSFUL;
+}
+* Scope: public - termio entry point
+****************************************************************************/
+
-+int32_t SciInterruptClose(
-+ int32_t major,
-+ int32_t minor,
-+ void *arg
++int SciInterruptClose(
++ int major,
++ int minor,
++ void *arg
+)
+{
+ SciDisableAllInterrupts();
+* Scope: public API
+****************************************************************************/
+
-+int32_t SciInterruptWrite(
-+ int32_t minor,
++int SciInterruptWrite(
++ int minor,
+ const char *buf,
-+ int32_t len
++ int len
+)
+{
-+ // We are using interrupt driven output so termios only sends us
-+ // one character at a time. The sci does not have a fifo.
++ /* We are using interrupt driven output so termios only sends us */
++ /* one character at a time. The sci does not have a fifo. */
+
-+ if ( !len ) // no data?
++ if ( !len ) /* no data? */
+ {
-+ return 0; // return error
++ return 0; /* return error */
+ }
+
-+ if ( minor != SCI_MINOR ) // check the minor dev num
++ if ( minor != SCI_MINOR ) /* check the minor dev num */
+ {
-+ return 0; // return error
++ return 0; /* return error */
+ }
+
-+ if ( SciOpened == DRIVER_OPENED ) // is the driver api open?
++ if ( SciOpened == DRIVER_OPENED ) /* is the driver api open? */
+ {
-+ return 1; // yep, throw this away
++ return 1; /* yep, throw this away */
+ }
+
-+ SciWriteCharNoWait(*buf); // try to send a char
++ SciWriteCharNoWait(*buf); /* try to send a char */
+
-+ *SCSR &= SCI_CLEAR_TDRE; // clear tx data reg empty flag
++ *SCSR &= SCI_CLEAR_TDRE; /* clear tx data reg empty flag */
+
-+ SciEnableTransmitInterrupts(); // enable the tx interrupt
++ SciEnableTransmitInterrupts(); /* enable the tx interrupt */
+
-+ return 1; // return success
++ return 1; /* return success */
+}
+\f
+
+* Scope: public API
+****************************************************************************/
+
-+int32_t SciSetAttributes(
-+ int32_t minor,
++int SciSetAttributes(
++ int minor,
+ const struct termios *t
+)
+{
+ uint16_t sci_parity = 0;
+ uint16_t sci_databits = 0;
+
-+ if ( minor != SCI_MINOR ) // check the minor dev num
++ if ( minor != SCI_MINOR ) /* check the minor dev num */
+ {
-+ return -1; // return error
++ return -1; /* return error */
+ }
+
-+ // if you look closely you will see this is the only thing we use
-+ // set the baud rate
++ /* if you look closely you will see this is the only thing we use */
++ /* set the baud rate */
+
-+ baud_requested = t->c_cflag & CBAUD; // baud rate
++ baud_requested = t->c_cflag & CBAUD; /* baud rate */
+
+ if (!baud_requested)
+ {
-+// baud_requested = B9600; // default to 9600 baud
-+ baud_requested = B19200; // default to 19200 baud
++/* baud_requested = B9600; default to 9600 baud */
++ baud_requested = B19200; /* default to 19200 baud */
+ }
+
+ sci_rate = termios_baud_to_number( baud_requested );
+
-+ // parity error detection
++ /* parity error detection */
+
-+ if (t->c_cflag & PARENB) // enable parity detection?
++ if (t->c_cflag & PARENB) /* enable parity detection? */
+ {
+ if (t->c_cflag & PARODD)
+ {
-+ sci_parity = SCI_PARITY_ODD; // select odd parity
++ sci_parity = SCI_PARITY_ODD; /* select odd parity */
+ }
+ else
+ {
-+ sci_parity = SCI_PARITY_EVEN; // select even parity
++ sci_parity = SCI_PARITY_EVEN; /* select even parity */
+ }
+ }
+ else
+ {
-+ sci_parity = SCI_PARITY_NONE; // no parity, most common
++ sci_parity = SCI_PARITY_NONE; /* no parity, most common */
+ }
+
-+ // set the number of data bits, 8 is most common
++ /* set the number of data bits, 8 is most common */
+
-+ if (t->c_cflag & CSIZE) // was it specified?
++ if (t->c_cflag & CSIZE) /* was it specified? */
+ {
+ switch (t->c_cflag & CSIZE)
+ {
+ }
+ else
+ {
-+ sci_databits = SCI_8_DATA_BITS; // default to 8 data bits
++ sci_databits = SCI_8_DATA_BITS; /* default to 8 data bits */
+ }
+
-+ // the number of stop bits; always 1 for SCI
++ /* the number of stop bits; always 1 for SCI */
+
+ if (t->c_cflag & CSTOPB)
+ {
-+ // do nothing
++ /* do nothing */
+ }
+
-+ // setup the hardware with these serial port parameters
-+
-+ SciSetBaud(sci_rate); // set the baud rate
-+
-+ SciSetParity(sci_parity); // set the parity type
++ /* setup the hardware with these serial port parameters */
+
-+ SciSetDataBits(sci_databits); // set the data bits
++ SciSetBaud(sci_rate); /* set the baud rate */
++ SciSetParity(sci_parity); /* set the parity type */
++ SciSetDataBits(sci_databits); /* set the data bits */
+
+ return RTEMS_SUCCESSFUL;
+}
+\f
+
-+/////////////////////////////////////////////////////////////////////////////
-+//
-+// SECTION 3
-+// POLLING BASED ENTRY POINTS FOR THE TERMIOS MODULE
-+//
-+/////////////////////////////////////////////////////////////////////////////
++/*
++ *
++ * SECTION 3
++ * POLLING BASED ENTRY POINTS FOR THE TERMIOS MODULE
++ */
+
+/****************************************************************************
+* Func: SciPolledOpen
+* Scope: public - termios entry point
+****************************************************************************/
+
-+int32_t SciPolledOpen(
-+ int32_t major,
-+ int32_t minor,
-+ void *arg
++int SciPolledOpen(
++ int major,
++ int minor,
++ void *arg
+)
+{
+ rtems_libio_open_close_args_t * args = arg;
+
-+ if ( minor != SCI_MINOR ) // check minor device num
++ if ( minor != SCI_MINOR ) /* check minor device num */
+ {
+ return -1;
+ }
+
-+ if ( !args ) // must have args
++ if ( !args ) /* must have args */
+ {
+ return -1;
+ }
+
-+ SciTermioTty = args->iop->data1; // Store tty pointer
++ SciTermioTty = args->iop->data1; /* Store tty pointer */
+
-+ SciDisableAllInterrupts(); // don't generate interrupts
++ SciDisableAllInterrupts(); /* don't generate interrupts */
+
-+ // THIS IS ACTUALLY A BAD THING - SETTING LINE PARAMETERS HERE
-+ // IT SHOULD BE DONE THROUGH TCSETATTR() WHEN THE CONSOLE IS OPENED!!!
++ /* THIS IS ACTUALLY A BAD THING - SETTING LINE PARAMETERS HERE */
++ /* IT SHOULD BE DONE THROUGH TCSETATTR() WHEN THE CONSOLE IS OPENED!!! */
+
-+// SciSetBaud(115200); // set the baud rate
-+// SciSetBaud( 57600); // set the baud rate
-+// SciSetBaud( 38400); // set the baud rate
-+ SciSetBaud( 19200); // set the baud rate
-+// SciSetBaud( 9600); // set the baud rate
++/* SciSetBaud(115200); set the baud rate */
++/* SciSetBaud( 57600); set the baud rate */
++/* SciSetBaud( 38400); set the baud rate */
++ SciSetBaud( 19200); /* set the baud rate */
++/* SciSetBaud( 9600); set the baud rate */
+
-+ SciSetParity(SCI_PARITY_NONE); // set no parity
++ SciSetParity(SCI_PARITY_NONE); /* set no parity */
+
-+ SciSetDataBits(SCI_8_DATA_BITS); // set 8 data bits
++ SciSetDataBits(SCI_8_DATA_BITS); /* set 8 data bits */
+
-+ SciEnableTransmitter(); // enable the xmitter
++ SciEnableTransmitter(); /* enable the xmitter */
+
-+ SciEnableReceiver(); // enable the rcvr
++ SciEnableReceiver(); /* enable the rcvr */
+
+ return RTEMS_SUCCESSFUL;
+}
+* Scope: public termios API
+****************************************************************************/
+
-+int32_t SciPolledClose(
-+ int32_t major,
-+ int32_t minor,
-+ void *arg
++int SciPolledClose(
++ int major,
++ int minor,
++ void *arg
+)
+{
+ SciDisableAllInterrupts();
+* Scope: public API
+****************************************************************************/
+
-+int32_t SciPolledRead(
-+ int32_t minor
++int SciPolledRead(
++ int minor
+)
+{
-+ if ( minor != SCI_MINOR ) // check the minor dev num
++ if ( minor != SCI_MINOR ) /* check the type-punned dev num */
+ {
-+ return -1; // return error
++ return -1; /* return error */
+ }
+
-+ if ( SciCharAvailable() ) // if a char is available
++ if ( SciCharAvailable() ) /* if a char is available */
+ {
-+ return SciReadCharNoWait(); // read the rx data register
++ return SciReadCharNoWait(); /* read the rx data register */
+ }
+
-+ return -1; // return error
++ return -1; /* return error */
+}
+\f
+
+* Scope: public termios API
+****************************************************************************/
+
-+int32_t SciPolledWrite(
-+ int32_t minor,
-+ const char *buf,
-+ int32_t len
++int SciPolledWrite(
++ int minor,
++ const char *buf,
++ int len
+)
+{
+ int32_t written = 0;
+
-+ if ( minor != SCI_MINOR ) // check minor device num
++ if ( minor != SCI_MINOR ) /* check minor device num */
+ {
+ return -1;
+ }
+
-+ if ( SciOpened == DRIVER_OPENED ) // is the driver api open?
++ if ( SciOpened == DRIVER_OPENED ) /* is the driver api open? */
+ {
-+ return -1; // toss the data
++ return -1; /* toss the data */
+ }
+
-+ // send each byte in the string out the port
++ /* send each byte in the string out the port */
+
+ while ( written < len )
+ {
-+ SciWriteCharWait(*buf++); // send a byte
++ SciWriteCharWait(*buf++); /* send a byte */
+
-+ written++; // increment counter
++ written++; /* increment counter */
+ }
+
-+ return written; // return count
++ return written; /* return count */
+}
+\f
+
-+/////////////////////////////////////////////////////////////////////////////
-+//
-+// SECTION 4
-+// DEVICE DRIVER PUBLIC API ENTRY POINTS
-+//
-+/////////////////////////////////////////////////////////////////////////////
++/*
++ *
++ * SECTION 4
++ * DEVICE DRIVER PUBLIC API ENTRY POINTS
++ */
+
+/****************************************************************************
+* Func: SciInit
+ void * arg
+)
+{
-+// rtems_status_code status;
++/* rtems_status_code status; */
+
-+//printk("%s\r\n", __FUNCTION__);
++/*printk("%s\r\n", __FUNCTION__); */
+
-+ // register the SCI device name for termios console i/o
-+ // this is done over in console.c which doesn't seem exactly right
-+ // but there were problems doing it here...
++ /* register the SCI device name for termios console i/o
++ * this is done over in console.c which doesn't seem exactly right
++ * but there were problems doing it here...
++ */
+
-+// status = rtems_io_register_name( "/dev/sci", major, 0 );
++/* status = rtems_io_register_name( "/dev/sci", major, 0 ); */
+
-+// if (status != RTEMS_SUCCESSFUL)
-+// rtems_fatal_error_occurred(status);
++/* if (status != RTEMS_SUCCESSFUL) */
++/* rtems_fatal_error_occurred(status); */
+
-+ SciMajor = major; // save the rtems major number
++ SciMajor = major; /* save the rtems major number */
+
-+ SciOpened = DRIVER_CLOSED; // initial state is closed
++ SciOpened = DRIVER_CLOSED; /* initial state is closed */
+
-+ // if you have an interrupt handler, install it here
++ /* if you have an interrupt handler, install it here */
+
-+ SciInited = 1; // set the inited flag
++ SciInited = 1; /* set the inited flag */
+
+ return RTEMS_SUCCESSFUL;
+}
+ void * arg
+)
+{
-+//printk("%s major=%d minor=%d\r\n", __FUNCTION__,major,minor);
++/*printk("%s major=%d minor=%d\r\n", __FUNCTION__,major,minor); */
+
-+ if (SciInited == 0) // must be initialized first!
++ if (SciInited == 0) /* must be initialized first! */
+ {
+ return RTEMS_NOT_CONFIGURED;
+ }
+
+ if (minor != SCI_MINOR)
+ {
-+ return RTEMS_INVALID_NAME; // verify minor number
++ return RTEMS_INVALID_NAME; /* verify minor number */
+ }
+
+ if (SciOpened == DRIVER_OPENED)
+ {
-+ return RTEMS_RESOURCE_IN_USE; // already opened!
++ return RTEMS_RESOURCE_IN_USE; /* already opened! */
+ }
+
-+ SciOpened = DRIVER_OPENED; // set the opened flag
++ SciOpened = DRIVER_OPENED; /* set the opened flag */
+
+ return RTEMS_SUCCESSFUL;
+}
+ void * arg
+)
+{
-+//printk("%s major=%d minor=%d\r\n", __FUNCTION__,major,minor);
++/*printk("%s major=%d minor=%d\r\n", __FUNCTION__,major,minor); */
+
+ if (minor != SCI_MINOR)
+ {
-+ return RTEMS_INVALID_NAME; // check the minor number
++ return RTEMS_INVALID_NAME; /* check the minor number */
+ }
+
+ if (SciOpened != DRIVER_OPENED)
+ {
-+ return RTEMS_INCORRECT_STATE; // must be opened first
++ return RTEMS_INCORRECT_STATE; /* must be opened first */
+ }
+
-+ SciOpened = DRIVER_CLOSED; // set the flag
++ SciOpened = DRIVER_CLOSED; /* set the flag */
+
+ return RTEMS_SUCCESSFUL;
+}
+ void *arg
+)
+{
-+ rtems_libio_rw_args_t *rw_args; // ptr to argument struct
-+ uint8_t *buffer;
++ rtems_libio_rw_args_t *rw_args; /* ptr to argument struct */
++ char *buffer;
+ uint16_t length;
+
-+ rw_args = (rtems_libio_rw_args_t *) arg; // arguments to read()
++ rw_args = (rtems_libio_rw_args_t *) arg; /* arguments to read() */
+
+ if (minor != SCI_MINOR)
+ {
-+ return RTEMS_INVALID_NAME; // check the minor number
++ return RTEMS_INVALID_NAME; /* check the minor number */
+ }
+
+ if (SciOpened == DRIVER_CLOSED)
+ {
-+ return RTEMS_INCORRECT_STATE; // must be opened first
++ return RTEMS_INCORRECT_STATE; /* must be opened first */
+ }
+
-+ buffer = rw_args->buffer; // points to user's buffer
++ buffer = rw_args->buffer; /* points to user's buffer */
+
-+ length = rw_args->count; // how many bytes they want
++ length = rw_args->count; /* how many bytes they want */
+
-+// *buffer = SciReadCharWait(); // wait for a character
++/* *buffer = SciReadCharWait(); wait for a character */
+
-+ // if there isn't a character available, wait until one shows up
-+ // or the timeout period expires, which ever happens first
++ /* if there isn't a character available, wait until one shows up */
++ /* or the timeout period expires, which ever happens first */
+
-+ if ( SciRcvBufCount == 0 ) // no chars
++ if ( SciRcvBufCount == 0 ) /* no chars */
+ {
-+ // wait for someone to wake me up...
-+ //rtems_task_wake_after(SciReadTimeout);
++ /* wait for someone to wake me up... */
++ /*rtems_task_wake_after(SciReadTimeout); */
+ }
+
-+ if ( SciRcvBufCount ) // any characters locally?
++ if ( SciRcvBufCount ) /* any characters locally? */
+ {
-+ *buffer = SciRcvBufGetChar(); // get the character
++ *buffer = SciRcvBufGetChar(); /* get the character */
+
-+ rw_args->bytes_moved = 1; // how many we actually read
++ rw_args->bytes_moved = 1; /* how many we actually read */
+ }
+
+ return RTEMS_SUCCESSFUL;
+ void * arg
+)
+{
-+ rtems_libio_rw_args_t *rw_args; // ptr to argument struct
++ rtems_libio_rw_args_t *rw_args; /* ptr to argument struct */
+ uint8_t *buffer;
+ uint16_t length;
+
+
+ if (minor != SCI_MINOR)
+ {
-+ return RTEMS_INVALID_NAME; // check the minor number
++ return RTEMS_INVALID_NAME; /* check the minor number */
+ }
+
+ if (SciOpened == DRIVER_CLOSED)
+ {
-+ return RTEMS_INCORRECT_STATE; // must be opened first
++ return RTEMS_INCORRECT_STATE; /* must be opened first */
+ }
+
-+ buffer = (uint8_t*)rw_args->buffer; // points to data
++ buffer = (uint8_t*)rw_args->buffer; /* points to data */
+
-+ length = rw_args->count; // how many bytes
++ length = rw_args->count; /* how many bytes */
+
+ while (length--)
+ {
-+ SciWriteCharWait(*buffer++); // send the bytes out
++ SciWriteCharWait(*buffer++); /* send the bytes out */
+ }
+
-+ rw_args->bytes_moved = rw_args->count; // how many we wrote
++ rw_args->bytes_moved = rw_args->count; /* how many we wrote */
+
+ return RTEMS_SUCCESSFUL;
+}
+ void * arg
+)
+{
-+ rtems_libio_ioctl_args_t *args = arg; // rtems arg struct
-+ uint16_t command; // the cmd to execute
-+ uint16_t unused; // maybe later
-+ uint16_t *ptr; // ptr to user data
++ rtems_libio_ioctl_args_t *args = arg; /* rtems arg struct */
++ uint16_t command; /* the cmd to execute */
++ uint16_t unused; /* maybe later */
++ uint16_t *ptr; /* ptr to user data */
+
-+//printk("%s major=%d minor=%d\r\n", __FUNCTION__,major,minor);
++/*printk("%s major=%d minor=%d\r\n", __FUNCTION__,major,minor); */
+
-+ // do some sanity checking
++ /* do some sanity checking */
+
+ if (minor != SCI_MINOR)
+ {
-+ return RTEMS_INVALID_NAME; // check the minor number
++ return RTEMS_INVALID_NAME; /* check the minor number */
+ }
+
+ if (SciOpened == DRIVER_CLOSED)
+ {
-+ return RTEMS_INCORRECT_STATE; // must be open first
++ return RTEMS_INCORRECT_STATE; /* must be open first */
+ }
+
+ if (args == 0)
+ {
-+ return RTEMS_INVALID_ADDRESS; // must have args
++ return RTEMS_INVALID_ADDRESS; /* must have args */
+ }
+
-+ args->ioctl_return = -1; // assume an error
++ args->ioctl_return = -1; /* assume an error */
+
-+ command = args->command; // get the command
-+ ptr = args->buffer; // this is an address
-+ unused = *ptr; // brightness
++ command = args->command; /* get the command */
++ ptr = args->buffer; /* this is an address */
++ unused = *ptr; /* brightness */
+
-+ if (command == SCI_SEND_BREAK) // process the command
++ if (command == SCI_SEND_BREAK) /* process the command */
+ {
-+ SciSendBreak(); // send break char
++ SciSendBreak(); /* send break char */
+ }
+
-+ args->ioctl_return = 0; // return status
++ args->ioctl_return = 0; /* return status */
+
+ return RTEMS_SUCCESSFUL;
+}
+\f
+
-+/////////////////////////////////////////////////////////////////////////////
-+//
-+// SECTION 5
-+// HARDWARE LEVEL ROUTINES
-+//
-+/////////////////////////////////////////////////////////////////////////////
++/*
++ *
++ * SECTION 5
++ * HARDWARE LEVEL ROUTINES
++ */
+
+/****************************************************************************
+* Func: SciSetBaud
+ uint16_t value;
+ uint16_t save_sccr1;
+
-+// when you open the console you need to set the termio struct baud rate
-+// it has a default value of 9600, when someone calls tcsetattr it reverts!
++/* when you open the console you need to set the termio struct baud rate */
++/* it has a default value of 9600, when someone calls tcsetattr it reverts! */
+
-+ SciBaud = rate; // save the rate
++ SciBaud = rate; /* save the rate */
+
-+ // calculate the register value as a float and convert to an int
-+ // set baud rate - you must define the system clock constant
-+ // see mrm332.h for an example
++ /* calculate the register value as a float and convert to an int */
++ /* set baud rate - you must define the system clock constant */
++ /* see mrm332.h for an example */
+
+ value = ( (uint16_t) ( SYS_CLOCK / rate / 32.0 + 0.5 ) & 0x1fff );
+
-+ save_sccr1 = *SCCR1; // save register
++ save_sccr1 = *SCCR1; /* save register */
+
-+ // also turns off the xmtr and rcvr
++ /* also turns off the xmtr and rcvr */
+
-+ *SCCR1 &= SCI_DISABLE_INT_ALL; // disable interrupts
++ *SCCR1 &= SCI_DISABLE_INT_ALL; /* disable interrupts */
+
-+ *SCCR0 = value; // write the register
++ *SCCR0 = value; /* write the register */
+
-+ *SCCR1 = save_sccr1; // restore register
++ *SCCR1 = save_sccr1; /* restore register */
+
+ return;
+}
+{
+ uint16_t value;
+
-+ value = *SCCR1; // get the register
++ value = *SCCR1; /* get the register */
+
+ if (parity == SCI_PARITY_ODD)
+ {
-+ value |= SCI_PARITY_ENABLE; // parity enabled
-+ value |= SCI_PARITY_ODD; // parity odd
++ value |= SCI_PARITY_ENABLE; /* parity enabled */
++ value |= SCI_PARITY_ODD; /* parity odd */
+ }
+
+ else if (parity == SCI_PARITY_EVEN)
+ {
-+ value |= SCI_PARITY_ENABLE; // parity enabled
-+ value &= ~SCI_PARITY_ODD; // parity even
++ value |= SCI_PARITY_ENABLE; /* parity enabled */
++ value &= ~SCI_PARITY_ODD; /* parity even */
+ }
+
+ else if (parity == SCI_PARITY_NONE)
+ {
-+ value &= ~SCI_PARITY_ENABLE; // disabled, most common
++ value &= ~SCI_PARITY_ENABLE; /* disabled, most common */
+ }
+
+ /* else no changes */
+
-+ *SCCR1 = value; // write the register
++ *SCCR1 = value; /* write the register */
+
+ return;
+}
+{
+ uint16_t value;
+
-+ value = *SCCR1; // get the register
++ value = *SCCR1; /* get the register */
+
+ /* note - the parity setting affects the number of data bits */
+
+ if (bits == SCI_9_DATA_BITS)
+ {
-+ value |= SCI_9_DATA_BITS; // 9 data bits
++ value |= SCI_9_DATA_BITS; /* 9 data bits */
+ }
+
+ else if (bits == SCI_8_DATA_BITS)
+ {
-+ value &= SCI_8_DATA_BITS; // 8 data bits
++ value &= SCI_8_DATA_BITS; /* 8 data bits */
+ }
+
+ /* else no changes */
+
-+ *SCCR1 = value; // write the register
++ *SCCR1 = value; /* write the register */
+
+ return;
+}
+
+static void inline SciDisableAllInterrupts( void )
+{
-+ // this also turns off the xmtr and rcvr
++ /* this also turns off the xmtr and rcvr */
+
+ *SCCR1 &= SCI_DISABLE_INT_ALL;
+}
+
+void SciWriteCharWait(uint8_t c)
+{
-+ // poll the fifo, waiting for room for another character
++ /* poll the fifo, waiting for room for another character */
+
+ while ( ( *SCSR & SCI_XMTR_AVAILABLE ) == 0 )
+ {
+ rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
+ }
+
-+ *SCDR = c; // send the charcter
++ *SCDR = c; /* send the charcter */
+
-+ SciBytesOut++; // increment the counter
++ SciBytesOut++; /* increment the counter */
+
+ return;
+}
+{
+ if ( ( *SCSR & SCI_XMTR_AVAILABLE ) == 0 )
+ {
-+ return; // no room, throw it away
++ return; /* no room, throw it away */
+ }
+
-+ *SCDR = c; // put the char in the fifo
++ *SCDR = c; /* put the char in the fifo */
+
-+ SciBytesOut++; // increment the counter
++ SciBytesOut++; /* increment the counter */
+
+ return;
+}
+{
+ uint8_t ch;
+
-+ while ( SciCharAvailable() == 0 ) // anything there?
++ while ( SciCharAvailable() == 0 ) /* anything there? */
+ {
+ /* relinquish processor while waiting */
+ rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
+ }
+
-+ // if you have rcv ints enabled, then the isr will probably
-+ // get the character before you will unless you turn off ints
-+ // ie polling and ints don't mix that well
++ /* if you have rcv ints enabled, then the isr will probably */
++ /* get the character before you will unless you turn off ints */
++ /* ie polling and ints don't mix that well */
+
-+ ch = *SCDR; // get the charcter
++ ch = *SCDR; /* get the charcter */
+
-+ SciBytesIn++; // increment the counter
++ SciBytesIn++; /* increment the counter */
+
-+ return ch; // return the char
++ return ch; /* return the char */
+}
+
+/****************************************************************************
+{
+ uint8_t ch;
+
-+ if ( SciCharAvailable() == 0 ) // anything there?
++ if ( SciCharAvailable() == 0 ) /* anything there? */
+ return -1;
+
-+ ch = *SCDR; // get the character
++ ch = *SCDR; /* get the character */
+
-+ SciBytesIn++; // increment the count
++ SciBytesIn++; /* increment the count */
+
-+ return ch; // return the char
++ return ch; /* return the char */
+}
+\f
+
+
+uint8_t inline SciCharAvailable( void )
+{
-+ return ( *SCSR & SCI_RCVR_READY ); // char in data register?
++ return ( *SCSR & SCI_RCVR_READY ); /* char in data register? */
+}
+\f
+
+
+void SciSendBreak( void )
+{
-+ // From the Motorola QSM reference manual -
++ /* From the Motorola QSM reference manual - */
+
-+ // "if SBK is toggled by writing it first to a one and then immediately
-+ // to a zero (in less than one serial frame interval), the transmitter
-+ // sends only one or two break frames before reverting to mark (idle)
-+ // or before commencing to send more data"
++ /* "if SBK is toggled by writing it first to a one and then immediately */
++ /* to a zero (in less than one serial frame interval), the transmitter */
++ /* sends only one or two break frames before reverting to mark (idle) */
++ /* or before commencing to send more data" */
+
-+ *SCCR1 |= SCI_SEND_BREAK; // set the bit
++ *SCCR1 |= SCI_SEND_BREAK; /* set the bit */
+
-+ *SCCR1 &= ~SCI_SEND_BREAK; // clear the bit
++ *SCCR1 &= ~SCI_SEND_BREAK; /* clear the bit */
+
+ return;
+}
+\f
+
-+/////////////////////////////////////////////////////////////////////////////
-+//
-+// SECTION 6
-+// TEST CODE
-+//
-+/////////////////////////////////////////////////////////////////////////////
++/*
++ *
++ * SECTION 6
++ * TEST CODE
++ */
+
+/****************************************************************************
+* Func: SciUnitTest
+****************************************************************************/
+
+#if 0
-+#define O_RDWR LIBIO_FLAGS_READ_WRITE // dont like this but...
++#define O_RDWR LIBIO_FLAGS_READ_WRITE /* dont like this but... */
+
+void SciUnitTest()
+{
-+ uint8_t byte; // a character
-+ uint16_t fd; // file descriptor for device
-+ uint16_t result; // result of ioctl
++ uint8_t byte; /* a character */
++ uint16_t fd; /* file descriptor for device */
++ uint16_t result; /* result of ioctl */
+
-+ fd = open("/dev/sci",O_RDWR); // open the device
++ fd = open("/dev/sci",O_RDWR); /* open the device */
+
+printk("SCI open fd=%d\r\n",fd);
+
-+ result = write(fd, "abcd\r\n", 6); // send a string
++ result = write(fd, "abcd\r\n", 6); /* send a string */
+
+printk("SCI write result=%d\r\n",result);
+
-+ result = read(fd, &byte, 1); // read a byte
++ result = read(fd, &byte, 1); /* read a byte */
+
+printk("SCI read result=%d,byte=%x\r\n",result,byte);
+
+}
Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/bspstart.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/startup/bspstart.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/startup/bspstart.c 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,82 @@
+/*
+ * This routine starts the application. It includes application,
+}
Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,125 @@
+/*
+ * $Id
+
+ /* Spurious should be called in the predriver hook */
+ /* Spurious_Initialize(); */
-+ //console_init();
++ /*console_init(); */
+
+ /*
+ * Execute main with arguments argc and agrv.
+}
Index: rtems/c/src/lib/libbsp/m68k/mo376/include/tm27.h
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/include/tm27.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/include/tm27.h 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,34 @@
+/*
+ * tm27.h
+#endif
Index: rtems/c/src/lib/libbsp/m68k/mo376/times
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/times
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/times 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,195 @@
+#
+# Timing Test Suite Results for the MRM332 BSP
+ rtems_rate_monotonic_period: conclude periods -- caller blocks 53
Index: rtems/c/src/lib/libbsp/m68k/mo376/include/mrm332.h
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/include/mrm332.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/include/mrm332.h 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,70 @@
+/* mrm332.h
+ *
+#endif /* _MRM_H_ */
Index: rtems/c/src/lib/libbsp/m68k/mo376/include/bspopts.h.in
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/include/bspopts.h.in
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/include/bspopts.h.in 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,16 @@
+/* include/bspopts.h.in. Generated from configure.ac by autoheader. */
+
+#undef PACKAGE_VERSION
Index: rtems/c/src/lib/libbsp/m68k/mo376/spurious/spinit.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/spurious/spinit.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/spurious/spinit.c 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,105 @@
+/* Spurious_driver
+ *
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
-+ * $Id: spinit.c,v 1.5 2004/04/21 10:42:52 ralf Exp $
++ * $Id: spinit.c,v 1.6 2006/09/11 21:43:55 joel Exp $
+ */
+
+#include <bsp.h>
+ rtems_vector_number vector
+)
+{
-+ //int sp = 0;
++ /*int sp = 0; */
+#if 0
+ const char * const VectDescrip[] = {
+ _Spurious_Error_[0], _Spurious_Error_[0], _Spurious_Error_[1],
+ _Spurious_Error_[27], _Spurious_Error_[28]};
+#endif
+
-+ //asm volatile ( "movea.l %%sp,%0 " : "=a" (sp) : "0" (sp) );
++ /*asm volatile ( "movea.l %%sp,%0 " : "=a" (sp) : "0" (sp) ); */
+
+ _CPU_ISR_Set_level( 7 );
-+ //_UART_flush();
++ /*_UART_flush(); */
+#if 0
+ RAW_PUTS("\n\rRTEMS: Spurious interrupt: ");
+ RAW_PUTS((char *)VectDescrip[( (vector>64) ? 64 : vector )]);
+}
Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,164 @@
+/* linkcmds
+ *
+}
Index: rtems/c/src/lib/libbsp/m68k/mo376/bsp_specs
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/bsp_specs
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/bsp_specs 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,16 @@
+%rename endfile old_endfile
+%rename startfile old_startfile
+*endfile:
+%{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s crtn.o%s}
+
-Index: rtems/c/src/lib/libbsp/m68k/mo376/include/.cvsignore
-===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/include/.cvsignore
-@@ -0,0 +1,5 @@
-+bspopts.h
-+bspopts.h.in
-+coverhd.h
-+stamp-h
-+stamp-h.in
-Index: rtems/c/src/lib/libbsp/m68k/mo376/wrapup/.keep
-===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/wrapup/.keep
-@@ -0,0 +1 @@
-+
Index: rtems/c/src/lib/libbsp/m68k/mo376/preinstall.am
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/preinstall.am
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/preinstall.am 2007-08-14 17:20:30.000000000 +0200
@@ -0,0 +1,66 @@
+## Automatically generated by ampolish3 - Do not edit
+
+CLEANFILES += $(PREINSTALL_FILES)
+
+$(PROJECT_LIB)/$(dirstamp):
-+ @$(mkdir_p) $(PROJECT_LIB)
++ @$(MKDIR_P) $(PROJECT_LIB)
+ @: > $(PROJECT_LIB)/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
+
+$(PROJECT_INCLUDE)/$(dirstamp):
-+ @$(mkdir_p) $(PROJECT_INCLUDE)
++ @$(MKDIR_P) $(PROJECT_INCLUDE)
+ @: > $(PROJECT_INCLUDE)/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
+
-Index: rtems/c/src/lib/libbsp/powerpc/ec555/.cvsignore
-===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/.cvsignore
-@@ -0,0 +1,14 @@
-+aclocal.m4
-+autom4te*.cache
-+config.cache
-+config.guess
-+config.log
-+config.status
-+config.sub
-+configure
-+depcomp
-+install-sh
-+Makefile
-+Makefile.in
-+missing
-+mkinstalldirs
+---
+ c/src/lib/libbsp/powerpc/ec555/ChangeLog | 131 +++++++
+ c/src/lib/libbsp/powerpc/ec555/Makefile.am | 65 +++
+ c/src/lib/libbsp/powerpc/ec555/README | 262 ++++++++++++++
+ c/src/lib/libbsp/powerpc/ec555/bsp_specs | 13
+ c/src/lib/libbsp/powerpc/ec555/clock/p_clock.c | 69 +++
+ c/src/lib/libbsp/powerpc/ec555/configure.ac | 52 ++
+ c/src/lib/libbsp/powerpc/ec555/console/console.c | 368 +++++++++++++++++++
+ c/src/lib/libbsp/powerpc/ec555/include/bsp.h | 114 ++++++
+ c/src/lib/libbsp/powerpc/ec555/include/coverhd.h | 116 ++++++
+ c/src/lib/libbsp/powerpc/ec555/include/tm27.h | 54 ++
+ c/src/lib/libbsp/powerpc/ec555/irq/irq.h | 55 ++
+ c/src/lib/libbsp/powerpc/ec555/preinstall.am | 58 +++
+ c/src/lib/libbsp/powerpc/ec555/startup/bspstart.c | 201 ++++++++++
+ c/src/lib/libbsp/powerpc/ec555/startup/iss555.c | 148 +++++++
+ c/src/lib/libbsp/powerpc/ec555/startup/linkcmds | 319 +++++++++++++++++
+ c/src/lib/libbsp/powerpc/ec555/startup/start.S | 411 ++++++++++++++++++++++
+ c/src/lib/libbsp/powerpc/ec555/startup/tm27supp.c | 29 +
+ c/src/lib/libbsp/powerpc/ec555/times | 189 ++++++++++
+ make/custom/ec555.cfg | 41 ++
+ 19 files changed, 2695 insertions(+)
+
Index: rtems/c/src/lib/libbsp/powerpc/ec555/ChangeLog
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/ChangeLog
-@@ -0,0 +1,119 @@
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/ChangeLog 2007-08-14 17:51:38.000000000 +0200
+@@ -0,0 +1,131 @@
++2007-04-06 Ralf Corsépius <ralf.corsepius@rtems.org>
++
++ * bsp_specs: Remove lib (Now expected to exist in GCC).
++
++2006-12-02 Ralf Corsépius <ralf.corsepius@rtems.org>
++
++ * configure.ac: New BUG-REPORT address.
++
++2006-10-19 Ralf Corsépius <ralf.corsepius@rtems.org>
++
++ * configure.ac: Require automake-1.10. Require autoconf-2.60.
++
+2006-03-08 Joel Sherrill <joel@OARcorp.com>
+
+ * startup/linkcmds: Add .gnu.linkonce.b.* section.
+
Index: rtems/c/src/lib/libbsp/powerpc/ec555/Makefile.am
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/Makefile.am
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/Makefile.am 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,65 @@
+##
+## $Id: Makefile.am,v 1.10 2006/01/12 10:12:30 ralf Exp $
+include $(top_srcdir)/../../../../automake/local.am
Index: rtems/c/src/lib/libbsp/powerpc/ec555/README
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/README
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/README 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,262 @@
+#
+# $Id: README,v 1.1 2004/04/12 21:52:13 joel Exp $
+ - The paranoia program dies on a floating-point assist exception.
Index: rtems/c/src/lib/libbsp/powerpc/ec555/bsp_specs
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/bsp_specs
-@@ -0,0 +1,20 @@
-+%rename lib old_lib
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/bsp_specs 2007-08-14 17:51:38.000000000 +0200
+@@ -0,0 +1,13 @@
+%rename endfile old_endfile
+%rename startfile old_startfile
+%rename link old_link
+
-+*lib:
-+%{!qrtems: %(old_lib)} %{!nostdlib: %{qrtems: --start-group \
-+%{!qrtems_debug: -lrtemsbsp -lrtemscpu} %{qrtems_debug: -lrtemsbsp_g -lrtemscpu_g} \
-+%{qjava: -lffi -lgcjgc -lzgcj -lgcj} %{qc++: -lstdc++} -lc -lgcc --end-group \
-+%{!qnolinkcmds: %{qrtems_debug: --defsym RTEMS_DEBUG=1} -T linkcmds%s -Map %b.map}}}
-+
+*startfile:
+%{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems: ecrti%O%s}}
+
+
Index: rtems/c/src/lib/libbsp/powerpc/ec555/clock/p_clock.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/clock/p_clock.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/clock/p_clock.c 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,69 @@
+/*
+ * Clock Tick interrupt conexion code.
+}
Index: rtems/c/src/lib/libbsp/powerpc/ec555/configure.ac
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/configure.ac
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/configure.ac 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,52 @@
+## Process this file with autoconf to produce a configure script.
+##
-+## $Id: configure.ac,v 1.7 2006/01/11 04:52:39 ralf Exp $
++## $Id: configure.ac,v 1.7.2.2 2006/12/02 06:06:51 ralf Exp $
+
-+AC_PREREQ(2.59)
-+AC_INIT([rtems-c-src-lib-libbsp-powerpc-mbx5xx],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
++AC_PREREQ(2.60)
++AC_INIT([rtems-c-src-lib-libbsp-powerpc-mbx5xx],[_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.9])
++AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.10])
+RTEMS_BSP_CONFIGURE
+
+RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
+AC_OUTPUT
Index: rtems/c/src/lib/libbsp/powerpc/ec555/console/console.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/console/console.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/console/console.c 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,368 @@
+/*
+ * console.c
+ return RTEMS_SUCCESSFUL;
+ #endif
+}
-Index: rtems/c/src/lib/libbsp/powerpc/ec555/include/.cvsignore
-===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/include/.cvsignore
-@@ -0,0 +1,4 @@
-+bspopts.h
-+bspopts.h.in
-+stamp-h
-+stamp-h.in
Index: rtems/c/src/lib/libbsp/powerpc/ec555/include/bsp.h
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/include/bsp.h
-@@ -0,0 +1,115 @@
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/include/bsp.h 2007-08-14 17:51:38.000000000 +0200
+@@ -0,0 +1,114 @@
+/* bsp.h
+ *
+ * This include file contains all board IO definitions.
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
-+ * $Id: bsp.h,v 1.9 2005/05/26 05:36:48 ralf Exp $
++ * $Id: bsp.h,v 1.10 2006/03/17 10:11:37 ralf Exp $
+ */
+
+#ifndef _BSP_H
+#endif
+
+#endif
-+/* end of include file */
Index: rtems/c/src/lib/libbsp/powerpc/ec555/include/coverhd.h
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/include/coverhd.h
-@@ -0,0 +1,117 @@
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/include/coverhd.h 2007-08-14 17:51:38.000000000 +0200
+@@ -0,0 +1,116 @@
+/* coverhd.h
+ *
+ * This include file has defines to represent the overhead associated
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
-+ * $Id: coverhd.h,v 1.1 2004/04/12 21:52:13 joel Exp $
++ * $Id: coverhd.h,v 1.2 2006/03/17 10:11:37 ralf Exp $
+ */
+
+#ifndef __COVERHD_h
+#endif
+
+#endif
-+/* end of include file */
Index: rtems/c/src/lib/libbsp/powerpc/ec555/include/tm27.h
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/include/tm27.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/include/tm27.h 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,54 @@
+/*
+ * tm27.h
+#endif
Index: rtems/c/src/lib/libbsp/powerpc/ec555/irq/irq.h
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/irq/irq.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/irq/irq.h 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,55 @@
+/* irq.h
+ *
+#endif /* LIBBSP_POWERPC_SS555_IRQ_IRQ_H */
Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/bspstart.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/bspstart.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/bspstart.c 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,201 @@
+/* bspstart.c
+ *
+}
Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/iss555.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/iss555.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/iss555.c 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,148 @@
+/*
+ * iss555.c
+}
Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/linkcmds
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/linkcmds
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/linkcmds 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,319 @@
+/*
+ * Linker command file for Intec SS555 board
+}
Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/start.S
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/start.S
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/start.S 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,411 @@
+/* start.S
+ *
+.L_text_e:
Index: rtems/c/src/lib/libbsp/powerpc/ec555/startup/tm27supp.c
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/tm27supp.c
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/startup/tm27supp.c 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,29 @@
+/*
+ * Support routines for TM27
+
Index: rtems/c/src/lib/libbsp/powerpc/ec555/times
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/times
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/times 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,189 @@
+#
+# Timing Test Suite Results for the Intec SS555
+ rtems_rate_monotonic_period: conclude periods -- caller blocks 36
Index: rtems/make/custom/ec555.cfg
===================================================================
---- /dev/null
-+++ rtems/make/custom/ec555.cfg
-@@ -0,0 +1,49 @@
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/make/custom/ec555.cfg 2007-08-14 17:51:38.000000000 +0200
+@@ -0,0 +1,41 @@
+#
+# Config file for an Intec Automation SS555 MPC555-based card
+#
+#
+CPU_CFLAGS = -mcpu=$(GCC_CPU_MODEL) -D$(RTEMS_CPU_MODEL) -D$(RTEMS_BSP_FAMILY)
+
-+# Debugging flags: If we debug with optimization on, single-stepping
-+# sometimes looks a little odd, but there won't be any surprises later.
-+CFLAGS_DEBUG_V += -O4 -ggdb
-+CXXFLAGS_DEBUG_V += -O4 -ggdb
-+
-+# optimize flag: typically -O, could use -O4 or -fast
-+# -O4 is ok for RTEMS
-+# NOTE: some level of -O may be actually required by inline assembler
-+CFLAGS_OPTIMIZE_V=-O4 -fno-keep-inline-functions
-+CXXFLAGS_OPTIMIZE_V=-O4
++# optimize flag: typically -O2
++CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions
+
+define make-exe
+ $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) $(SS555_LDFLAGS) \
+
Index: rtems/c/src/lib/libbsp/powerpc/ec555/preinstall.am
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/preinstall.am
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/powerpc/ec555/preinstall.am 2007-08-14 17:51:38.000000000 +0200
@@ -0,0 +1,58 @@
+## Automatically generated by ampolish3 - Do not edit
+
+CLEANFILES = $(PREINSTALL_FILES)
+
+$(PROJECT_LIB)/$(dirstamp):
-+ @$(mkdir_p) $(PROJECT_LIB)
++ @$(MKDIR_P) $(PROJECT_LIB)
+ @: > $(PROJECT_LIB)/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
+
+$(PROJECT_INCLUDE)/$(dirstamp):
-+ @$(mkdir_p) $(PROJECT_INCLUDE)
++ @$(MKDIR_P) $(PROJECT_INCLUDE)
+ @: > $(PROJECT_INCLUDE)/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
+
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
+
+$(PROJECT_INCLUDE)/bsp/$(dirstamp):
-+ @$(mkdir_p) $(PROJECT_INCLUDE)/bsp
++ @$(MKDIR_P) $(PROJECT_INCLUDE)/bsp
+ @: > $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+
-Index: rtems-051009/c/src/lib/libbsp/m68k/acinclude.m4
+---
+ c/src/lib/libbsp/m68k/acinclude.m4 | 2 ++
+ 1 file changed, 2 insertions(+)
+
+Index: rtems/c/src/lib/libbsp/m68k/acinclude.m4
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/acinclude.m4
-+++ rtems/c/src/lib/libbsp/m68k/acinclude.m4
-@@ -22,6 +22,8 @@ AC_DEFUN([RTEMS_CHECK_BSPDIR],
+--- rtems.orig/c/src/lib/libbsp/m68k/acinclude.m4 2007-08-14 18:59:45.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/acinclude.m4 2007-08-14 19:04:40.000000000 +0200
+@@ -20,6 +20,8 @@
+ AC_CONFIG_SUBDIRS([mcf5206elite]);;
+ mcf5235 )
AC_CONFIG_SUBDIRS([mcf5235]);;
- mrm332 )
- AC_CONFIG_SUBDIRS([mrm332]);;
+ mo376 )
+ AC_CONFIG_SUBDIRS([mo376]);;
+ mrm332 )
+ AC_CONFIG_SUBDIRS([mrm332]);;
mvme136 )
- AC_CONFIG_SUBDIRS([mvme136]);;
- mvme147 )
-Index: rtems-051009/c/src/lib/libbsp/m68k/mo376/include/bsp.h
+---
+ c/src/lib/libbsp/m68k/mo376/clock/ckinit.c | 2
+ c/src/lib/libbsp/m68k/mo376/include/bsp.h | 26 +
+ c/src/lib/libbsp/m68k/mo376/include/mo376.h | 27 -
+ c/src/lib/libbsp/m68k/mo376/misc/gdbinit68 | 395 ++++++++++++++++++++++-
+ c/src/lib/libbsp/m68k/mo376/spurious/spinit.c | 10
+ c/src/lib/libbsp/m68k/mo376/startup/linkcmds | 10
+ c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM | 17
+ c/src/lib/libbsp/m68k/mo376/startup/start_c.c | 6
+ make/custom/mo376.cfg | 10
+ 9 files changed, 455 insertions(+), 48 deletions(-)
+
+Index: rtems/c/src/lib/libbsp/m68k/mo376/include/bsp.h
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/include/bsp.h
-+++ rtems/c/src/lib/libbsp/m68k/mo376/include/bsp.h
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/include/bsp.h 2007-08-14 17:24:09.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/include/bsp.h 2007-08-14 17:36:35.000000000 +0200
@@ -1,6 +1,6 @@
/* bsp.h
*
*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
-@@ -41,6 +41,30 @@ extern "C" {
+@@ -41,6 +41,30 @@
/* #define CONFIGURE_INTERRUPT_STACK_MEMORY (TBD * 1024) */
/*
* Simple spin delay in microsecond units for device drivers.
* This is very dependent on the clock speed of the target.
*/
-Index: rtems-051009/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c
+Index: rtems/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c
-+++ rtems/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c
-@@ -60,7 +60,7 @@ void Install_clock(
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c 2007-08-14 17:24:09.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c 2007-08-14 17:36:35.000000000 +0200
+@@ -60,7 +60,7 @@
Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 );
/* enable 1mS interrupts */
*PICR = (unsigned short int) /* enable interrupt */
( SAM(ISRL_PIT,8,PIRQL) | SAM(CLOCK_VECTOR,0,PIV) );
-Index: rtems-051009/c/src/lib/libbsp/m68k/mo376/misc/gdbinit68
+Index: rtems/c/src/lib/libbsp/m68k/mo376/misc/gdbinit68
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/misc/gdbinit68
-+++ rtems/c/src/lib/libbsp/m68k/mo376/misc/gdbinit68
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/misc/gdbinit68 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/misc/gdbinit68 2007-08-14 17:36:35.000000000 +0200
@@ -1,16 +1,399 @@
#
# $Id: gdbinit68,v 1.1 2001/05/25 16:28:46 joel Exp $
+#b main
+
+run
-Index: rtems-051009/c/src/lib/libbsp/m68k/mo376/include/mo376.h
+Index: rtems/c/src/lib/libbsp/m68k/mo376/include/mo376.h
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/include/mo376.h
-+++ rtems/c/src/lib/libbsp/m68k/mo376/include/mo376.h
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/include/mo376.h 2007-08-14 17:24:09.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/include/mo376.h 2007-08-14 17:36:35.000000000 +0200
@@ -26,31 +26,22 @@
#define EFI_INT1 25 /* CTS interrupt */
#define ISRL_SCI 6
#define SCI_BAUD 19200 /* RS232 Baud Rate */
/* macros/functions */
-Index: rtems-051009/c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM
+Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM
-+++ rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds_ROM 2007-08-14 17:36:35.000000000 +0200
@@ -4,7 +4,8 @@
*/
__DYNAMIC = 0;
/*
-@@ -39,18 +40,18 @@ __DYNAMIC = 0;
+@@ -39,18 +40,18 @@
MEMORY
{
/*
*
-Index: rtems-051009/c/src/lib/libbsp/m68k/mo376/spurious/spinit.c
+Index: rtems/c/src/lib/libbsp/m68k/mo376/spurious/spinit.c
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/spurious/spinit.c
-+++ rtems/c/src/lib/libbsp/m68k/mo376/spurious/spinit.c
-@@ -33,8 +33,8 @@ rtems_isr Spurious_Isr(
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/spurious/spinit.c 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/spurious/spinit.c 2007-08-14 17:45:18.000000000 +0200
+@@ -33,8 +33,8 @@
rtems_vector_number vector
)
{
-- //int sp = 0;
+- /*int sp = 0; */
-#if 0
+ int sp = 0;
+#if 1
const char * const VectDescrip[] = {
_Spurious_Error_[0], _Spurious_Error_[0], _Spurious_Error_[1],
_Spurious_Error_[2], _Spurious_Error_[3], _Spurious_Error_[4],
-@@ -60,11 +60,11 @@ rtems_isr Spurious_Isr(
+@@ -60,11 +60,11 @@
_Spurious_Error_[27], _Spurious_Error_[28]};
#endif
-- //asm volatile ( "movea.l %%sp,%0 " : "=a" (sp) : "0" (sp) );
+- /*asm volatile ( "movea.l %%sp,%0 " : "=a" (sp) : "0" (sp) ); */
+ asm volatile ( "movea.l %%sp,%0 " : "=a" (sp) : "0" (sp) );
_CPU_ISR_Set_level( 7 );
- //_UART_flush();
+ /*_UART_flush(); */
-#if 0
+#if 1
RAW_PUTS("\n\rRTEMS: Spurious interrupt: ");
RAW_PUTS((char *)VectDescrip[( (vector>64) ? 64 : vector )]);
RAW_PUTS("\n\rRTEMS: Vector: ");
-@@ -89,6 +89,7 @@ void Spurious_Initialize(void)
+@@ -89,6 +89,7 @@
{
switch (vector)
{
case 4:
case 9:
case 31:
-@@ -96,6 +97,7 @@ void Spurious_Initialize(void)
+@@ -96,6 +97,7 @@
case 66:
/* These vectors used by CPU32bug - don't overwrite them. */
break;
default:
(void) set_vector( Spurious_Isr, vector, 1 );
-Index: rtems-051009/c/src/lib/libbsp/m68k/mo376/startup/linkcmds
+Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/startup/linkcmds
-+++ rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds
-@@ -33,15 +33,15 @@ __DYNAMIC = 0;
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/startup/linkcmds 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/startup/linkcmds 2007-08-14 17:36:35.000000000 +0200
+@@ -33,15 +33,15 @@
/*
* Declare some sizes.
*/
}
_copy_data_from_rom = 0;
-Index: rtems-051009/make/custom/mo376.cfg
+Index: rtems/make/custom/mo376.cfg
===================================================================
---- rtems.orig/make/custom/mo376.cfg
-+++ rtems/make/custom/mo376.cfg
-@@ -16,8 +16,16 @@ RTEMS_BSP_FAMILY=mo376
+--- rtems.orig/make/custom/mo376.cfg 2007-08-14 17:24:09.000000000 +0200
++++ rtems/make/custom/mo376.cfg 2007-08-14 17:41:03.000000000 +0200
+@@ -16,8 +16,14 @@
# and (hopefully) optimize for it.
CPU_CFLAGS = -mcpu32
+-# optimize flag: typically -O2
+-CFLAGS_OPTIMIZE_V = -O2 -g -fomit-frame-pointer
+# Debugging flags: If we debug with optimization on, single-stepping
+# sometimes looks a little odd, but there won't be any surprises later.
+CFLAGS_DEBUG_V += -O2 -ggdb
+CXXFLAGS_DEBUG_V += -O2 -ggdb
+
- # optimize flag: typically -0, could use -O4 or -fast, -O4 is ok for RTEMS
--CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer
-+CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-pointer -ggdb
-+CXXFLAGS_OPTIMIZE_V=-O4 -ggdb
-+
-+
++# optimize flag: typically -0, could use -O4 or -fast, -O4 is ok for RTEMS
++CFLAGS_OPTIMIZE_V=-O2 -fomit-frame-pointer -ggdb
++CXXFLAGS_OPTIMIZE_V=-O2 -ggdb
# The following are definitions of make-exe which will work using ld as
- # is currently required. It is expected that as of gcc 2.8, the end user
-Index: rtems-051009/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
+ # is currently required.
+Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
-+++ rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
-@@ -60,12 +60,12 @@ void start_c() {
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/startup/start_c.c 2007-08-14 17:24:09.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c 2007-08-14 17:36:35.000000000 +0200
+@@ -60,12 +60,12 @@
/* Port E and F Data Direction Register */
/* see section 9 of the SIM Reference Manual */
--- /dev/null
+---
+ cpukit/libcsupport/src/readlink.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: rtems/cpukit/libcsupport/src/readlink.c
+===================================================================
+--- rtems.orig/cpukit/libcsupport/src/readlink.c 2007-08-15 01:54:35.000000000 +0200
++++ rtems/cpukit/libcsupport/src/readlink.c 2007-08-15 01:56:45.000000000 +0200
+@@ -18,10 +18,10 @@
+ #include <rtems/libio_.h>
+ #include <rtems/seterr.h>
+
+-int readlink(
++ssize_t readlink(
+ const char *pathname,
+ char *buf,
+- int bufsize
++ size_t bufsize
+ )
+ {
+ rtems_filesystem_location_info_t loc;
+---
+ c/src/lib/libbsp/m68k/mo376/ChangeLog | 5 +
+ c/src/lib/libbsp/m68k/mo376/Makefile.am | 2
+ c/src/lib/libbsp/m68k/mo376/README | 25 ++++-----
+ c/src/lib/libbsp/m68k/mo376/clock/ckinit.c | 2
+ c/src/lib/libbsp/m68k/mo376/configure.ac | 2
+ c/src/lib/libbsp/m68k/mo376/console/sci.c | 4 -
+ c/src/lib/libbsp/m68k/mo376/include/bsp.h | 2
+ c/src/lib/libbsp/m68k/mo376/include/mo376.h | 70 ++++++++++++++++++++++++++
+ c/src/lib/libbsp/m68k/mo376/include/mrm332.h | 70 --------------------------
+ c/src/lib/libbsp/m68k/mo376/preinstall.am | 6 +-
+ c/src/lib/libbsp/m68k/mo376/start/start.S | 2
+ c/src/lib/libbsp/m68k/mo376/startup/start_c.c | 2
+ c/src/lib/libbsp/m68k/mo376/times | 6 +-
+ make/custom/mo376.cfg | 4 -
+ 14 files changed, 104 insertions(+), 98 deletions(-)
+
Index: rtems/c/src/lib/libbsp/m68k/mo376/start/start.S
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/start/start.S
-+++ rtems/c/src/lib/libbsp/m68k/mo376/start/start.S
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/start/start.S 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/start/start.S 2007-08-14 17:24:09.000000000 +0200
@@ -2,7 +2,7 @@
* $Id
*/
Index: rtems/c/src/lib/libbsp/m68k/mo376/include/bsp.h
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/include/bsp.h
-+++ rtems/c/src/lib/libbsp/m68k/mo376/include/bsp.h
-@@ -26,7 +26,7 @@ extern "C" {
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/include/bsp.h 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/include/bsp.h 2007-08-14 17:24:09.000000000 +0200
+@@ -26,7 +26,7 @@
#include <rtems/clockdrv.h>
#include <rtems/console.h>
#include <rtems/iosupp.h>
Index: rtems/c/src/lib/libbsp/m68k/mo376/ChangeLog
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/ChangeLog
-+++ rtems/c/src/lib/libbsp/m68k/mo376/ChangeLog
-@@ -11,6 +11,11 @@
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/ChangeLog 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/ChangeLog 2007-08-14 17:24:09.000000000 +0200
+@@ -29,6 +29,11 @@
* include/bsp.h: New header guard.
* Makefile.am: Eliminate CFLAGS_OPTIMIZE_V.
Index: rtems/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c
-+++ rtems/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/clock/ckinit.c 2007-08-14 17:24:09.000000000 +0200
@@ -20,7 +20,7 @@
#include <stdlib.h>
#include <bsp.h>
Index: rtems/c/src/lib/libbsp/m68k/mo376/configure.ac
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/configure.ac
-+++ rtems/c/src/lib/libbsp/m68k/mo376/configure.ac
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/configure.ac 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/configure.ac 2007-08-14 17:26:26.000000000 +0200
@@ -3,7 +3,7 @@
- ## $Id: configure.ac,v 1.14 2004/09/24 06:32:09 ralf Exp $
+ ## $Id: configure.ac,v 1.14.2.2 2006/12/02 06:04:46 ralf Exp $
- AC_PREREQ(2.59)
--AC_INIT([rtems-c-src-lib-libbsp-m68k-mrm332],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
-+AC_INIT([rtems-c-src-lib-libbsp-m68k-mo376],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
+ AC_PREREQ(2.60)
+-AC_INIT([rtems-c-src-lib-libbsp-m68k-mrm332],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
++AC_INIT([rtems-c-src-lib-libbsp-m68k-mo376],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
AC_CONFIG_SRCDIR([bsp_specs])
RTEMS_TOP(../../../../../..)
Index: rtems/c/src/lib/libbsp/m68k/mo376/README
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/README
-+++ rtems/c/src/lib/libbsp/m68k/mo376/README
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/README 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/README 2007-08-14 17:24:09.000000000 +0200
@@ -2,23 +2,24 @@
# $Id: README,v 1.1 2001/05/25 16:28:46 joel Exp $
#
Index: rtems/c/src/lib/libbsp/m68k/mo376/Makefile.am
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/Makefile.am
-+++ rtems/c/src/lib/libbsp/m68k/mo376/Makefile.am
-@@ -16,7 +16,7 @@ nodist_include_HEADERS = include/bspopts
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/Makefile.am 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/Makefile.am 2007-08-14 17:24:09.000000000 +0200
+@@ -16,7 +16,7 @@
DISTCLEANFILES = include/bspopts.h
noinst_PROGRAMS =
EXTRA_DIST = times
Index: rtems/c/src/lib/libbsp/m68k/mo376/console/sci.c
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/console/sci.c
-+++ rtems/c/src/lib/libbsp/m68k/mo376/console/sci.c
-@@ -129,7 +129,7 @@
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/console/sci.c 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/console/sci.c 2007-08-14 17:31:42.000000000 +0200
+@@ -105,7 +105,7 @@
- // system clock definitions, i dont have documentation on this...
+ /* system clock definitions, i dont have documentation on this... */
--#if 0 // Not needed, this is provided in mrm332.h
-+#if 0 // Not needed, this is provided in mo376.h
- #define XTAL 32768.0 // crystal frequency in Hz
- #define NUMB_W 0 // system clock parameters
+-#if 0 /* Not needed, this is provided in mrm332.h */
++#if 0 /* Not needed, this is provided in mo376.h */
+ #define XTAL 32768.0 /* crystal frequency in Hz */
+ #define NUMB_W 0 /* system clock parameters */
#define NUMB_X 1
-@@ -1238,7 +1238,7 @@ static void SciSetBaud(uint32_t rate)
+@@ -1215,7 +1215,7 @@
- // calculate the register value as a float and convert to an int
- // set baud rate - you must define the system clock constant
-- // see mrm332.h for an example
-+ // see mo376.h for an example
+ /* calculate the register value as a float and convert to an int */
+ /* set baud rate - you must define the system clock constant */
+- /* see mrm332.h for an example */
++ /* see mo376.h for an example */
value = ( (uint16_t) ( SYS_CLOCK / rate / 32.0 + 0.5 ) & 0x1fff );
Index: rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
-+++ rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/startup/start_c.c 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/startup/start_c.c 2007-08-14 17:24:09.000000000 +0200
@@ -2,7 +2,7 @@
* $Id
*/
#include "bsp.h"
Index: rtems/c/src/lib/libbsp/m68k/mo376/times
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/times
-+++ rtems/c/src/lib/libbsp/m68k/mo376/times
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/times 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/times 2007-08-14 17:24:09.000000000 +0200
@@ -1,5 +1,5 @@
#
-# Timing Test Suite Results for the MRM332 BSP
#
# $Id: times,v 1.2 2004/01/07 21:13:50 joel Exp $
#
-@@ -8,9 +8,9 @@ NOTE: This BSP is user submitted and no
+@@ -8,9 +8,9 @@
TBD: MATT - update this with real times!
Index: rtems/c/src/lib/libbsp/m68k/mo376/include/mo376.h
===================================================================
---- /dev/null
-+++ rtems/c/src/lib/libbsp/m68k/mo376/include/mo376.h
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ rtems/c/src/lib/libbsp/m68k/mo376/include/mo376.h 2007-08-14 17:24:09.000000000 +0200
@@ -0,0 +1,70 @@
+/* mo376.h
+ *
+#endif /* _MRM_H_ */
Index: rtems/c/src/lib/libbsp/m68k/mo376/include/mrm332.h
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/include/mrm332.h
-+++ /dev/null
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/include/mrm332.h 2007-08-14 17:20:30.000000000 +0200
++++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,70 +0,0 @@
-/* mrm332.h
- *
-#endif /* _MRM_H_ */
Index: rtems/make/custom/mo376.cfg
===================================================================
---- rtems.orig/make/custom/mo376.cfg
-+++ rtems/make/custom/mo376.cfg
-@@ -1,7 +1,7 @@
- #
--# Config file for the mrm332 BSP
-+# Config file for the mo376 BSP
- #
--# $Id: mrm332.cfg,v 1.8 2004/02/04 16:50:30 ralf Exp $
-+# $Id: mo376.cfg,v 1.8 2004/02/04 16:50:30 ralf Exp $
- #
-
- include $(RTEMS_ROOT)/make/custom/default.cfg
-@@ -10,7 +10,7 @@ RTEMS_CPU=m68k
+--- rtems.orig/make/custom/mo376.cfg 2007-08-14 17:20:30.000000000 +0200
++++ rtems/make/custom/mo376.cfg 2007-08-14 17:24:09.000000000 +0200
+@@ -10,7 +10,7 @@
RTEMS_CPU_MODEL=m68332
# This is the actual bsp directory used during the build process.
# This contains the compiler options necessary to select the CPU model
# and (hopefully) optimize for it.
-@@ -26,7 +26,7 @@ CFLAGS_OPTIMIZE_V=-O4 -fomit-frame-point
+@@ -25,7 +25,7 @@
ifeq ($(MRM_IN_ROM),yes)
# Build a rommable image - move the .data section after the .text section
# in the image.
# though and greatly slows the build process so only do this if needed.
Index: rtems/c/src/lib/libbsp/m68k/mo376/preinstall.am
===================================================================
---- rtems.orig/c/src/lib/libbsp/m68k/mo376/preinstall.am
-+++ rtems/c/src/lib/libbsp/m68k/mo376/preinstall.am
-@@ -44,9 +44,9 @@ $(PROJECT_INCLUDE)/bspopts.h: include/bs
+--- rtems.orig/c/src/lib/libbsp/m68k/mo376/preinstall.am 2007-08-14 17:20:30.000000000 +0200
++++ rtems/c/src/lib/libbsp/m68k/mo376/preinstall.am 2007-08-14 17:24:09.000000000 +0200
+@@ -44,9 +44,9 @@
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
+---
+ c/src/lib/libbsp/powerpc/ec555/ChangeLog | 5 +++++
+ c/src/lib/libbsp/powerpc/ec555/README | 18 +++++++++---------
+ c/src/lib/libbsp/powerpc/ec555/configure.ac | 2 +-
+ make/custom/ec555.cfg | 6 +++---
+ 4 files changed, 18 insertions(+), 13 deletions(-)
+
Index: rtems/c/src/lib/libbsp/powerpc/ec555/ChangeLog
===================================================================
---- rtems/c/src/lib/libbsp/powerpc/ec555/ChangeLog
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/ChangeLog
+--- rtems.orig/c/src/lib/libbsp/powerpc/ec555/ChangeLog 2007-08-14 17:51:38.000000000 +0200
++++ rtems/c/src/lib/libbsp/powerpc/ec555/ChangeLog 2007-08-14 17:56:57.000000000 +0200
@@ -1,3 +1,8 @@
-+2006-06-02 Pavel Pisa <pisa@cmp.felk.cvut.cz>
++2007-08-14 Pavel Pisa <pisa@cmp.felk.cvut.cz>
+
+ * EC555 BSP for Wuerz-elektronik EC555 board started
+ as clone of SS555 BSP.
+
- 2006-03-08 Joel Sherrill <joel@OARcorp.com>
+ 2007-04-06 Ralf Corsépius <ralf.corsepius@rtems.org>
- * startup/linkcmds: Add .gnu.linkonce.b.* section.
+ * bsp_specs: Remove lib (Now expected to exist in GCC).
Index: rtems/c/src/lib/libbsp/powerpc/ec555/README
===================================================================
---- rtems/c/src/lib/libbsp/powerpc/ec555/README
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/README
+--- rtems.orig/c/src/lib/libbsp/powerpc/ec555/README 2007-08-14 17:51:38.000000000 +0200
++++ rtems/c/src/lib/libbsp/powerpc/ec555/README 2007-08-14 17:53:52.000000000 +0200
@@ -2,9 +2,9 @@
# $Id: README,v 1.1 2004/04/12 21:52:13 joel Exp $
#
Canada - Suffield, and is Copyright (C) 2004, Real-Time Systems Inc.
Please send any comments, improvements, or bug reports to:
-@@ -16,8 +16,8 @@ querbach@realtime.bc.ca
+@@ -16,8 +16,8 @@
Summary
-------
BUS: None
CPU FAMILY: PowerPC
CPU: PowerPC MPC555
-@@ -88,7 +88,7 @@ RAM: 512k 2-1-1-1 burst SRAM
+@@ -88,7 +88,7 @@
Installation
------------
depending on whether or not it is built for debugging by giving the
VARIANT=DEBUG switch to make:
-@@ -112,7 +112,7 @@ Console driver
+@@ -112,7 +112,7 @@
This BSP includes an termios-capable asynchronous serial line driver that
supports SCI1 and SCI2. The RTEMS console is selected at configuration time
SCI2 for the console, since SCI1 has some extra features which may be
desired for application use.
-@@ -123,7 +123,7 @@ The BSP console supports three different
+@@ -123,7 +123,7 @@
3. interrupt-driven I/O with termios support.
The mode of operation of the serial driver is determined at configure time in
0 - polled I/O.
1 - interrupt-driven I/O.
-@@ -208,7 +208,7 @@ from the Debian distribution.
+@@ -208,7 +208,7 @@
Test Configuration
------------------
CPU: Motorola MPC555LFMZP40, mask 1K83H
Clock Speed: Crystal 4.0 MHz, CPU 40.0 MHz
RAM: 512K bytes of 2-1-1-1 Burst SRAM
-@@ -244,7 +244,7 @@ Timing tests:
+@@ -244,7 +244,7 @@
OPERATION_COUNT=20 at configuration time.
To run tm27 (the interrupt latency timer test), short CN5-48 to CN5-50 on
exits. This doesn't seem to cause a problem otherwise.
Index: rtems/c/src/lib/libbsp/powerpc/ec555/configure.ac
===================================================================
---- rtems/c/src/lib/libbsp/powerpc/ec555/configure.ac
-+++ rtems/c/src/lib/libbsp/powerpc/ec555/configure.ac
+--- rtems.orig/c/src/lib/libbsp/powerpc/ec555/configure.ac 2007-08-14 17:51:38.000000000 +0200
++++ rtems/c/src/lib/libbsp/powerpc/ec555/configure.ac 2007-08-14 17:55:32.000000000 +0200
@@ -3,7 +3,7 @@
- ## $Id: configure.ac,v 1.7 2006/01/11 04:52:39 ralf Exp $
+ ## $Id: configure.ac,v 1.7.2.2 2006/12/02 06:06:51 ralf Exp $
- AC_PREREQ(2.59)
--AC_INIT([rtems-c-src-lib-libbsp-powerpc-mbx5xx],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
-+AC_INIT([rtems-c-src-lib-libbsp-powerpc-ec5xx],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
+ AC_PREREQ(2.60)
+-AC_INIT([rtems-c-src-lib-libbsp-powerpc-mbx5xx],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
++AC_INIT([rtems-c-src-lib-libbsp-powerpc-ec5xx],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
AC_CONFIG_SRCDIR([bsp_specs])
RTEMS_TOP(../../../../../..)
Index: rtems/make/custom/ec555.cfg
===================================================================
---- rtems/make/custom/ec555.cfg
-+++ rtems/make/custom/ec555.cfg
+--- rtems.orig/make/custom/ec555.cfg 2007-08-14 17:51:38.000000000 +0200
++++ rtems/make/custom/ec555.cfg 2007-08-14 17:53:52.000000000 +0200
@@ -1,5 +1,5 @@
#
-# Config file for an Intec Automation SS555 MPC555-based card
#
# This file is derived from:
#
-@@ -15,7 +15,7 @@ GCC_CPU_MODEL=505
+@@ -15,7 +15,7 @@
RTEMS_CPU_MODEL=mpc555
# This is the actual bsp directory used during the build process.
# This contains the compiler options necessary to select the CPU model
# and (hopefully) optimize for it.
-@@ -34,7 +34,7 @@ CFLAGS_OPTIMIZE_V=-O4 -fno-keep-inline-f
- CXXFLAGS_OPTIMIZE_V=-O4
+@@ -26,7 +26,7 @@
+ CFLAGS_OPTIMIZE_V = -O2 -g -fno-keep-inline-functions
define make-exe
- $(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) $(SS555_LDFLAGS) \
--- /dev/null
+---
+ cpukit/posix/src/usleep.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: rtems/cpukit/posix/src/usleep.c
+===================================================================
+--- rtems.orig/cpukit/posix/src/usleep.c 2007-08-15 01:51:58.000000000 +0200
++++ rtems/cpukit/posix/src/usleep.c 2007-08-15 01:50:38.000000000 +0200
+@@ -15,8 +15,8 @@
+ #include <rtems/score/tod.h>
+
+
+-unsigned usleep(
+- unsigned int useconds
++int usleep(
++ useconds_t useconds
+ )
+ {
+ struct timespec tp;
-rtems-inttypes-wcs-disable-fix.patch
+#rtems-inttypes-wcs-disable-fix.patch
rtems-m9328-pimx1-mapping-change.patch
rtems-m9328-pimx1-baud-19200.patch
rtems-m9328-pimx1-syncmclk.patch
rtems-ec555-add-to-configs.patch
rtems-update-ss555-to-ec555.patch
rtems-update-ss555-to-ec555-cpld-remove.patch
+rtems-usleep-type-fix.patch
+rtems-readlink-type-fix.patch
+rtems-m9328-pimx1-uart1to3.patch
+#rtems-m5235bcc-changes.patch
rtems-m9328-pimx1-uart1to3.patch