change log for rtems (2010-06-17)

rtems-vc at rtems.org rtems-vc at rtems.org
Thu Jun 17 17:13:14 UTC 2010


 *joel*:
2010-06-17	Joel Sherrill <joel.sherrill at oarcorp.com>

	* .cvsignore, ChangeLog, Makefile.am, configure.ac, preinstall.am,
	shared/cache/cache.c, shared/cache/cache_.h,
	shared/interrupts/installisrentries.c, shared/score/cpu.c,
	shared/score/interrupt.S, shared/syscall/sparc64-syscall.S,
	shared/syscall/sparc64-syscall.h: New files.

A    1.1  c/src/lib/libcpu/sparc64/.cvsignore
A    1.1  c/src/lib/libcpu/sparc64/ChangeLog
A    1.1  c/src/lib/libcpu/sparc64/Makefile.am
A    1.1  c/src/lib/libcpu/sparc64/configure.ac
A    1.1  c/src/lib/libcpu/sparc64/preinstall.am
A    1.1  c/src/lib/libcpu/sparc64/shared/cache/cache.c
A    1.1  c/src/lib/libcpu/sparc64/shared/cache/cache_.h
A    1.1  c/src/lib/libcpu/sparc64/shared/interrupts/installisrentries.c
A    1.1  c/src/lib/libcpu/sparc64/shared/score/cpu.c
A    1.1  c/src/lib/libcpu/sparc64/shared/score/interrupt.S
A    1.1  c/src/lib/libcpu/sparc64/shared/syscall/sparc64-syscall.S
A    1.1  c/src/lib/libcpu/sparc64/shared/syscall/sparc64-syscall.h

diff -u /dev/null rtems/c/src/lib/libcpu/sparc64/.cvsignore:1.1
--- /dev/null	Thu Jun 17 12:13:00 2010
+++ rtems/c/src/lib/libcpu/sparc64/.cvsignore	Thu Jun 17 11:16:25 2010
@@ -0,0 +1,8 @@
+aclocal.m4
+autom4te*.cache
+config.cache
+config.log
+config.status
+configure
+Makefile
+Makefile.in

diff -u /dev/null rtems/c/src/lib/libcpu/sparc64/ChangeLog:1.1
--- /dev/null	Thu Jun 17 12:13:00 2010
+++ rtems/c/src/lib/libcpu/sparc64/ChangeLog	Thu Jun 17 11:16:25 2010
@@ -0,0 +1,55 @@
+2010-06-17	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* .cvsignore, ChangeLog, Makefile.am, configure.ac, preinstall.am,
+	shared/cache/cache.c, shared/cache/cache_.h,
+	shared/interrupts/installisrentries.c, shared/score/cpu.c,
+	shared/score/interrupt.S, shared/syscall/sparc64-syscall.S,
+	shared/syscall/sparc64-syscall.h: New files.
+
+2010-05-13  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* sun4u/syscall/sparc-syscall.S: disable/enable interrupts directly.
+
+2010-05-10  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* shared/score/cpu.c, Makefile.am: Moved cpu.c from sun4v/score
+	* configure.ac: m5sim is no longer part of shared. sun4u option added.
+
+2010-05-10  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* sun4u/: New model specific subdir.
+	* sun4u/score/, sun4u/syscall/: Copied from sun4v.
+
+2010-05-03  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* m5sim/syscall/sparc-syscall.h, m5sim/syscall/sparc-syscall.S:
+	Renamed files from syscall.h and syscall.S
+
+2010-05-03  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* sun4v/syscall/syscall.S: Explicitly enable IE bit when using
+	SYS_irqset.
+	* m5sim/score/cpu.c: install raw handler and isr get level are nops
+
+2010-05-02  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* m5sim/score m5sim/syscall: new subdirs
+	* m5sim/syscall/syscall.h m5sim/syscall/syscall.S: New files.
+
+2010-05-02  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* sun4v/score/cpu_asm.S: Remove context switch code.
+
+2010-05-02  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* shared/, shared/cache, shared/interrupts: Moved cache and
+	interrupts into shared folder.
+
+2010-05-02  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* sun4v, sun4v/score/cpu_asm.S, sun4v/score/cpu.c: Copied from
+	score/cpu/sparc64
+
+2010-05-02  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* ChangeLog: New file.

diff -u /dev/null rtems/c/src/lib/libcpu/sparc64/Makefile.am:1.1
--- /dev/null	Thu Jun 17 12:13:00 2010
+++ rtems/c/src/lib/libcpu/sparc64/Makefile.am	Thu Jun 17 11:16:25 2010
@@ -0,0 +1,72 @@
+##
+## $Id$
+##
+
+ACLOCAL_AMFLAGS = -I ../../../aclocal
+
+include $(top_srcdir)/../../../automake/compile.am
+
+noinst_PROGRAMS =
+
+# NOTE: shared applies to targets meant to run with supervisor privilege,
+# i.e. sun4u or sun4v. Any targets (e.g. simulators) that cannot emulate 
+# supervisor privilege should use their own score and sparc64-syscall.
+# The other shared code is probably usable, but should be defined separately.
+# See the example at the end of Makefile.am.
+if shared
+include_libcpudir = $(includedir)/libcpu
+
+include_libcpu_HEADERS = ../shared/include/cache.h
+
+noinst_PROGRAMS += shared/shared-score.rel
+shared_shared_score_rel_SOURCES = shared/score/cpu.c shared/score/interrupt.S
+shared_shared_score_rel_CPPFLAGS = $(AM_CPPFLAGS)
+shared_shared_score_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+
+noinst_PROGRAMS += shared/sparc64-syscall.rel
+shared_sparc64_syscall_rel_SOURCES = shared/syscall/sparc64-syscall.S \
+  shared/syscall/sparc64-syscall.h
+shared_sparc64_syscall_rel_CPPFLAGS = $(AM_CPPFLAGS)
+shared_sparc64_syscall_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+
+noinst_PROGRAMS += shared/interrupts.rel
+shared_interrupts_rel_SOURCES = shared/interrupts/installisrentries.c
+shared_interrupts_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/interrupts
+shared_interrupts_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+
+noinst_PROGRAMS += shared/cache.rel
+shared_cache_rel_SOURCES = shared/cache/cache.c shared/cache/cache_.h \
+    ../shared/src/cache_aligned_malloc.c ../shared/src/cache_manager.c
+shared_cache_rel_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/shared/cache
+shared_cache_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+endif
+
+#if has_instruction_cache
+#cache_rel_CPPFLAGS += -DHAS_INSTRUCTION_CACHE
+#endif
+
+
+
+### This is an example of how to define a separate score implementation.
+## NOTE: Unlike other CPUs, we install into a subdirectory to avoid
+##       file name conflicts (See sh CPU for simexampleilar approach)
+#include_sparc64dir = $(includedir)/sparc64
+#include_rtems_scoredir = $(includedir)/rtems/score
+#
+#if simexample
+#include_sparc64_HEADERS =  
+#include_rtems_score_HEADERS = $(include_rtems_scoredir)/sparc64.h \
+#                              $(include_rtems_scoredir)/cpu.h \
+#                              $(include_rtems_scoredir)/types.h
+
+## simexample/score
+#noinst_PROGRAMS += simexample/score.rel
+#simexample_score_rel_SOURCES = 
+#simexample_score_rel_CPPFLAGS = $(AM_CPPFLAGS)
+#simexample_score_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+#
+#endif
+### End of example.
+
+include $(srcdir)/preinstall.am
+include $(top_srcdir)/../../../automake/local.am

diff -u /dev/null rtems/c/src/lib/libcpu/sparc64/configure.ac:1.1
--- /dev/null	Thu Jun 17 12:13:00 2010
+++ rtems/c/src/lib/libcpu/sparc64/configure.ac	Thu Jun 17 11:16:25 2010
@@ -0,0 +1,39 @@
+## Process this file with autoconf to produce a configure script.
+## 
+## $Id$
+
+AC_PREREQ(2.60)
+AC_INIT([rtems-c-src-lib-libcpu-sparc64],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
+AC_CONFIG_SRCDIR([shared])
+RTEMS_TOP([../../../../..],[../../..])
+
+RTEMS_CANONICAL_TARGET_CPU
+
+AM_INIT_AUTOMAKE([no-define foreign subdir-objects 1.10])
+AM_MAINTAINER_MODE
+
+RTEMS_ENV_RTEMSBSP
+
+RTEMS_PROJECT_ROOT
+
+RTEMS_PROG_CC_FOR_TARGET
+AM_PROG_CC_C_O
+RTEMS_CANONICALIZE_TOOLS
+RTEMS_PROG_CCAS
+
+AM_CONDITIONAL(shared, test x"$RTEMS_CPU_MODEL" = x"sun4v" || \
+                       test x"$RTEMS_CPU_MODEL" = x"sun4u") 
+
+AM_CONDITIONAL([sun4u],[test x"$RTEMS_CPU_MODEL" = x"sun4u"])
+AM_CONDITIONAL([sun4v],[test x"$RTEMS_CPU_MODEL" = x"sun4v"])
+
+## How to add a conditional simexample for the Makefile.am, based on a
+## RTEMS_CPU_MODEL defined as simulator.
+#AM_CONDITIONAL([simexample],[test x"$RTEMS_CPU_MODEL" = x"simulator"])
+
+RTEMS_AMPOLISH3
+
+# Explicitly list all Makefiles here
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+

diff -u /dev/null rtems/c/src/lib/libcpu/sparc64/preinstall.am:1.1
--- /dev/null	Thu Jun 17 12:13:00 2010
+++ rtems/c/src/lib/libcpu/sparc64/preinstall.am	Thu Jun 17 11:16:25 2010
@@ -0,0 +1,25 @@
+## Automatically generated by ampolish3 - Do not edit
+
+if AMPOLISH3
+$(srcdir)/preinstall.am: Makefile.am
+	$(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
+endif
+
+PREINSTALL_DIRS =
+DISTCLEANFILES = $(PREINSTALL_DIRS)
+
+all-am: $(PREINSTALL_FILES)
+
+PREINSTALL_FILES =
+CLEANFILES = $(PREINSTALL_FILES)
+
+if shared
+$(PROJECT_INCLUDE)/libcpu/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)/libcpu
+	@: > $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
+
+$(PROJECT_INCLUDE)/libcpu/cache.h: ../shared/include/cache.h $(PROJECT_INCLUDE)/libcpu/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libcpu/cache.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/libcpu/cache.h
+endif

diff -u /dev/null rtems/c/src/lib/libcpu/sparc64/shared/cache/cache.c:1.1
--- /dev/null	Thu Jun 17 12:13:00 2010
+++ rtems/c/src/lib/libcpu/sparc64/shared/cache/cache.c	Thu Jun 17 11:16:25 2010
@@ -0,0 +1,36 @@
+/*
+ *  Cache Management Support Routines for the SPARC 64
+ *
+ *  $Id$
+ */
+
+#include <rtems.h>
+#include "cache_.h"
+
+
+#if defined(HAS_INSTRUCTION_CACHE)
+
+void _CPU_cache_invalidate_entire_instruction ( void )
+{
+  asm volatile ("flush");
+}
+
+/* XXX these need to be addressed */
+void _CPU_cache_freeze_instruction ( void )
+{
+}
+
+void _CPU_cache_unfreeze_instruction ( void )
+{
+}
+
+void _CPU_cache_enable_instruction ( void )
+{
+}
+
+void _CPU_cache_disable_instruction (   void )
+{
+}
+
+#endif
+/* end of file */

diff -u /dev/null rtems/c/src/lib/libcpu/sparc64/shared/cache/cache_.h:1.1
--- /dev/null	Thu Jun 17 12:13:01 2010
+++ rtems/c/src/lib/libcpu/sparc64/shared/cache/cache_.h	Thu Jun 17 11:16:25 2010
@@ -0,0 +1,24 @@
+/*
+ *  SPARC64 Cache Manager Support
+ */
+
+#ifndef __SPARC_CACHE_h
+#define __SPARC_CACHE_h
+
+/*
+ * CACHE MANAGER: The following functions are CPU-specific.
+ * They provide the basic implementation for the rtems_* cache
+ * management routines. If a given function has no meaning for the CPU,
+ * it does nothing by default.
+ *
+ * FIXME: Some functions simply have not been implemented.
+ */
+
+#if defined(HAS_INSTRUCTION_CACHE)
+#define CPU_INSTRUCTION_CACHE_ALIGNMENT 0
+#endif
+
+#include <libcpu/cache.h>
+
+#endif
+/* end of include file */

diff -u /dev/null rtems/c/src/lib/libcpu/sparc64/shared/interrupts/installisrentries.c:1.1
--- /dev/null	Thu Jun 17 12:13:01 2010
+++ rtems/c/src/lib/libcpu/sparc64/shared/interrupts/installisrentries.c	Thu Jun 17 11:16:25 2010
@@ -0,0 +1,23 @@
+/*
+ *  Install trap handlers for handling software interrupts.
+ *  This file is deprecated, as the trap handlers are needed before this 
+ *  function is called. We still use this as for debugging purposes.
+ *
+ *  Copyright 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <rtems.h>
+#include <rtems/asm.h>
+#include <rtems/score/sparc64.h>
+#include <rtems/bspIo.h>
+
+void sparc64_install_isr_entries( void )
+{
+  return;
+}

diff -u /dev/null rtems/c/src/lib/libcpu/sparc64/shared/score/cpu.c:1.1
--- /dev/null	Thu Jun 17 12:13:01 2010
+++ rtems/c/src/lib/libcpu/sparc64/shared/score/cpu.c	Thu Jun 17 11:16:25 2010
@@ -0,0 +1,257 @@
+/*
+ *  SPARC-v9 Dependent Source
+ *
+ *  COPYRIGHT (c) 1989-2007.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  This file is based on the SPARC cpu.c file. Modifications are made to 
+ *  provide support for the SPARC-v9.
+ *    COPYRIGHT (c) 2010. Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/asm.h>
+#include <rtems/score/isr.h>
+#include <rtems/rtems/cache.h>
+
+/*
+ *  This initializes the set of opcodes placed in each trap
+ *  table entry.  The routine which installs a handler is responsible
+ *  for filling in the fields for the _handler address and the _vector
+ *  trap type.
+ *
+ *  The constants following this structure are masks for the fields which
+ *  must be filled in when the handler is installed.
+ */
+
+/*  64-bit registers complicate this. Also, in sparc v9,
+ *	each trap level gets its own set of global registers, but
+ *	does not get its own dedicated register window. so we avoid
+ *	using the local registers in the trap handler.
+ */
+const CPU_Trap_table_entry _CPU_Trap_slot_template = {
+  0x89508000,	/* rdpr   %tstate, %g4       */
+  0x05000000,	/* sethi %hh(_handler), %g2  */
+  0x8410a000,	/* or     %g2, %hm(_handler), %g2 */
+  0x8528b020,	/* sllx   %g2, 32, %g2 */
+  0x07000000,	/* sethi  %hi(_handler), %g3 */
+  0x8610c002,	/* or     %g3, %g2, %g3 */
+  0x81c0e000, /* jmp   %g3 + %lo(_handler) */
+  0x84102000  /* mov   _vector, %g2        */
+};
+
+
+/*PAGE
+ *
+ *  _CPU_ISR_Get_level
+ *
+ *  Input Parameters: NONE
+ *
+ *  Output Parameters:
+ *    returns the current interrupt level (PIL field of the PSR)
+ */
+
+uint32_t   _CPU_ISR_Get_level( void )
+{
+  uint32_t   level;
+
+  sparc64_get_interrupt_level( level );
+
+  return level;
+}
+
+/*PAGE
+ *
+ *  _CPU_ISR_install_raw_handler
+ *
+ *  This routine installs the specified handler as a "raw" non-executive
+ *  supported trap handler (a.k.a. interrupt service routine).
+ *
+ *  Input Parameters:
+ *    vector      - trap table entry number plus synchronous
+ *                    vs. asynchronous information
+ *    new_handler - address of the handler to be installed
+ *    old_handler - pointer to an address of the handler previously installed
+ *
+ *  Output Parameters: NONE
+ *    *new_handler - address of the handler previously installed
+ *
+ *  NOTE:
+ *
+ *  On the SPARC v9, there are really only 512 vectors.  However, the executive
+ *  has no easy, fast, reliable way to determine which traps are synchronous
+ *  and which are asynchronous.  By default, traps return to the
+ *  instruction which caused the interrupt.  So if you install a software
+ *  trap handler as an executive interrupt handler (which is desirable since
+ *  RTEMS takes care of window and register issues), then the executive needs
+ *  to know that the return address is to the trap rather than the instruction
+ *  following the trap.
+ *
+ *  So vectors 0 through 511 are treated as regular asynchronous traps which
+ *  provide the "correct" return address.  Vectors 512 through 1023 are assumed
+ *  by the executive to be synchronous and to require that the return be to the
+ *  trapping instruction.
+ *
+ *  If you use this mechanism to install a trap handler which must reexecute
+ *  the instruction which caused the trap, then it should be installed as
+ *  a synchronous trap.  This will avoid the executive changing the return
+ *  address.
+ */
+/*  Verified this is working properly from sparc64_install_isr_entries */
+void _CPU_ISR_install_raw_handler(
+  uint32_t    vector,
+  proc_ptr    new_handler,
+  proc_ptr   *old_handler
+)
+{
+  uint32_t               real_vector;
+  CPU_Trap_table_entry  *tba;
+  CPU_Trap_table_entry  *slot;
+  uint64_t               u64_tba;
+  uint64_t               u64_handler;
+
+  /*
+   *  Get the "real" trap number for this vector ignoring the synchronous
+   *  versus asynchronous indicator included with our vector numbers.
+   */
+
+  real_vector = SPARC_REAL_TRAP_NUMBER( vector );
+
+  /*
+   *  Get the current base address of the trap table and calculate a pointer
+   *  to the slot we are interested in.
+   */
+
+  sparc64_get_tba( u64_tba );
+
+/*  u32_tbr &= 0xfffff000; */
+  u64_tba &= 0xffffffffffff8000;  /* keep only trap base address */
+
+  tba = (CPU_Trap_table_entry *) u64_tba;
+
+  /* use array indexing to fill in lower bits -- require
+   * CPU_Trap_table_entry to be full-sized. */
+  slot = &tba[ real_vector ];
+
+  /*
+   *  Get the address of the old_handler from the trap table.
+   *
+   *  NOTE: The old_handler returned will be bogus if it does not follow
+   *        the RTEMS model.
+   */
+
+  /* shift amount to shift of hi bits (31:10) */
+#define HI_BITS_SHIFT  10
+
+  /* shift amount of hm bits (41:32) */
+#define HM_BITS_SHIFT  32
+
+  /* shift amount of hh bits (63:42) */
+#define HH_BITS_SHIFT  42
+
+  /* We're only interested in bits 0-9 of the immediate field*/
+#define IMM_MASK    0x000003FF
+
+  if ( slot->rdpr_tstate_g4 == _CPU_Trap_slot_template.rdpr_tstate_g4 ) {
+    u64_handler =
+      (((uint64_t)((slot->sethi_of_hh_handler_to_g2 << HI_BITS_SHIFT) |
+      (slot->or_g2_hm_handler_to_g2 & IMM_MASK))) << HM_BITS_SHIFT) |
+      ((slot->sethi_of_handler_to_g3 << HI_BITS_SHIFT) |
+      (slot->jmp_to_low_of_handler_plus_g3 & IMM_MASK));
+    *old_handler = (proc_ptr) u64_handler;
+  } else
+    *old_handler = 0;
+
+  /*
+   *  Copy the template to the slot and then fix it.
+   */
+
+  *slot = _CPU_Trap_slot_template;
+
+  u64_handler = (uint64_t) new_handler;
+
+  /* mask for extracting %hh */
+#define HH_BITS_MASK   0xFFFFFC0000000000
+
+  /* mask for extracting %hm */
+#define HM_BITS_MASK   0x000003FF00000000
+
+  /* mask for extracting %hi */
+#define HI_BITS_MASK   0x00000000FFFFFC00
+
+  /* mask for extracting %lo */
+#define LO_BITS_MASK   0x00000000000003FF
+
+
+  slot->mov_vector_g2 |= vector;
+  slot->sethi_of_hh_handler_to_g2 |=
+    (u64_handler & HH_BITS_MASK) >> HH_BITS_SHIFT;
+  slot->or_g2_hm_handler_to_g2 |=
+    (u64_handler & HM_BITS_MASK) >> HM_BITS_SHIFT;
+  slot->sethi_of_handler_to_g3 |=
+    (u64_handler & HI_BITS_MASK) >> HI_BITS_SHIFT;
+  slot->jmp_to_low_of_handler_plus_g3 |= (u64_handler & LO_BITS_MASK);
+
+  /* need to flush icache after this !!! */
+
+  /* need to flush icache in case old trap handler is in cache */
+  rtems_cache_invalidate_entire_instruction();
+
+}
+
+/*PAGE
+ *
+ *  _CPU_ISR_install_vector
+ *
+ *  This kernel routine installs the RTEMS handler for the
+ *  specified vector.
+ *
+ *  Input parameters:
+ *    vector       - interrupt vector number
+ *    new_handler  - replacement ISR for this vector number
+ *    old_handler  - pointer to former ISR for this vector number
+ *
+ *  Output parameters:
+ *    *old_handler - former ISR for this vector number
+ *
+ */
+
+void _CPU_ISR_install_vector(
+  uint64_t    vector,
+  proc_ptr    new_handler,
+  proc_ptr   *old_handler
+)
+{
+   uint64_t   real_vector;
+   proc_ptr   ignored;
+
+  /*
+   *  Get the "real" trap number for this vector ignoring the synchronous
+   *  versus asynchronous indicator included with our vector numbers.
+   */
+   real_vector = SPARC_REAL_TRAP_NUMBER( vector );
+   /*
+    *  Return the previous ISR handler.
+    */
+
+   *old_handler = _ISR_Vector_table[ vector ];
+
+   /*
+    *  Install the wrapper so this ISR can be invoked properly.
+    */
+
+   _CPU_ISR_install_raw_handler( vector, _ISR_Handler, &ignored );
+
+   /*
+    *  We put the actual user ISR address in '_ISR_vector_table'.  This will
+    *  be used by the _ISR_Handler so the user gets control.
+    */
+
+    _ISR_Vector_table[ real_vector ] = new_handler;
+}

diff -u /dev/null rtems/c/src/lib/libcpu/sparc64/shared/score/interrupt.S:1.1
--- /dev/null	Thu Jun 17 12:13:01 2010
+++ rtems/c/src/lib/libcpu/sparc64/shared/score/interrupt.S	Thu Jun 17 11:16:25 2010
@@ -0,0 +1,586 @@
+/*  cpu_asm.s
+ *
+ *  This file contains the basic algorithms for all assembly code used
+ *  in an specific CPU port of RTEMS.  These algorithms must be implemented
+ *  in assembly language. 
+ *
+ *  COPYRIGHT (c) 1989-2007.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  Ported to ERC32 implementation of the SPARC by On-Line Applications
+ *  Research Corporation (OAR) under contract to the European Space 
+ *  Agency (ESA).
+ *
+ *  ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995. 
+ *  European Space Agency.
+ *
+ *  Ported to Niagara and UltraSPARC III (US3) implementations of the SPARC-v9.
+ *  Niagara and US3 modifications of respective RTEMS file: 
+ *    COPYRIGHT (c) 2010. Gedare Bloom.
+ *
+ *  $Id$
+ */
+
+#include <rtems/asm.h>
+
+
+/* 
+ *  The assembler needs to be told that we know what to do with 
+ *  the global registers.
+ */
+.register %g2, #scratch
+.register %g3, #scratch
+.register %g6, #scratch
+.register %g7, #scratch
+
+
+    /*
+     *  void _ISR_Handler()
+     *
+     *  This routine provides the RTEMS interrupt management.
+     *
+     *  We enter this handler from the 8 instructions in the trap table with
+     *  the following registers assumed to be set as shown:
+     *
+     *    g4 = tstate (old l0)
+     *    g2 = trap type (vector) (old l3)
+     *
+     *  NOTE: By an executive defined convention:
+     *    if trap type is between 0 and 511 it is an asynchronous trap
+     *    if trap type is between 512 and 1023 it is an asynchonous trap
+     */
+
+  .align 4
+PUBLIC(_ISR_Handler)
+  SYM(_ISR_Handler):
+
+    /* 
+     * The ISR is called at TL = 1. 
+     * On sun4u we use the alternate globals set.     
+     *
+     * On entry:
+     *   g4 = tstate (from trap table)
+     *   g2 = trap vector #
+     * 
+     * In either case, note that trap handlers share a register window with 
+     * the interrupted context, unless we explicitly enter a new window. This 
+     * differs from Sparc v8, in which a dedicated register window is saved 
+     * for trap handling.  This means we have to avoid overwriting any registers
+     * that we don't save.
+     *
+     */
+
+
+    /*
+     *  save some or all context on stack
+     */
+
+    /*
+     *  Save the state of the interrupted task -- especially the global
+     *  registers -- in the Interrupt Stack Frame.  Note that the ISF
+     *  includes a regular minimum stack frame which will be used if
+     *  needed by register window overflow and underflow handlers.
+     *
+     *  This is slightly wasteful, since the stack already has the window
+     *  overflow space reserved, but there is no obvious way to ensure 
+     *  we can store the interrupted state and still handle window 
+     *  spill/fill correctly, since there is no room for the ISF.
+     *
+     */
+
+    /* this is for debugging purposes, make sure that TL = 1, otherwise 
+     * things might get dicey */
+    rdpr %tl, %g1
+    cmp %g1, 1
+    be 1f
+    nop
+
+    0: ba 0b
+    nop
+
+    1:
+    /* first store the sp of the interrupted task temporarily in g1 */
+    mov   %sp, %g1
+
+    sub     %sp, CONTEXT_CONTROL_INTERRUPT_FRAME_SIZE, %sp
+    ! make space for Stack_Frame||ISF
+
+    /* save tstate, tpc, tnpc, pil */
+    stx   %g4, [%sp + STACK_BIAS + ISF_TSTATE_OFFSET]  
+    rdpr  %pil, %g3
+    rdpr  %tpc, %g4
+    rdpr  %tnpc, %g5
+    stx   %g3, [%sp + STACK_BIAS + ISF_PIL_OFFSET]
+    stx   %g4, [%sp + STACK_BIAS + ISF_TPC_OFFSET]
+    stx   %g5, [%sp + STACK_BIAS + ISF_TNPC_OFFSET]
+    stx   %g2, [%sp + STACK_BIAS + ISF_TVEC_NUM]
+
+    rd  %y, %g4        ! save y
+    stx   %g4, [%sp + STACK_BIAS + ISF_Y_OFFSET]
+
+    ! save interrupted frame's output regs
+    stx     %o0, [%sp + STACK_BIAS + ISF_O0_OFFSET]     ! save o0
+    stx     %o1, [%sp + STACK_BIAS + ISF_O1_OFFSET]     ! save o1
+    stx     %o2, [%sp + STACK_BIAS + ISF_O2_OFFSET]     ! save o2
+    stx     %o3, [%sp + STACK_BIAS + ISF_O3_OFFSET]     ! save o3
+    stx     %o4, [%sp + STACK_BIAS + ISF_O4_OFFSET]     ! save o4
+    stx     %o5, [%sp + STACK_BIAS + ISF_O5_OFFSET]     ! save o5
+    stx     %g1, [%sp + STACK_BIAS + ISF_O6_SP_OFFSET]  ! save o6/sp
+    stx     %o7, [%sp + STACK_BIAS + ISF_O7_OFFSET]     ! save o7
+
+    mov  %g1, %o5    ! hold the old sp here for now
+    mov  %g2, %o1    ! we'll need trap # later
+
+    /* switch to TL[0] */
+    wrpr  %g0, 0, %tl
+
+    /* switch to normal globals */
+#if defined (SUN4U)
+    /* the assignment to pstate below will mask out the AG bit */
+#elif defined (SUN4V)
+    wrpr  %g0, 0, %gl
+#endif
+    /* get pstate to known state */
+    wrpr  %g0, SPARC_PSTATE_PRIV_MASK | SPARC_PSTATE_PEF_MASK, %pstate
+
+    ! save globals
+    stx     %g1, [%sp + STACK_BIAS + ISF_G1_OFFSET]     ! save g1
+    stx     %g2, [%sp + STACK_BIAS + ISF_G2_OFFSET]     ! save g2
+    stx     %g3, [%sp + STACK_BIAS + ISF_G3_OFFSET]     ! save g3
+    stx     %g4, [%sp + STACK_BIAS + ISF_G4_OFFSET]     ! save g4
+    stx     %g5, [%sp + STACK_BIAS + ISF_G5_OFFSET]     ! save g5
+    stx     %g6, [%sp + STACK_BIAS + ISF_G6_OFFSET]     ! save g6
+    stx     %g7, [%sp + STACK_BIAS + ISF_G7_OFFSET]     ! save g7
+
+
+  mov  %o1, %g2  ! get the trap #
+  mov  %o5, %g7  ! store the interrupted %sp (preserve)
+  mov  %sp, %o1  ! 2nd arg to ISR Handler = address of ISF
+
+  /*
+   *  Increment ISR nest level and Thread dispatch disable level.
+   *
+   *  Register usage for this section: (note, these are used later)
+   *
+   *    g3 = _Thread_Dispatch_disable_level pointer
+   *    g5 = _Thread_Dispatch_disable_level value (uint32_t)
+   *    g6 = _ISR_Nest_level pointer
+   *    g4 = _ISR_Nest_level value (uint32_t)
+   *    o5 = temp
+   *
+   *  NOTE: It is assumed that g6 - g7 will be preserved until the ISR
+   *        nest and thread dispatch disable levels are unnested.
+   */
+
+  setx  SYM(_Thread_Dispatch_disable_level), %o5, %g3
+  lduw  [%g3], %g5
+  setx  SYM(_ISR_Nest_level), %o5, %g6
+  lduw  [%g6], %g4
+
+  add      %g5, 1, %g5
+  stuw     %g5, [%g3]
+
+  add      %g4, 1, %g4
+  stuw     %g4, [%g6]
+
+  /*
+   *  If ISR nest level was zero (now 1), then switch stack.
+   */
+
+  subcc    %g4, 1, %g4             ! outermost interrupt handler?
+  bnz      dont_switch_stacks      ! No, then do not switch stacks
+
+  setx  SYM(_CPU_Interrupt_stack_high), %o5, %g1
+  ldx  [%g1], %sp
+
+  /*
+   * Adjust the stack for the stack bias
+   */
+  sub     %sp, STACK_BIAS, %sp
+
+  /*
+   *  Make sure we have a place on the stack for the window overflow
+   *  trap handler to write into.  At this point it is safe to
+   *  enable traps again.
+   */
+
+  sub      %sp, CPU_MINIMUM_STACK_FRAME_SIZE, %sp
+
+  dont_switch_stacks:
+  /*
+   *  Check if we have an external interrupt (trap 0x41 - 0x4f). If so,
+   *  set the PIL to mask off interrupts with lower priority.
+   *
+   *  The original PIL is not modified since it will be restored
+   *  when the interrupt handler returns.
+   */
+
+  and      %g2, 0x0ff, %g1 ! is bottom byte of vector number [0x41,0x4f]?
+
+  subcc    %g1, 0x41, %g0
+  bl       dont_fix_pil
+  subcc    %g1, 0x4f, %g0
+  bg       dont_fix_pil
+  nop
+  wrpr     %g0, %g1, %pil
+
+  dont_fix_pil:
+  /* We need to be careful about enabling traps here.
+   *
+   * We already stored off the tstate, tpc, and tnpc, and switched to
+   * TL = 0, so it should be safe.
+   */
+
+  /* zero out g4 so that ofw calls work */
+  mov  %g0, %g4
+
+  ! **** ENABLE TRAPS ****
+  wrpr  %g0, SPARC_PSTATE_PRIV_MASK | SPARC_PSTATE_PEF_MASK | \
+    SPARC_PSTATE_IE_MASK, %pstate 
+
+    /*
+     *  Vector to user's handler.
+     *
+     *  NOTE: TBR may no longer have vector number in it since
+     *        we just enabled traps.  It is definitely in g2.
+     */
+    setx  SYM(_ISR_Vector_table), %o5, %g1
+    ldx      [%g1], %g1
+    and      %g2, 0x1FF, %o5        ! remove synchronous trap indicator
+    sll      %o5, 3, %o5            ! o5 = offset into table
+    ldx      [%g1 + %o5], %g1       ! g1 = _ISR_Vector_table[ vector ]
+
+
+    ! o1 = 2nd arg = address of the ISF
+    !   WAS LOADED WHEN ISF WAS SAVED!!!
+    mov      %g2, %o0               ! o0 = 1st arg = vector number
+    call     %g1, 0
+    nop                             ! delay slot
+
+    /*
+     *  Redisable traps so we can finish up the interrupt processing.
+     *  This is a conservative place to do this.
+     */
+    ! **** DISABLE TRAPS ****
+    wrpr  %g0, SPARC_PSTATE_PRIV_MASK, %pstate
+
+    /* 
+     * We may safely use any of the %o and %g registers, because 
+     * we saved them earlier (and any other interrupt that uses 
+     * them will also save them).  Right now, the state of those
+     * registers are as follows:
+     *  %o registers: unknown (user's handler may have destroyed)
+     *  %g1,g4,g5: scratch
+     *  %g2: unknown: was trap vector
+     *  %g3: uknown: was _Thread_Dispatch_Disable_level pointer
+     *  %g6: _ISR_Nest_level
+     *  %g7: interrupted task's sp
+     */
+
+    /*
+     *  Increment ISR nest level and Thread dispatch disable level.
+     *
+     *  Register usage for this section: (note: as used above)
+     *
+     *    g3 = _Thread_Dispatch_disable_level pointer
+     *    g5 = _Thread_Dispatch_disable_level value
+     *    g6 = _ISR_Nest_level pointer
+     *    g4 = _ISR_Nest_level value
+     *    o5 = temp
+     */
+
+    /* We have to re-load the values from memory, because there are
+     * not enough registers that we know will be preserved across the
+     * user's handler. If this is a problem, we can create a register
+     * window for _ISR_Handler.
+     */
+
+    setx  SYM(_Thread_Dispatch_disable_level), %o5, %g3
+    lduw  [%g3],%g5
+    lduw  [%g6],%g4
+    sub   %g5, 1, %g5
+    stuw  %g5, [%g3]
+    sub   %g4, 1, %g4
+    stuw  %g4, [%g6]
+
+    orcc  %g4, %g0, %g0           ! ISRs still nested?
+    bnz   dont_restore_stack      ! Yes then don't restore stack yet
+    nop
+
+    /*
+     *  This is the outermost interrupt handler. Need to get off the
+     *  CPU Interrupt Stack and back to the tasks stack.
+     *
+     *  The following subtract should get us back on the interrupted
+     *  tasks stack and add enough room to invoke the dispatcher.
+     *  When we enable traps, we are mostly back in the context
+     *  of the task and subsequent interrupts can operate normally.
+     *
+     *  Now %sp points to the bottom of the ISF.
+     *  
+     */
+
+    sub      %g7,   CONTEXT_CONTROL_INTERRUPT_FRAME_SIZE, %sp
+
+    dont_restore_stack:
+
+    /*
+     *  If dispatching is disabled (includes nested interrupt case),
+     *  then do a "simple" exit.
+     */
+
+    orcc     %g5, %g0, %g0   ! Is dispatching disabled?
+    bnz      simple_return   ! Yes, then do a "simple" exit
+    ! NOTE: Use the delay slot
+    mov      %g0, %g4  ! clear g4 for ofw
+
+    ! Are we dispatching from a previous ISR in the interrupted thread?
+    setx  SYM(_CPU_ISR_Dispatch_disable), %o5, %g5
+    lduw     [%g5], %o5
+    orcc     %o5, %g0, %g0   ! Is this thread already doing an ISR?
+    bnz      simple_return   ! Yes, then do a "simple" exit
+    nop
+
+    setx    SYM(_Context_Switch_necessary), %o5, %g7
+
+
+    /*
+     *  If a context switch is necessary, then do fudge stack to
+     *  return to the interrupt dispatcher.
+     */
+
+    ldub     [%g7], %o5
+
+    orcc     %o5, %g0, %g0   ! Is thread switch necessary?
+    bnz      SYM(_ISR_Dispatch) ! yes, then invoke the dispatcher
+    nop
+
+    /*
+     *  Finally, check to see if signals were sent to the currently
+     *  executing task.  If so, we need to invoke the interrupt dispatcher.
+     */
+    setx    SYM(_ISR_Signals_to_thread_executing), %o5, %g5
+    ldub    [%g5], %o5
+
+    orcc    %o5, %g0, %g0   ! Were signals sent to the currently
+    !   executing thread?
+    bz      simple_return   ! yes, then invoke the dispatcher
+    ! use the delay slot to clear the signals
+    !   to the currently executing task flag
+    stb     %g0, [%g5]
+
+
+    /*
+     *  Invoke interrupt dispatcher.
+     */
+PUBLIC(_ISR_Dispatch)
+  SYM(_ISR_Dispatch):
+    ! Set ISR dispatch nesting prevention flag
+      mov      1, %o1
+      setx     SYM(_CPU_ISR_Dispatch_disable), %o5, %o2
+      stuw     %o1, [%o2]
+
+
+      !  **** ENABLE TRAPS ****
+      wrpr  %g0, SPARC_PSTATE_PRIV_MASK | SPARC_PSTATE_PEF_MASK | \
+        SPARC_PSTATE_IE_MASK, %pstate
+        isr_dispatch:
+        call    SYM(_Thread_Dispatch), 0
+        nop
+
+        /*
+         *  We invoked _Thread_Dispatch in a state similar to the interrupted
+         *  task.  In order to safely be able to tinker with the register
+         *  windows and get the task back to its pre-interrupt state, 
+         *  we need to disable interrupts. 
+         */
+      mov   2, %g4        ! syscall (disable interrupts)
+      ta    0             ! syscall (disable interrupts)
+      mov   0, %g4
+
+  /*
+   *  While we had ISR dispatching disabled in this thread,
+   *  did we miss anything.  If so, then we need to do another
+   *  _Thread_Dispatch before leaving this ISR Dispatch context.
+   */
+
+  setx     SYM(_Context_Switch_necessary), %o5, %o1
+  ldub     [%o1], %o2
+
+  ! NOTE: Use some of delay slot to start loading this
+  setx     SYM(_ISR_Signals_to_thread_executing), %o5, %o1
+  ldub     [%o1], %o3
+
+  orcc     %o2, %g0, %g0   ! Is thread switch necessary?
+  bnz      dispatchAgain   ! yes, then invoke the dispatcher AGAIN
+  ! NOTE: Use the delay slot to catch the orcc below
+
+  /*
+   *  Finally, check to see if signals were sent to the currently
+   *  executing task.  If so, we need to invoke the interrupt dispatcher.
+   */
+
+  ! NOTE: Delay slots above were used to perform the load AND
+  !       this orcc falls into the delay slot for bnz above
+  orcc     %o3, %g0, %g0   ! Were signals sent to the currently
+  !   executing thread?
+  bz       allow_nest_again ! No, then clear out and return
+  nop
+
+  ! Yes, then invoke the dispatcher
+  dispatchAgain:
+  mov      3, %g4        ! syscall (enable interrupts)
+  ta       0             ! syscall (enable interrupts)
+  ba       isr_dispatch
+  mov      0, %g4
+
+  allow_nest_again:
+
+  ! Zero out ISR stack nesting prevention flag
+  setx    SYM(_CPU_ISR_Dispatch_disable), %o5, %o1
+  stuw    %g0,[%o1]
+
+  /*
+   *  The CWP in place at this point may be different from
+   *  that which was in effect at the beginning of the ISR if we
+   *  have been context switched between the beginning of this invocation
+   *  of _ISR_Handler and this point.  Thus the CWP and WIM should
+   *  not be changed back to their values at ISR entry time.  Any
+   *  changes to the PSR must preserve the CWP.
+   */
+
+  simple_return:
+  flushw          ! get register windows to a 'clean' state 
+
+  ! **** DISABLE TRAPS ****
+  wrpr    %g0, SPARC_PSTATE_PRIV_MASK, %pstate
+
+  ldx     [%sp + STACK_BIAS + ISF_Y_OFFSET], %o1      ! restore y
+  wr      %o1, 0, %y
+
+  ldx  [%sp + STACK_BIAS + ISF_TSTATE_OFFSET], %g1
+
+! see if cwp is proper (tstate.cwp == cwp)
+  and  %g1, 0x1F, %g6
+  rdpr  %cwp, %g7
+  cmp  %g6, %g7
+  bz  good_window
+  nop
+
+  /*
+   * Fix the CWP. Need the cwp to be the proper cwp that
+   * gets restored when returning from the trap via retry/done. Do 
+   * this before reloading the task's output regs. Basically fake a
+   * window spill/fill.
+   *
+   * Is this necessary on sun4v? Why not just re-write 
+   * tstate.cwp to be equal to the current cwp?
+   */
+  mov  %sp, %g1
+  stx  %l0, [%sp + STACK_BIAS + CPU_STACK_FRAME_L0_OFFSET]
+  stx  %l1, [%sp + STACK_BIAS + CPU_STACK_FRAME_L1_OFFSET]
+  stx  %l2, [%sp + STACK_BIAS + CPU_STACK_FRAME_L2_OFFSET]
+  stx  %l3, [%sp + STACK_BIAS + CPU_STACK_FRAME_L3_OFFSET]
+  stx  %l4, [%sp + STACK_BIAS + CPU_STACK_FRAME_L4_OFFSET]
+  stx  %l5, [%sp + STACK_BIAS + CPU_STACK_FRAME_L5_OFFSET]
+  stx  %l6, [%sp + STACK_BIAS + CPU_STACK_FRAME_L6_OFFSET]
+  stx  %l7, [%sp + STACK_BIAS + CPU_STACK_FRAME_L7_OFFSET]
+  stx  %i0, [%sp + STACK_BIAS + CPU_STACK_FRAME_I0_OFFSET]
+  stx  %i1, [%sp + STACK_BIAS + CPU_STACK_FRAME_I1_OFFSET]
+  stx  %i2, [%sp + STACK_BIAS + CPU_STACK_FRAME_I2_OFFSET]
+  stx  %i3, [%sp + STACK_BIAS + CPU_STACK_FRAME_I3_OFFSET]
+  stx  %i4, [%sp + STACK_BIAS + CPU_STACK_FRAME_I4_OFFSET]
+  stx  %i5, [%sp + STACK_BIAS + CPU_STACK_FRAME_I5_OFFSET]
+  stx  %i6, [%sp + STACK_BIAS + CPU_STACK_FRAME_I6_FP_OFFSET]
+  stx  %i7, [%sp + STACK_BIAS + CPU_STACK_FRAME_I7_OFFSET]
+  wrpr  %g0, %g6, %cwp
+  mov  %g1, %sp
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_L0_OFFSET], %l0
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_L1_OFFSET], %l1
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_L2_OFFSET], %l2
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_L3_OFFSET], %l3
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_L4_OFFSET], %l4
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_L5_OFFSET], %l5
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_L6_OFFSET], %l6
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_L7_OFFSET], %l7
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_I0_OFFSET], %i0
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_I1_OFFSET], %i1
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_I2_OFFSET], %i2
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_I3_OFFSET], %i3
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_I4_OFFSET], %i4
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_I5_OFFSET], %i5
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_I6_FP_OFFSET], %i6
+  ldx  [%sp + STACK_BIAS + CPU_STACK_FRAME_I7_OFFSET], %i7
+
+
+  good_window:
+
+
+  /*
+   *  Restore tasks global and out registers
+   */
+
+  ldx     [%sp + STACK_BIAS + ISF_G1_OFFSET], %g1    ! restore g1
+  ldx     [%sp + STACK_BIAS + ISF_G2_OFFSET], %g2    ! restore g2
+  ldx     [%sp + STACK_BIAS + ISF_G3_OFFSET], %g3    ! restore g3
+  ldx     [%sp + STACK_BIAS + ISF_G4_OFFSET], %g4    ! restore g4
+  ldx     [%sp + STACK_BIAS + ISF_G5_OFFSET], %g5    ! restore g5
+  ldx     [%sp + STACK_BIAS + ISF_G6_OFFSET], %g6    ! restore g6
+  ldx     [%sp + STACK_BIAS + ISF_G7_OFFSET], %g7    ! restore g7
+
+
+
+  ! return to TL[1], GL[1], and restore TSTATE, TPC, and TNPC
+  wrpr  %g0, 1, %tl
+
+  ! return to GL=1 or AG
+#if defined(SUN4U)
+    rdpr  %pstate, %g1
+    andn  %g1, SPARC_PSTATE_AG_MASK, %g1
+    wrpr  %g1, %g0, %pstate                 ! go to regular global
+#elif defined(SUN4V)
+  wrpr  %g0, 1, %gl
+#endif
+
+! now we can use global registers (at gl=1 or AG)
+  ldx   [%sp + STACK_BIAS + ISF_PIL_OFFSET], %g3
+  ldx   [%sp + STACK_BIAS + ISF_TPC_OFFSET], %g4
+  ldx   [%sp + STACK_BIAS + ISF_TNPC_OFFSET], %g5
+  ldx   [%sp + STACK_BIAS + ISF_TSTATE_OFFSET], %g1
+  ldx   [%sp + STACK_BIAS + ISF_TVEC_NUM], %g2
+  wrpr  %g0, %g3, %pil
+  wrpr  %g0, %g4, %tpc
+  wrpr  %g0, %g5, %tnpc
+
+  wrpr    %g0, %g1, %tstate
+
+  ldx     [%sp + STACK_BIAS + ISF_O0_OFFSET], %o0    ! restore o0
+  ldx     [%sp + STACK_BIAS + ISF_O1_OFFSET], %o1    ! restore o1
+  ldx     [%sp + STACK_BIAS + ISF_O2_OFFSET], %o2    ! restore o2
+  ldx     [%sp + STACK_BIAS + ISF_O3_OFFSET], %o3    ! restore o3
+  ldx     [%sp + STACK_BIAS + ISF_O4_OFFSET], %o4    ! restore o4
+  ldx     [%sp + STACK_BIAS + ISF_O5_OFFSET], %o5    ! restore o5
+  ! sp is restored later
+  ldx     [%sp + STACK_BIAS + ISF_O7_OFFSET], %o7    ! restore o7
+
+  ldx     [%sp + STACK_BIAS + ISF_O6_SP_OFFSET], %o6 ! restore o6/sp
+
+  /*
+   *  Determine whether to re-execute the trapping instruction 
+   *  (asynchronous trap) or to skip the trapping instruction
+   *  (synchronous trap).
+   */
+
+  andcc   %g2, SPARC_SYNCHRONOUS_TRAP_BIT_MASK, %g0
+  ! Is this a synchronous trap?
+  be  not_synch             ! No, then skip trapping instruction
+  mov  0, %g4
+  retry        ! re-execute trapping instruction
+  not_synch:
+  done        ! skip trapping instruction
+
+/* end of file */

diff -u /dev/null rtems/c/src/lib/libcpu/sparc64/shared/syscall/sparc64-syscall.S:1.1
--- /dev/null	Thu Jun 17 12:13:01 2010
+++ rtems/c/src/lib/libcpu/sparc64/shared/syscall/sparc64-syscall.S	Thu Jun 17 11:16:25 2010
@@ -0,0 +1,128 @@
+/*
+ *  systrap.S
+ *
+ *  This file contains emulated system calls using software trap 0.
+ *  The following calls are supported:
+ *
+ *    + SYS_exit  (halt)
+ *    + SYS_irqdis  (disable interrupts)
+ *    + SYS_irqset  (set interrupt level)
+ * 
+ *  COPYRIGHT:
+ *
+ *  COPYRIGHT (c) 1995. European Space Agency.
+ *  COPYRIGHT (c) 2010. Gedare Bloom.
+ *
+ *  This terms of the RTEMS license apply to this file.
+ *
+ */
+
+#include <rtems/asm.h>
+#include "sparc64-syscall.h"
+
+
+.seg    "text"
+/*
+ *  system call
+ *
+ *  On entry:
+ *      g4[AG | GL=1] = tstate (from trap table)
+ *      g2[AG | GL=1] = trap vector # (256)
+ *      g3[AG | GL=1] = address of SYM(syscall)
+ *      g4[AG | GL-1] = system call id
+ *    if arch = sun4v:
+ *      We need to back to GL-1 to read the system call id. 
+ *   on sun4u:
+ *      We need to go back to the normal globals to read the system call id.
+ *    
+ *    First thing is to return to the previous set of globals, so 
+ *    that the system call id can be read.  The syscall code needs 
+ *    to re-read tstate.
+ *
+ *    syscall should only ever be entered by ta 0 being called explicitly
+ *    by a function that knows what is happening.  This means the syscall
+ *    code can safely use any scratch registers and the %o registers.
+ */
+
+
+PUBLIC(syscall)
+
+  
+  SYM(syscall):
+    mov   %g0, %g4  ! clear %g4 at this GL
+#if defined (SUN4U)
+    rdpr  %pstate, %g1
+    andn  %g1, SPARC_PSTATE_AG_MASK, %g1
+    wrpr  %g1, %g0, %pstate                 ! go to regular globals
+#elif defined (SUN4V)
+    rdpr  %gl, %g1
+    dec   %g1
+    wrpr  %g0, %g1, %gl                     ! go back to GL = GL - 1
+#endif
+
+    subcc %g4, 2, %g0                     
+    bne   3f
+    rdpr  %tstate, %g5                      ! re-read tstate, use delay slot
+
+    ! syscall 2, disable interrupts
+    rdpr  %pil, %g1
+    and   %g5, SPARC_TSTATE_IE_MASK, %o0
+    or    %o0, %g1, %o0                     ! return TSTATE_IE | PIL
+    wrpr  %g0, 0xf, %pil                    ! set PIL to 15
+    andn  %g5, SPARC_TSTATE_IE_MASK, %g1
+    wrpr  %g0, %g1, %tstate                 ! disable interrupts in trap state
+    ba,a  9f
+
+    3:  ! syscall 3, enable interrupts
+    subcc %g4, 3, %g0                     
+    bne   1f
+    and   %o0, 0xf, %g1
+    wrpr  %g0, %g1, %pil                    ! restore PIL
+!    and   %o0, SPARC_TSTATE_IE_MASK, %g1
+!    or    %g5, %g1, %g1                     ! restore saved IE
+    or    %g5, SPARC_TSTATE_IE_MASK, %g1    ! restore IE (safe?)
+    wrpr  %g0, %g1, %tstate     
+    ba,a  9f
+
+    1:          
+    ba,a  1b                                ! spin. taking a trap here -> htrap
+
+    9:                                      ! leave
+    mov  0, %g4                             ! clear %g4
+    DONE
+
+PUBLIC(sparc_disable_interrupts)
+
+  SYM(sparc_disable_interrupts):
+    mov  SYS_irqdis, %g4
+    ta  0
+#if 0
+    rdpr  %pstate, %g5
+    rdpr  %pil, %g1
+    and   %g5, SPARC_PSTATE_IE_MASK, %o0
+    or    %o0, %g1, %o0                     ! return PSTATE_IE | PIL
+    wrpr  %g0, 0xf, %pil                    ! set PIL to 15
+    andn  %g5, SPARC_PSTATE_IE_MASK, %g1
+    wrpr  %g0, %g1, %pstate                 ! disable interrupts
+#endif
+    retl  
+    nop
+
+PUBLIC(sparc_enable_interrupts)
+
+  SYM(sparc_enable_interrupts):
+    mov  SYS_irqen, %g4
+    ta  0
+#if 0
+    rdpr  %pstate, %g5
+    and   %o0, 0xf, %g1
+    wrpr  %g0, %g1, %pil                    ! restore PIL
+    and   %o0, SPARC_PSTATE_IE_MASK, %g1
+    or    %g5, %g1, %g1                     ! restore saved IE
+!    or    %g5, SPARC_PSTATE_IE_MASK, %g1    ! set IE regardless of old (safe?)
+    wrpr  %g0, %g1, %pstate
+#endif
+    retl  
+    nop
+
+    /* end of file */

diff -u /dev/null rtems/c/src/lib/libcpu/sparc64/shared/syscall/sparc64-syscall.h:1.1
--- /dev/null	Thu Jun 17 12:13:01 2010
+++ rtems/c/src/lib/libcpu/sparc64/shared/syscall/sparc64-syscall.h	Thu Jun 17 11:16:25 2010
@@ -0,0 +1,4 @@
+
+#define SYS_exit        1
+#define SYS_irqdis      2
+#define SYS_irqen       3


 *joel*:
2010-06-17	Joel Sherrill <joel.sherrill at oarcorp.com>

	* ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
	preinstall.am, include/bsp.h, include/tm27.h,
	make/custom/niagara.cfg, start/bspinit.S: New files.

A    1.1  c/src/lib/libbsp/sparc64/niagara/ChangeLog
A    1.1  c/src/lib/libbsp/sparc64/niagara/Makefile.am
A    1.1  c/src/lib/libbsp/sparc64/niagara/README
A    1.1  c/src/lib/libbsp/sparc64/niagara/bsp_specs
A    1.1  c/src/lib/libbsp/sparc64/niagara/configure.ac
A    1.1  c/src/lib/libbsp/sparc64/niagara/include/bsp.h
A    1.1  c/src/lib/libbsp/sparc64/niagara/include/tm27.h
A    1.1  c/src/lib/libbsp/sparc64/niagara/make/custom/niagara.cfg
A    1.1  c/src/lib/libbsp/sparc64/niagara/preinstall.am
A    1.1  c/src/lib/libbsp/sparc64/niagara/start/bspinit.S

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/niagara/ChangeLog:1.1
--- /dev/null	Thu Jun 17 12:13:01 2010
+++ rtems/c/src/lib/libbsp/sparc64/niagara/ChangeLog	Thu Jun 17 11:20:32 2010
@@ -0,0 +1,29 @@
+2010-06-17	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+	preinstall.am, include/bsp.h, include/tm27.h,
+	make/custom/niagara.cfg, start/bspinit.S: New files.
+
+2010-06-05  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* Makefile.am: Move console driver to ../shared directory. 
+
+2010-05-15  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* Makefile.am: Update to new ../helenos directory layout.
+
+2010-05-13  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* start/bspinit.S: New file.
+
+2010-05-03  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* Makefile.am: Add shared-score.rel to libadd.
+
+2010-05-02  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* Makefile.am: Uses model specific libcpu/syscall
+
+2009-10-19	Eugen Leontie
+
+	* ChangeLog: New file.

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/niagara/Makefile.am:1.1
--- /dev/null	Thu Jun 17 12:13:01 2010
+++ rtems/c/src/lib/libbsp/sparc64/niagara/Makefile.am	Thu Jun 17 11:20:33 2010
@@ -0,0 +1,83 @@
+##
+## $Id$
+##
+
+ACLOCAL_AMFLAGS = -I ../../../../aclocal
+
+include $(top_srcdir)/../../../../automake/compile.am
+include $(top_srcdir)/../../bsp.am
+
+include_bspdir = $(includedir)/bsp
+
+dist_project_lib_DATA = bsp_specs
+
+include_HEADERS = include/bsp.h 
+include_HEADERS += include/tm27.h
+include_HEADERS += ../shared/include/asm.h
+
+include_bootdir = $(includedir)/boot
+include_boot_HEADERS = ../shared/helenos/boot/include/align.h \
+  ../shared/helenos/boot/include/balloc.h \
+  ../shared/helenos/boot/include/gentypes.h \
+  ../shared/helenos/boot/include/main.h \
+  ../shared/helenos/boot/include/ofwarch.h \
+  ../shared/helenos/boot/include/ofw.h \
+  ../shared/helenos/boot/include/ofw_tree.h \
+  ../shared/helenos/boot/include/register.h \
+  ../shared/helenos/boot/include/stack.h \
+  ../shared/helenos/boot/include/types.h
+
+nodist_include_HEADERS = include/bspopts.h    
+nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h 
+DISTCLEANFILES = include/bspopts.h
+noinst_PROGRAMS =
+
+nodist_include_HEADERS += ../../shared/include/coverhd.h
+
+
+EXTRA_DIST = ../shared/start/start.S
+start.$(OBJEXT): ../shared/start/start.S
+	$(CPPASCOMPILE) -o $@ -c $<
+project_lib_DATA = start.$(OBJEXT)
+
+dist_project_lib_DATA += ../shared/startup/linkcmds
+
+startup_SOURCES = ../../shared/bspclean.c ../../shared/bsplibc.c \
+    ../../shared/bsppredriverhook.c ../../shared/bsppretaskinghook.c \
+    ../../shared/bsppost.c \
+    ../../shared/bootcard.c ../../shared/sbrk.c \
+    ../shared/startup/bspgetworkarea.c \
+    ../shared/startup/bspstart.c \
+    ../shared/startup/setvec.c \
+    ../../shared/gnatinstallhandler.c  \
+    ../shared/helenos/boot/genarch/balloc.c \
+    ../shared/helenos/boot/genarch/ofw.c \
+    ../shared/helenos/boot/genarch/ofw_tree.c \
+    ../shared/helenos/boot/generic/string.c \
+    ../shared/helenos/boot/sparc64/loader/ofwarch.c \
+    ../shared/helenos/boot/sparc64/loader/main.c \
+    ../shared/helenos/boot/sparc64/loader/ofwasm.S \
+    start/bspinit.S \
+    ../shared/asm/asm.S
+
+#clock_SOURCES = ../../shared/clock_driver_simidle.c
+clock_SOURCES = ../shared/clock/ckinit.c
+
+console_SOURCES = ../../shared/console.c  ../shared/console/conscfg.c
+
+timer_SOURCES = ../../shared/timerstub.c
+
+noinst_LIBRARIES = libbsp.a
+libbsp_a_SOURCES = $(startup_SOURCES) $(clock_SOURCES) $(console_SOURCES) \
+    $(timer_SOURCES)
+
+libbsp_a_LIBADD = \
+      ../../../libcpu/@RTEMS_CPU@/shared/shared-score.rel \
+      ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
+      ../../../libcpu/@RTEMS_CPU@/shared/interrupts.rel \
+      ../../../libcpu/@RTEMS_CPU@/shared/sparc64-syscall.rel 
+
+EXTRA_DIST += times
+
+include $(srcdir)/preinstall.am
+include $(top_srcdir)/../../../../automake/local.am

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/niagara/README:1.1
--- /dev/null	Thu Jun 17 12:13:01 2010
+++ rtems/c/src/lib/libbsp/sparc64/niagara/README	Thu Jun 17 11:20:33 2010
@@ -0,0 +1,69 @@
+#
+#  $Id$
+#
+
+BSP NAME:           niagara
+BOARD:              
+BUS:                n/a
+CPU FAMILY:         SPARC V9 with UltraSPARC Architecture 2005 (a.k.a. sun4v)
+CPU:                UltraSPARC T1 (OpenSPARC T1)
+COPROCESSORS:       
+MODE:               n/a
+
+DEBUG MONITOR:      
+
+PERIPHERALS
+===========
+TIMERS:             TICK and STICK registers (ASRs 4 and 24)
+  RESOLUTION:         CPU clock resolution
+SERIAL PORTS:       
+REAL-TIME CLOCK:    
+DMA:                none
+VIDEO:              none
+SCSI:               none
+NETWORKING:         none
+
+DRIVER INFORMATION
+==================
+CLOCK DRIVER:       
+IOSUPP DRIVER:      
+SHMSUPP:            
+TIMER DRIVER:       
+TTY DRIVER:         
+
+STDIO
+=====
+PORT:               
+ELECTRICAL:         
+BAUD:               
+BITS PER CHARACTER: 
+PARITY:             
+STOP BITS:          
+
+NOTES
+=====
+
+Board description
+-----------------
+clock rate:     
+bus width:      
+ROM:            
+RAM:            
+
+This BSP is designed to operate on the UltraSPARC T1 (Niagara) SPARC64 
+and similar processors.
+
+This BSP has been run on the Simics simulator with the niagara target, which 
+simulates the OpenSPARC T1 Niagara implementation.
+
+This BSP has been run on the M5 simulator with the SPARC_FS target, which
+simulates the OpenSPARC T1 Niagara implementation.
+
+Simics:
+A commercially available simulator licensed by Virtutech.
+https://www.simics.net/
+
+M5:
+An open-source simulator.
+http://www.m5sim.org/wiki/index.php/Main_Page
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/niagara/bsp_specs:1.1
--- /dev/null	Thu Jun 17 12:13:01 2010
+++ rtems/c/src/lib/libbsp/sparc64/niagara/bsp_specs	Thu Jun 17 11:20:34 2010
@@ -0,0 +1,15 @@
+%rename endfile old_endfile
+%rename startfile old_startfile
+%rename link old_link
+
+*startfile:
+%{!qrtems: %(old_startfile)} \
+%{!nostdlib: %{qrtems: start.o%s crtbegin.o%s -e _start}}
+
+*endfile:
+%{!qrtems: %(old_endfile)} \
+%{!nostdlib: %{qrtems: crtend.o%s}}
+
+*link:
+%(old_link) %{!qrtems: %(old_link)} %{qrtems: -dc -dp -N}
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/niagara/configure.ac:1.1
--- /dev/null	Thu Jun 17 12:13:02 2010
+++ rtems/c/src/lib/libbsp/sparc64/niagara/configure.ac	Thu Jun 17 11:20:34 2010
@@ -0,0 +1,22 @@
+## Process this file with autoconf to produce a configure script.
+## 
+## $Id$
+
+AC_PREREQ(2.60)
+AC_INIT([rtems-c-src-lib-libbsp-sparc64-sun4v],[_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.10])
+RTEMS_BSP_CONFIGURE
+
+RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
+RTEMS_CANONICALIZE_TOOLS
+RTEMS_PROG_CCAS
+
+RTEMS_BSP_CLEANUP_OPTIONS(0, 0)
+
+# Explicitly list all Makefiles here
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/niagara/include/bsp.h:1.1
--- /dev/null	Thu Jun 17 12:13:02 2010
+++ rtems/c/src/lib/libbsp/sparc64/niagara/include/bsp.h	Thu Jun 17 11:20:34 2010
@@ -0,0 +1,69 @@
+/*  bsp.h
+ *
+ *  This include file contains all SPARC64 simulator definitions.
+ *
+ *  COPYRIGHT (c) 1989-1998.
+ *  On-Line Applications Research Corporation (OAR).
+ *  COPYRIGHT (c) 1995.
+ *  European Space Agency.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  Ported to Simics Niagara version of SPARC64 
+ *  Niagara modifications of respective RTEMS file: COPYRIGHT (c) 2010.
+ *  Eugen Leontie.
+ *
+ *  $Id$
+ */
+
+#ifndef _BSP_H
+#define _BSP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <bspopts.h>
+
+#include <rtems.h>
+#include <rtems/iosupp.h>
+#include <rtems/console.h>
+#include <rtems/clockdrv.h>
+
+/* support for simulated clock tick */
+/*
+Thread clock_driver_sim_idle_body(uintptr_t);
+#define BSP_IDLE_TASK_BODY clock_driver_sim_idle_body
+*/
+
+/* this should be defined somewhere */
+rtems_isr_entry set_vector(                     /* returns old vector */
+    rtems_isr_entry     handler,                /* isr routine        */
+    rtems_vector_number vector,                 /* vector number      */
+    int                 type                    /* RTEMS or RAW intr  */
+);
+
+/*
+ *  Simple spin delay in microsecond units for device drivers.
+ *  This is very dependent on the clock speed of the target.
+ */
+
+#define rtems_bsp_delay( microseconds ) \
+  { register uint32_t         _delay=(microseconds); \
+    register uint32_t         _tmp = 0; /* initialized to avoid warning */ \
+    asm volatile( "0: \
+                     remo      3,31,%0 ; \
+                     cmpo      0,%0 ; \
+                     subo      1,%1,%1 ; \
+                     cmpobne.t 0,%1,0b " \
+                  : "=d" (_tmp), "=d" (_delay) \
+                  : "0"  (_tmp), "1"  (_delay) ); \
+  }
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/niagara/include/tm27.h:1.1
--- /dev/null	Thu Jun 17 12:13:02 2010
+++ rtems/c/src/lib/libbsp/sparc64/niagara/include/tm27.h	Thu Jun 17 11:20:34 2010
@@ -0,0 +1,32 @@
+/*
+ *  tm27.h
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#ifndef _RTEMS_TMTEST27
+#error "This is an RTEMS internal file you must not include directly."
+#endif
+
+#ifndef __tm27_h
+#define __tm27_h
+
+/*
+ *  Define the interrupt mechanism for Time Test 27
+ */
+
+#define MUST_WAIT_FOR_INTERRUPT 0
+
+#define Install_tm27_vector( handler ) /* set_vector( (handler), 6, 1 ) */
+
+#define Cause_tm27_intr()  /* XXX */
+
+#define Clear_tm27_intr()  /* XXX */
+
+#define Lower_tm27_intr() /* empty */
+
+#endif

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/niagara/make/custom/niagara.cfg:1.1
--- /dev/null	Thu Jun 17 12:13:02 2010
+++ rtems/c/src/lib/libbsp/sparc64/niagara/make/custom/niagara.cfg	Thu Jun 17 11:20:34 2010
@@ -0,0 +1,24 @@
+#
+#  Config file for the Niagara SPARC64 processor.
+#
+#  $Id$
+#
+include $(RTEMS_ROOT)/make/custom/default.cfg
+
+RTEMS_CPU=sparc64
+RTEMS_CPU_MODEL=sun4v
+
+# This is the actual bsp directory used during the build process.
+RTEMS_BSP_FAMILY=niagara
+
+#  This contains the compiler options necessary to select the CPU model
+#  and (hopefully) optimize for it.
+#CPU_CFLAGS = -mcpu=niagara -DSUN4V -msoft-float
+#CPU_CFLAGS = -mcpu=niagara -DSUN4V -DRTEMS_DEBUG -DDEBUG_WORKSPACE
+#CPU_CFLAGS = -mcpu=niagara -DSUN4V -DRTEMS_DEBUG -DDEBUG_WORKSPACE -DHAVE___ASSERT_FUNC -DBSP_GET_WORK_AREA_DEBUG -DGICADEBUG
+#CPU_CFLAGS = -mcpu=niagara -DSUN4V -DGICADEBUG
+CPU_CFLAGS = -mcpu=niagara -DSUN4V
+#CPU_CFLAGS = -mcpu=niagara -DSUN4V -DRTEMS_DEBUG -DHAVE___ASSERT_FUNC 
+
+# optimize flag: typically -O2
+CFLAGS_OPTIMIZE_V = -gstabs

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/niagara/preinstall.am:1.1
--- /dev/null	Thu Jun 17 12:13:02 2010
+++ rtems/c/src/lib/libbsp/sparc64/niagara/preinstall.am	Thu Jun 17 11:20:34 2010
@@ -0,0 +1,124 @@
+## Automatically generated by ampolish3 - Do not edit
+
+if AMPOLISH3
+$(srcdir)/preinstall.am: Makefile.am
+	$(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
+endif
+
+PREINSTALL_DIRS =
+DISTCLEANFILES += $(PREINSTALL_DIRS)
+
+all-local: $(TMPINSTALL_FILES)
+
+TMPINSTALL_FILES =
+CLEANFILES = $(TMPINSTALL_FILES)
+
+all-am: $(PREINSTALL_FILES)
+
+PREINSTALL_FILES =
+CLEANFILES += $(PREINSTALL_FILES)
+
+$(PROJECT_LIB)/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_LIB)
+	@: > $(PROJECT_LIB)/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
+
+$(PROJECT_INCLUDE)/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)
+	@: > $(PROJECT_INCLUDE)/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
+
+$(PROJECT_INCLUDE)/bsp/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)/bsp
+	@: > $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+
+$(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs
+PREINSTALL_FILES += $(PROJECT_LIB)/bsp_specs
+
+$(PROJECT_INCLUDE)/bsp.h: include/bsp.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp.h
+
+$(PROJECT_INCLUDE)/tm27.h: include/tm27.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tm27.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/tm27.h
+
+$(PROJECT_INCLUDE)/asm.h: ../shared/include/asm.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/asm.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/asm.h
+
+$(PROJECT_INCLUDE)/boot/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)/boot
+	@: > $(PROJECT_INCLUDE)/boot/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/boot/$(dirstamp)
+
+$(PROJECT_INCLUDE)/boot/align.h: ../shared/helenos/boot/include/align.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/align.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/align.h
+
+$(PROJECT_INCLUDE)/boot/balloc.h: ../shared/helenos/boot/include/balloc.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/balloc.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/balloc.h
+
+$(PROJECT_INCLUDE)/boot/gentypes.h: ../shared/helenos/boot/include/gentypes.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/gentypes.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/gentypes.h
+
+$(PROJECT_INCLUDE)/boot/main.h: ../shared/helenos/boot/include/main.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/main.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/main.h
+
+$(PROJECT_INCLUDE)/boot/ofwarch.h: ../shared/helenos/boot/include/ofwarch.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/ofwarch.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/ofwarch.h
+
+$(PROJECT_INCLUDE)/boot/ofw.h: ../shared/helenos/boot/include/ofw.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/ofw.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/ofw.h
+
+$(PROJECT_INCLUDE)/boot/ofw_tree.h: ../shared/helenos/boot/include/ofw_tree.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/ofw_tree.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/ofw_tree.h
+
+$(PROJECT_INCLUDE)/boot/register.h: ../shared/helenos/boot/include/register.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/register.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/register.h
+
+$(PROJECT_INCLUDE)/boot/stack.h: ../shared/helenos/boot/include/stack.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/stack.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/stack.h
+
+$(PROJECT_INCLUDE)/boot/types.h: ../shared/helenos/boot/include/types.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/types.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/types.h
+
+$(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
+
+$(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
+
+$(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
+
+$(PROJECT_LIB)/start.$(OBJEXT): start.$(OBJEXT) $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/start.$(OBJEXT)
+TMPINSTALL_FILES += $(PROJECT_LIB)/start.$(OBJEXT)
+
+$(PROJECT_LIB)/asm.$(OBJEXT): asm.$(OBJEXT) $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/asm.$(OBJEXT)
+TMPINSTALL_FILES += $(PROJECT_LIB)/asm.$(OBJEXT)
+
+$(PROJECT_LIB)/bspinit.$(OBJEXT): bspinit.$(OBJEXT) $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/bspinit.$(OBJEXT)
+TMPINSTALL_FILES += $(PROJECT_LIB)/bspinit.$(OBJEXT)
+
+$(PROJECT_LIB)/linkcmds: ../shared/startup/linkcmds $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds
+PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/niagara/start/bspinit.S:1.1
--- /dev/null	Thu Jun 17 12:13:02 2010
+++ rtems/c/src/lib/libbsp/sparc64/niagara/start/bspinit.S	Thu Jun 17 11:20:34 2010
@@ -0,0 +1,35 @@
+/*
+ * bspinit.S
+ *
+ * BSP specific initialization for Sparc64 RTEMS -- sun4v BSP
+ *
+ *  COPYRIGHT (c) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ * 
+ *  This code defines start code specific to the sun4v BSP
+ *
+ *  $Id$
+ *
+ */
+
+#include <rtems/asm.h>
+#include <rtems/score/cpu.h>
+
+#define STACK_WINDOW_SAVE_AREA_SIZE (16*8)
+
+.section .text
+
+PUBLIC(_BSP_init)
+  .global _BSP_init
+  SYM(_BSP_init):
+
+  save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp  
+
+
+
+  ret
+  restore
+


 *joel*:
2010-06-17	Joel Sherrill <joel.sherrill at oarcorp.com>

	* ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
	preinstall.am, include/bsp.h, include/tm27.h, make/custom/usiii.cfg,
	start/bspinit.S: New files.

A    1.1  c/src/lib/libbsp/sparc64/usiii/ChangeLog
A    1.1  c/src/lib/libbsp/sparc64/usiii/Makefile.am
A    1.1  c/src/lib/libbsp/sparc64/usiii/README
A    1.1  c/src/lib/libbsp/sparc64/usiii/bsp_specs
A    1.1  c/src/lib/libbsp/sparc64/usiii/configure.ac
A    1.1  c/src/lib/libbsp/sparc64/usiii/include/bsp.h
A    1.1  c/src/lib/libbsp/sparc64/usiii/include/tm27.h
A    1.1  c/src/lib/libbsp/sparc64/usiii/make/custom/usiii.cfg
A    1.1  c/src/lib/libbsp/sparc64/usiii/preinstall.am
A    1.1  c/src/lib/libbsp/sparc64/usiii/start/bspinit.S

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/usiii/ChangeLog:1.1
--- /dev/null	Thu Jun 17 12:13:02 2010
+++ rtems/c/src/lib/libbsp/sparc64/usiii/ChangeLog	Thu Jun 17 11:20:38 2010
@@ -0,0 +1,35 @@
+2010-06-17	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* ChangeLog, Makefile.am, README, bsp_specs, configure.ac,
+	preinstall.am, include/bsp.h, include/tm27.h, make/custom/usiii.cfg,
+	start/bspinit.S: New files.
+
+2010-06-05  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* make/custom/usiii.cfg: Moved sun4u.cfg to usiii.cfg
+
+2010-06-05  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* README: New file.
+
+2010-06-05  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* Makefile.am: Use ../shared/console driver.
+
+2010-05-15  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* Makefile.am: update to new ../helenos directory layout
+
+2010-05-13  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* start/bspinit.S: New file.
+	* start/bspinit.S: Call memcpy to copy OFW's trap table.
+
+2010-05-10  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* configure.ac Makefile.am bsp_specs include/bsp.h make/custom/sun4u.cfg: 
+		New files. Copied from sun4v.cfg.
+
+2010-05-10  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* ChangeLog: New file.

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/usiii/Makefile.am:1.1
--- /dev/null	Thu Jun 17 12:13:02 2010
+++ rtems/c/src/lib/libbsp/sparc64/usiii/Makefile.am	Thu Jun 17 11:20:39 2010
@@ -0,0 +1,135 @@
+##
+## $Id$
+##
+
+ACLOCAL_AMFLAGS = -I ../../../../aclocal
+
+include $(top_srcdir)/../../../../automake/compile.am
+include $(top_srcdir)/../../bsp.am
+
+include_bspdir = $(includedir)/bsp
+
+dist_project_lib_DATA = bsp_specs
+
+include_HEADERS = include/bsp.h 
+include_HEADERS += include/tm27.h
+include_HEADERS += ../shared/include/asm.h 
+include_HEADERS += ../shared/include/traptable.h 
+
+## these are the include files used by the boot process from HelenOS Sparc64
+include_bootdir = $(includedir)/boot
+include_boot_HEADERS = \
+  ../shared/helenos/boot/include/align.h \
+  ../shared/helenos/boot/include/balloc.h \
+  ../shared/helenos/boot/include/gentypes.h \
+  ../shared/helenos/boot/include/main.h \
+  ../shared/helenos/boot/include/ofwarch.h \
+  ../shared/helenos/boot/include/ofw.h \
+  ../shared/helenos/boot/include/ofw_tree.h \
+  ../shared/helenos/boot/include/register.h \
+  ../shared/helenos/boot/include/stack.h \
+  ../shared/helenos/boot/include/types.h 
+
+## These include files mimic the HelenOS kernel include layout, which 
+## in HelenOS-0.4.2 is more complicated than the boot include dirs.
+
+# assumed by the HelenOS sources to be in the root includedir. We place them
+# in a kernel include directory.
+include_kerneldir = $(includedir)/kernel
+include_kernel_HEADERS = \
+  ../shared/helenos/kernel/generic/include/align.h
+
+include_archdir = $(includedir)/arch
+include_arch_HEADERS = \
+  ../shared/helenos/kernel/sparc64/include/arch.h \
+  ../shared/helenos/kernel/sparc64/include/boot.h \
+  ../shared/helenos/kernel/sparc64/include/regdef.h \
+  ../shared/helenos/kernel/sparc64/include/stack.h 
+
+include_arch_sun4udir = $(includedir)/arch/sun4u
+include_arch_sun4u_HEADERS = \
+  ../shared/helenos/kernel/sparc64/include/sun4u/arch.h 
+
+include_arch_mmdir = $(includedir)/arch/mm
+include_arch_mm_HEADERS = \
+  ../shared/helenos/kernel/sparc64/include/mm/cache_spec.h \
+  ../shared/helenos/kernel/sparc64/include/mm/frame.h \
+  ../shared/helenos/kernel/sparc64/include/mm/mmu.h \
+  ../shared/helenos/kernel/sparc64/include/mm/page.h \
+  ../shared/helenos/kernel/sparc64/include/mm/tlb.h \
+  ../shared/helenos/kernel/sparc64/include/mm/tte.h
+
+
+include_arch_mm_sun4udir = $(includedir)/arch/mm/sun4u
+include_arch_mm_sun4u_HEADERS = \
+  ../shared/helenos/kernel/sparc64/include/mm/sun4u/frame.h \
+  ../shared/helenos/kernel/sparc64/include/mm/sun4u/mmu.h \
+  ../shared/helenos/kernel/sparc64/include/mm/sun4u/page.h \
+  ../shared/helenos/kernel/sparc64/include/mm/sun4u/tlb.h \
+  ../shared/helenos/kernel/sparc64/include/mm/sun4u/tte.h
+
+include_genarch_ofwdir = $(includedir)/genarch/ofw
+include_genarch_ofw_HEADERS = \
+  ../shared/helenos/kernel/genarch/include/ofw/ofw_tree.h
+
+
+nodist_include_HEADERS = include/bspopts.h    
+nodist_include_bsp_HEADERS = ../../shared/include/bootcard.h 
+DISTCLEANFILES = include/bspopts.h
+noinst_PROGRAMS =
+
+nodist_include_HEADERS += ../../shared/include/coverhd.h
+
+
+EXTRA_DIST = ../shared/start/start.S 
+start.$(OBJEXT): ../shared/start/start.S
+	$(CPPASCOMPILE) -o $@ -c $<
+project_lib_DATA = start.$(OBJEXT)
+
+dist_project_lib_DATA += ../shared/startup/linkcmds
+
+startup_SOURCES = ../../shared/bspclean.c ../../shared/bsplibc.c \
+    ../../shared/bsppredriverhook.c ../../shared/bsppretaskinghook.c \
+    ../../shared/bsppost.c \
+    ../../shared/bootcard.c ../../shared/sbrk.c \
+    ../shared/startup/bspgetworkarea.c \
+    ../shared/startup/bspstart.c \
+    ../shared/startup/setvec.c \
+    ../../shared/gnatinstallhandler.c  \
+    ../shared/helenos/boot/genarch/balloc.c \
+    ../shared/helenos/boot/genarch/ofw.c \
+    ../shared/helenos/boot/genarch/ofw_tree.c \
+    ../shared/helenos/boot/generic/string.c \
+    ../shared/helenos/boot/sparc64/loader/ofwarch.c \
+    ../shared/helenos/boot/sparc64/loader/main.c \
+    ../shared/helenos/boot/sparc64/loader/ofwasm.S \
+    ../shared/asm/asm.S \
+    start/bspinit.S
+
+mmu_SOURCES = \
+    ../shared/helenos/kernel/sparc64/src/cache.S \
+    ../shared/helenos/kernel/sparc64/src/sun4u/takemmu.S \
+    ../shared/start/trap_table.S
+
+#clock_SOURCES = ../../shared/clock_driver_simidle.c
+clock_SOURCES = ../shared/clock/ckinit.c
+
+console_SOURCES = ../../shared/console.c  ../shared/console/conscfg.c
+
+timer_SOURCES = ../../shared/timerstub.c
+
+noinst_LIBRARIES = libbsp.a 
+libbsp_a_SOURCES = $(startup_SOURCES) $(mmu_SOURCES) $(clock_SOURCES) $(console_SOURCES) \
+    $(timer_SOURCES)
+
+
+libbsp_a_LIBADD = \
+      ../../../libcpu/@RTEMS_CPU@/shared/shared-score.rel \
+      ../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
+      ../../../libcpu/@RTEMS_CPU@/shared/interrupts.rel \
+      ../../../libcpu/@RTEMS_CPU@/shared/sparc64-syscall.rel 
+
+EXTRA_DIST += times
+
+include $(srcdir)/preinstall.am
+include $(top_srcdir)/../../../../automake/local.am

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/usiii/README:1.1
--- /dev/null	Thu Jun 17 12:13:02 2010
+++ rtems/c/src/lib/libbsp/sparc64/usiii/README	Thu Jun 17 11:20:39 2010
@@ -0,0 +1,61 @@
+#
+#  $Id$
+#
+
+BSP NAME:           usiii
+BOARD:              
+BUS:                n/a
+CPU FAMILY:         SPARC V9 (a.k.a. sun4u)
+CPU:                UltraSPARC III
+COPROCESSORS:       
+MODE:               n/a
+
+DEBUG MONITOR:      
+
+PERIPHERALS
+===========
+TIMERS:             TICK register (ASR 4)
+  RESOLUTION:         CPU clock resolution
+SERIAL PORTS:       
+REAL-TIME CLOCK:    
+DMA:                none
+VIDEO:              none
+SCSI:               none
+NETWORKING:         none
+
+DRIVER INFORMATION
+==================
+CLOCK DRIVER:       
+IOSUPP DRIVER:      
+SHMSUPP:            
+TIMER DRIVER:       
+TTY DRIVER:         
+
+STDIO
+=====
+PORT:               
+ELECTRICAL:         
+BAUD:               
+BITS PER CHARACTER: 
+PARITY:             
+STOP BITS:          
+
+NOTES
+=====
+
+Board description
+-----------------
+clock rate:     
+bus width:      
+ROM:            
+RAM:            
+
+This BSP is designed to operate on the UltraSPARC III SPARC64 
+and similar processors.
+
+This BSP has been run on the Simics simulator with the serengeti target.
+
+Simics:
+A commercially available simulator licensed by Virtutech.
+https://www.simics.net/
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/usiii/bsp_specs:1.1
--- /dev/null	Thu Jun 17 12:13:02 2010
+++ rtems/c/src/lib/libbsp/sparc64/usiii/bsp_specs	Thu Jun 17 11:20:39 2010
@@ -0,0 +1,15 @@
+%rename endfile old_endfile
+%rename startfile old_startfile
+%rename link old_link
+
+*startfile:
+%{!qrtems: %(old_startfile)} \
+%{!nostdlib: %{qrtems: start.o%s crtbegin.o%s -e _start}}
+
+*endfile:
+%{!qrtems: %(old_endfile)} \
+%{!nostdlib: %{qrtems: crtend.o%s}}
+
+*link:
+%(old_link) %{!qrtems: %(old_link)} %{qrtems: -dc -dp -N}
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/usiii/configure.ac:1.1
--- /dev/null	Thu Jun 17 12:13:03 2010
+++ rtems/c/src/lib/libbsp/sparc64/usiii/configure.ac	Thu Jun 17 11:20:39 2010
@@ -0,0 +1,29 @@
+## Process this file with autoconf to produce a configure script.
+## 
+## $Id$
+
+AC_PREREQ(2.60)
+AC_INIT([rtems-c-src-lib-libbsp-sparc64-sun4u],[_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.10])
+RTEMS_BSP_CONFIGURE
+
+RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
+RTEMS_CANONICALIZE_TOOLS
+RTEMS_PROG_CCAS
+
+RTEMS_BSPOPTS_SET([SIMSPARC_FAST_IDLE],[*],[])
+RTEMS_BSPOPTS_HELP([SIMSPARC_FAST_IDLE],
+[If defined, speed up the clock ticks while the idle task is running so
+time spent in the idle task is minimized.  This significantly reduces
+the wall time required to execute the RTEMS test suites.])
+
+
+RTEMS_BSP_CLEANUP_OPTIONS(0, 0)
+
+# Explicitly list all Makefiles here
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/usiii/include/bsp.h:1.1
--- /dev/null	Thu Jun 17 12:13:03 2010
+++ rtems/c/src/lib/libbsp/sparc64/usiii/include/bsp.h	Thu Jun 17 11:20:39 2010
@@ -0,0 +1,71 @@
+/*  bsp.h
+ *
+ *  This include file contains all SPARC64 simulator definitions.
+ *
+ *  COPYRIGHT (c) 1989-1998.
+ *  On-Line Applications Research Corporation (OAR).
+ *  COPYRIGHT (c) 1995.
+ *  European Space Agency.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  Ported to sun4u version of SPARC64 
+ *  sun4u modifications of respective RTEMS file: 
+ *    COPYRIGHT (c) 2010. 
+ *    Eugen Leontie
+ *    Gedare Bloom
+ *
+ *  $Id$
+ */
+
+#ifndef _BSP_H
+#define _BSP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <bspopts.h>
+
+#include <rtems.h>
+#include <rtems/iosupp.h>
+#include <rtems/console.h>
+#include <rtems/clockdrv.h>
+
+/* support for simulated clock tick */
+/*
+Thread clock_driver_sim_idle_body(uintptr_t);
+#define BSP_IDLE_TASK_BODY clock_driver_sim_idle_body
+*/
+
+/* this should be defined somewhere */
+rtems_isr_entry set_vector(                     /* returns old vector */
+    rtems_isr_entry     handler,                /* isr routine        */
+    rtems_vector_number vector,                 /* vector number      */
+    int                 type                    /* RTEMS or RAW intr  */
+);
+
+/*
+ *  Simple spin delay in microsecond units for device drivers.
+ *  This is very dependent on the clock speed of the target.
+ */
+
+#define rtems_bsp_delay( microseconds ) \
+  { register uint32_t         _delay=(microseconds); \
+    register uint32_t         _tmp = 0; /* initialized to avoid warning */ \
+    asm volatile( "0: \
+                     remo      3,31,%0 ; \
+                     cmpo      0,%0 ; \
+                     subo      1,%1,%1 ; \
+                     cmpobne.t 0,%1,0b " \
+                  : "=d" (_tmp), "=d" (_delay) \
+                  : "0"  (_tmp), "1"  (_delay) ); \
+  }
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/usiii/include/tm27.h:1.1
--- /dev/null	Thu Jun 17 12:13:03 2010
+++ rtems/c/src/lib/libbsp/sparc64/usiii/include/tm27.h	Thu Jun 17 11:20:39 2010
@@ -0,0 +1,32 @@
+/*
+ *  tm27.h
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#ifndef _RTEMS_TMTEST27
+#error "This is an RTEMS internal file you must not include directly."
+#endif
+
+#ifndef __tm27_h
+#define __tm27_h
+
+/*
+ *  Define the interrupt mechanism for Time Test 27
+ */
+
+#define MUST_WAIT_FOR_INTERRUPT 0
+
+#define Install_tm27_vector( handler ) /* set_vector( (handler), 6, 1 ) */
+
+#define Cause_tm27_intr()  /* XXX */
+
+#define Clear_tm27_intr()  /* XXX */
+
+#define Lower_tm27_intr() /* empty */
+
+#endif

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/usiii/make/custom/usiii.cfg:1.1
--- /dev/null	Thu Jun 17 12:13:03 2010
+++ rtems/c/src/lib/libbsp/sparc64/usiii/make/custom/usiii.cfg	Thu Jun 17 11:20:39 2010
@@ -0,0 +1,27 @@
+#
+#  Config file for the UltraSparc III, IV SPARC64 processors.
+#  TODO: currently configured and tested only for ultrasparc3
+#
+#  $Id$
+#
+include $(RTEMS_ROOT)/make/custom/default.cfg
+
+RTEMS_CPU=sparc64
+RTEMS_CPU_MODEL=sun4u
+
+# This is the actual bsp directory used during the build process.
+RTEMS_BSP_FAMILY=usiii
+
+#  This contains the compiler options necessary to select the CPU model
+#  and (hopefully) optimize for it.
+#CPU_CFLAGS = -mcpu=ultrasparc3 -msoft-float
+#CPU_CFLAGS = -mcpu=ultrasparc3 -DRTEMS_DEBUG -DDEBUG_WORKSPACE
+#CPU_CFLAGS = -mcpu=ultrasparc3 -DRTEMS_DEBUG -DDEBUG_WORKSPACE -DHAVE___ASSERT_FUNC -DBSP_GET_WORK_AREA_DEBUG -DGICADEBUG
+#CPU_CFLAGS = -mcpu=ultrasparc3 -DGICADEBUG
+CPU_CFLAGS = -mcpu=ultrasparc3 -DUS3 -DSUN4U
+#CPU_CFLAGS = -mcpu=ultrasparc3 -mno-fpu
+#CPU_CFLAGS = -mcpu=ultrasparc3 -m64
+#CPU_CFLAGS = -mcpu=ultrasparc3 -DRTEMS_DEBUG -DHAVE___ASSERT_FUNC 
+
+# optimize flag: typically -O2
+CFLAGS_OPTIMIZE_V = -gstabs

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/usiii/preinstall.am:1.1
--- /dev/null	Thu Jun 17 12:13:03 2010
+++ rtems/c/src/lib/libbsp/sparc64/usiii/preinstall.am	Thu Jun 17 11:20:39 2010
@@ -0,0 +1,222 @@
+## Automatically generated by ampolish3 - Do not edit
+
+if AMPOLISH3
+$(srcdir)/preinstall.am: Makefile.am
+	$(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
+endif
+
+PREINSTALL_DIRS =
+DISTCLEANFILES += $(PREINSTALL_DIRS)
+
+all-local: $(TMPINSTALL_FILES)
+
+TMPINSTALL_FILES =
+CLEANFILES = $(TMPINSTALL_FILES)
+
+all-am: $(PREINSTALL_FILES)
+
+PREINSTALL_FILES =
+CLEANFILES += $(PREINSTALL_FILES)
+
+$(PROJECT_LIB)/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_LIB)
+	@: > $(PROJECT_LIB)/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_LIB)/$(dirstamp)
+
+$(PROJECT_INCLUDE)/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)
+	@: > $(PROJECT_INCLUDE)/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/$(dirstamp)
+
+$(PROJECT_INCLUDE)/bsp/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)/bsp
+	@: > $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+
+$(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs
+PREINSTALL_FILES += $(PROJECT_LIB)/bsp_specs
+
+$(PROJECT_INCLUDE)/bsp.h: include/bsp.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp.h
+
+$(PROJECT_INCLUDE)/tm27.h: include/tm27.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/tm27.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/tm27.h
+
+$(PROJECT_INCLUDE)/asm.h: ../shared/include/asm.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/asm.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/asm.h
+
+$(PROJECT_INCLUDE)/traptable.h: ../shared/include/traptable.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/traptable.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/traptable.h
+
+$(PROJECT_INCLUDE)/boot/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)/boot
+	@: > $(PROJECT_INCLUDE)/boot/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/boot/$(dirstamp)
+
+$(PROJECT_INCLUDE)/boot/align.h: ../shared/helenos/boot/include/align.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/align.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/align.h
+
+$(PROJECT_INCLUDE)/boot/balloc.h: ../shared/helenos/boot/include/balloc.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/balloc.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/balloc.h
+
+$(PROJECT_INCLUDE)/boot/gentypes.h: ../shared/helenos/boot/include/gentypes.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/gentypes.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/gentypes.h
+
+$(PROJECT_INCLUDE)/boot/main.h: ../shared/helenos/boot/include/main.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/main.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/main.h
+
+$(PROJECT_INCLUDE)/boot/ofwarch.h: ../shared/helenos/boot/include/ofwarch.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/ofwarch.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/ofwarch.h
+
+$(PROJECT_INCLUDE)/boot/ofw.h: ../shared/helenos/boot/include/ofw.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/ofw.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/ofw.h
+
+$(PROJECT_INCLUDE)/boot/ofw_tree.h: ../shared/helenos/boot/include/ofw_tree.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/ofw_tree.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/ofw_tree.h
+
+$(PROJECT_INCLUDE)/boot/register.h: ../shared/helenos/boot/include/register.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/register.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/register.h
+
+$(PROJECT_INCLUDE)/boot/stack.h: ../shared/helenos/boot/include/stack.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/stack.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/stack.h
+
+$(PROJECT_INCLUDE)/boot/types.h: ../shared/helenos/boot/include/types.h $(PROJECT_INCLUDE)/boot/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/boot/types.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/boot/types.h
+
+$(PROJECT_INCLUDE)/kernel/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)/kernel
+	@: > $(PROJECT_INCLUDE)/kernel/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/kernel/$(dirstamp)
+
+$(PROJECT_INCLUDE)/kernel/align.h: ../shared/helenos/kernel/generic/include/align.h $(PROJECT_INCLUDE)/kernel/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/kernel/align.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/kernel/align.h
+
+$(PROJECT_INCLUDE)/arch/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)/arch
+	@: > $(PROJECT_INCLUDE)/arch/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/arch/$(dirstamp)
+
+$(PROJECT_INCLUDE)/arch/arch.h: ../shared/helenos/kernel/sparc64/include/arch.h $(PROJECT_INCLUDE)/arch/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/arch.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/arch.h
+
+$(PROJECT_INCLUDE)/arch/boot.h: ../shared/helenos/kernel/sparc64/include/boot.h $(PROJECT_INCLUDE)/arch/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/boot.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/boot.h
+
+$(PROJECT_INCLUDE)/arch/regdef.h: ../shared/helenos/kernel/sparc64/include/regdef.h $(PROJECT_INCLUDE)/arch/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/regdef.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/regdef.h
+
+$(PROJECT_INCLUDE)/arch/stack.h: ../shared/helenos/kernel/sparc64/include/stack.h $(PROJECT_INCLUDE)/arch/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/stack.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/stack.h
+
+$(PROJECT_INCLUDE)/arch/sun4u/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)/arch/sun4u
+	@: > $(PROJECT_INCLUDE)/arch/sun4u/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/arch/sun4u/$(dirstamp)
+
+$(PROJECT_INCLUDE)/arch/sun4u/arch.h: ../shared/helenos/kernel/sparc64/include/sun4u/arch.h $(PROJECT_INCLUDE)/arch/sun4u/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/sun4u/arch.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/sun4u/arch.h
+
+$(PROJECT_INCLUDE)/arch/mm/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)/arch/mm
+	@: > $(PROJECT_INCLUDE)/arch/mm/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/arch/mm/$(dirstamp)
+
+$(PROJECT_INCLUDE)/arch/mm/cache_spec.h: ../shared/helenos/kernel/sparc64/include/mm/cache_spec.h $(PROJECT_INCLUDE)/arch/mm/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/mm/cache_spec.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/mm/cache_spec.h
+
+$(PROJECT_INCLUDE)/arch/mm/frame.h: ../shared/helenos/kernel/sparc64/include/mm/frame.h $(PROJECT_INCLUDE)/arch/mm/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/mm/frame.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/mm/frame.h
+
+$(PROJECT_INCLUDE)/arch/mm/mmu.h: ../shared/helenos/kernel/sparc64/include/mm/mmu.h $(PROJECT_INCLUDE)/arch/mm/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/mm/mmu.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/mm/mmu.h
+
+$(PROJECT_INCLUDE)/arch/mm/page.h: ../shared/helenos/kernel/sparc64/include/mm/page.h $(PROJECT_INCLUDE)/arch/mm/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/mm/page.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/mm/page.h
+
+$(PROJECT_INCLUDE)/arch/mm/tlb.h: ../shared/helenos/kernel/sparc64/include/mm/tlb.h $(PROJECT_INCLUDE)/arch/mm/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/mm/tlb.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/mm/tlb.h
+
+$(PROJECT_INCLUDE)/arch/mm/tte.h: ../shared/helenos/kernel/sparc64/include/mm/tte.h $(PROJECT_INCLUDE)/arch/mm/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/mm/tte.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/mm/tte.h
+
+$(PROJECT_INCLUDE)/arch/mm/sun4u/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)/arch/mm/sun4u
+	@: > $(PROJECT_INCLUDE)/arch/mm/sun4u/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/arch/mm/sun4u/$(dirstamp)
+
+$(PROJECT_INCLUDE)/arch/mm/sun4u/frame.h: ../shared/helenos/kernel/sparc64/include/mm/sun4u/frame.h $(PROJECT_INCLUDE)/arch/mm/sun4u/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/mm/sun4u/frame.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/mm/sun4u/frame.h
+
+$(PROJECT_INCLUDE)/arch/mm/sun4u/mmu.h: ../shared/helenos/kernel/sparc64/include/mm/sun4u/mmu.h $(PROJECT_INCLUDE)/arch/mm/sun4u/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/mm/sun4u/mmu.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/mm/sun4u/mmu.h
+
+$(PROJECT_INCLUDE)/arch/mm/sun4u/page.h: ../shared/helenos/kernel/sparc64/include/mm/sun4u/page.h $(PROJECT_INCLUDE)/arch/mm/sun4u/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/mm/sun4u/page.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/mm/sun4u/page.h
+
+$(PROJECT_INCLUDE)/arch/mm/sun4u/tlb.h: ../shared/helenos/kernel/sparc64/include/mm/sun4u/tlb.h $(PROJECT_INCLUDE)/arch/mm/sun4u/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/mm/sun4u/tlb.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/mm/sun4u/tlb.h
+
+$(PROJECT_INCLUDE)/arch/mm/sun4u/tte.h: ../shared/helenos/kernel/sparc64/include/mm/sun4u/tte.h $(PROJECT_INCLUDE)/arch/mm/sun4u/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/arch/mm/sun4u/tte.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/arch/mm/sun4u/tte.h
+
+$(PROJECT_INCLUDE)/genarch/ofw/$(dirstamp):
+	@$(MKDIR_P) $(PROJECT_INCLUDE)/genarch/ofw
+	@: > $(PROJECT_INCLUDE)/genarch/ofw/$(dirstamp)
+PREINSTALL_DIRS += $(PROJECT_INCLUDE)/genarch/ofw/$(dirstamp)
+
+$(PROJECT_INCLUDE)/genarch/ofw/ofw_tree.h: ../shared/helenos/kernel/genarch/include/ofw/ofw_tree.h $(PROJECT_INCLUDE)/genarch/ofw/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/genarch/ofw/ofw_tree.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/genarch/ofw/ofw_tree.h
+
+$(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bspopts.h
+
+$(PROJECT_INCLUDE)/bsp/bootcard.h: ../../shared/include/bootcard.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/bootcard.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/bootcard.h
+
+$(PROJECT_INCLUDE)/coverhd.h: ../../shared/include/coverhd.h $(PROJECT_INCLUDE)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/coverhd.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
+
+$(PROJECT_LIB)/start.$(OBJEXT): start.$(OBJEXT) $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/start.$(OBJEXT)
+TMPINSTALL_FILES += $(PROJECT_LIB)/start.$(OBJEXT)
+
+$(PROJECT_LIB)/linkcmds: ../shared/startup/linkcmds $(PROJECT_LIB)/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds
+PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/usiii/start/bspinit.S:1.1
--- /dev/null	Thu Jun 17 12:13:03 2010
+++ rtems/c/src/lib/libbsp/sparc64/usiii/start/bspinit.S	Thu Jun 17 11:20:39 2010
@@ -0,0 +1,51 @@
+/*
+* bspinit.S
+*
+* BSP specific initialization for Sparc64 RTEMS -- sun4u BSP
+*
+*  COPYRIGHT (c) 2010 Gedare Bloom.
+*
+*  The license and distribution terms for this file may be
+*  found in the file LICENSE in this distribution or at
+*  http://www.rtems.com/license/LICENSE.
+* 
+*  This code defines start code specific to the sun4u BSP
+*
+*  $Id$
+*
+*/
+
+#include <rtems/asm.h>
+#include <rtems/score/cpu.h>
+
+#include <traptable.h>
+
+#define LSU_CR_IM_MASK  (0x0004)  /* bit 2 */
+#define LSU_CR_DM_MASK  (0x0008)  /* bit 3 */
+
+#define STACK_WINDOW_SAVE_AREA_SIZE (16*8)
+
+.register %g2, #scratch
+.register %g3, #scratch
+
+.section .text
+
+PUBLIC(_BSP_init)
+.global _BSP_init
+  SYM(_BSP_init):
+  save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
+
+  /* copy firmware trap table so that RTEMS can install ISR handlers */
+  setx  SYM(trap_table), %l0, %o0
+  rdpr  %tba, %o1
+  set TABLE_SIZE, %o2
+  call memcpy
+  nop
+
+  mov %g0, %o0
+  call _take_mmu
+  nop
+
+  ret
+  restore
+


 *joel*:
2010-06-17	Joel Sherrill <joel.sherrill at oarcorp.com>

	* ChangeLog, Makefile.am, acinclude.m4, configure.ac, shared/asm/asm.S,
	shared/clock/ckinit.c, shared/console/conscfg.c,
	shared/helenos/LICENSE, shared/helenos/README,
	shared/helenos/boot/genarch/balloc.c,
	shared/helenos/boot/genarch/ofw.c,
	shared/helenos/boot/genarch/ofw_tree.c,
	shared/helenos/boot/generic/string.c,
	shared/helenos/boot/include/align.h,
	shared/helenos/boot/include/balloc.h,
	shared/helenos/boot/include/gentypes.h,
	shared/helenos/boot/include/main.h,
	shared/helenos/boot/include/ofw.h,
	shared/helenos/boot/include/ofw_tree.h,
	shared/helenos/boot/include/ofwarch.h,
	shared/helenos/boot/include/register.h,
	shared/helenos/boot/include/stack.h,
	shared/helenos/boot/include/types.h,
	shared/helenos/boot/sparc64/loader/main.c,
	shared/helenos/boot/sparc64/loader/ofwarch.c,
	shared/helenos/boot/sparc64/loader/ofwasm.S,
	shared/helenos/kernel/genarch/include/ofw/ofw_tree.h,
	shared/helenos/kernel/generic/include/align.h,
	shared/helenos/kernel/sparc64/include/arch.h,
	shared/helenos/kernel/sparc64/include/boot.h,
	shared/helenos/kernel/sparc64/include/regdef.h,
	shared/helenos/kernel/sparc64/include/stack.h,
	shared/helenos/kernel/sparc64/include/mm/cache_spec.h,
	shared/helenos/kernel/sparc64/include/mm/frame.h,
	shared/helenos/kernel/sparc64/include/mm/mmu.h,
	shared/helenos/kernel/sparc64/include/mm/page.h,
	shared/helenos/kernel/sparc64/include/mm/tlb.h,
	shared/helenos/kernel/sparc64/include/mm/tte.h,
	shared/helenos/kernel/sparc64/include/mm/sun4u/frame.h,
	shared/helenos/kernel/sparc64/include/mm/sun4u/mmu.h,
	shared/helenos/kernel/sparc64/include/mm/sun4u/page.h,
	shared/helenos/kernel/sparc64/include/mm/sun4u/tlb.h,
	shared/helenos/kernel/sparc64/include/mm/sun4u/tte.h,
	shared/helenos/kernel/sparc64/include/sun4u/arch.h,
	shared/helenos/kernel/sparc64/src/cache.S,
	shared/helenos/kernel/sparc64/src/sun4u/takemmu.S,
	shared/include/asm.h, shared/include/traptable.h,
	shared/start/start.S, shared/start/trap_table.S,
	shared/startup/bspgetworkarea.c, shared/startup/bspstart.c,
	shared/startup/linkcmds, shared/startup/setvec.c: New files.

A    1.1  c/src/lib/libbsp/sparc64/ChangeLog
A    1.1  c/src/lib/libbsp/sparc64/Makefile.am
A    1.1  c/src/lib/libbsp/sparc64/acinclude.m4
A    1.1  c/src/lib/libbsp/sparc64/configure.ac
A    1.1  c/src/lib/libbsp/sparc64/shared/asm/asm.S
A    1.1  c/src/lib/libbsp/sparc64/shared/clock/ckinit.c
A    1.1  c/src/lib/libbsp/sparc64/shared/console/conscfg.c
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/LICENSE
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/README
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/genarch/balloc.c
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/genarch/ofw.c
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/genarch/ofw_tree.c
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/generic/string.c
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/include/align.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/include/balloc.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/include/gentypes.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/include/main.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/include/ofw.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/include/ofw_tree.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/include/ofwarch.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/include/register.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/include/stack.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/include/types.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/sparc64/loader/main.c
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/sparc64/loader/ofwarch.c
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/boot/sparc64/loader/ofwasm.S
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/genarch/include/ofw/ofw_tree.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/generic/include/align.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/arch.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/boot.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/cache_spec.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/frame.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/mmu.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/page.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/frame.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/mmu.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/page.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/tlb.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/tte.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/tlb.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/tte.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/regdef.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/stack.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/sun4u/arch.h
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/src/cache.S
A    1.1  c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/src/sun4u/takemmu.S
A    1.1  c/src/lib/libbsp/sparc64/shared/include/asm.h
A    1.1  c/src/lib/libbsp/sparc64/shared/include/traptable.h
A    1.1  c/src/lib/libbsp/sparc64/shared/start/start.S
A    1.1  c/src/lib/libbsp/sparc64/shared/start/trap_table.S
A    1.1  c/src/lib/libbsp/sparc64/shared/startup/bspgetworkarea.c
A    1.1  c/src/lib/libbsp/sparc64/shared/startup/bspstart.c
A    1.1  c/src/lib/libbsp/sparc64/shared/startup/linkcmds
A    1.1  c/src/lib/libbsp/sparc64/shared/startup/setvec.c

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/ChangeLog:1.1
--- /dev/null	Thu Jun 17 12:13:03 2010
+++ rtems/c/src/lib/libbsp/sparc64/ChangeLog	Thu Jun 17 11:20:43 2010
@@ -0,0 +1,90 @@
+2010-06-17	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* ChangeLog, Makefile.am, acinclude.m4, configure.ac, shared/asm/asm.S,
+	shared/clock/ckinit.c, shared/console/conscfg.c,
+	shared/helenos/LICENSE, shared/helenos/README,
+	shared/helenos/boot/genarch/balloc.c,
+	shared/helenos/boot/genarch/ofw.c,
+	shared/helenos/boot/genarch/ofw_tree.c,
+	shared/helenos/boot/generic/string.c,
+	shared/helenos/boot/include/align.h,
+	shared/helenos/boot/include/balloc.h,
+	shared/helenos/boot/include/gentypes.h,
+	shared/helenos/boot/include/main.h,
+	shared/helenos/boot/include/ofw.h,
+	shared/helenos/boot/include/ofw_tree.h,
+	shared/helenos/boot/include/ofwarch.h,
+	shared/helenos/boot/include/register.h,
+	shared/helenos/boot/include/stack.h,
+	shared/helenos/boot/include/types.h,
+	shared/helenos/boot/sparc64/loader/main.c,
+	shared/helenos/boot/sparc64/loader/ofwarch.c,
+	shared/helenos/boot/sparc64/loader/ofwasm.S,
+	shared/helenos/kernel/genarch/include/ofw/ofw_tree.h,
+	shared/helenos/kernel/generic/include/align.h,
+	shared/helenos/kernel/sparc64/include/arch.h,
+	shared/helenos/kernel/sparc64/include/boot.h,
+	shared/helenos/kernel/sparc64/include/regdef.h,
+	shared/helenos/kernel/sparc64/include/stack.h,
+	shared/helenos/kernel/sparc64/include/mm/cache_spec.h,
+	shared/helenos/kernel/sparc64/include/mm/frame.h,
+	shared/helenos/kernel/sparc64/include/mm/mmu.h,
+	shared/helenos/kernel/sparc64/include/mm/page.h,
+	shared/helenos/kernel/sparc64/include/mm/tlb.h,
+	shared/helenos/kernel/sparc64/include/mm/tte.h,
+	shared/helenos/kernel/sparc64/include/mm/sun4u/frame.h,
+	shared/helenos/kernel/sparc64/include/mm/sun4u/mmu.h,
+	shared/helenos/kernel/sparc64/include/mm/sun4u/page.h,
+	shared/helenos/kernel/sparc64/include/mm/sun4u/tlb.h,
+	shared/helenos/kernel/sparc64/include/mm/sun4u/tte.h,
+	shared/helenos/kernel/sparc64/include/sun4u/arch.h,
+	shared/helenos/kernel/sparc64/src/cache.S,
+	shared/helenos/kernel/sparc64/src/sun4u/takemmu.S,
+	shared/include/asm.h, shared/include/traptable.h,
+	shared/start/start.S, shared/start/trap_table.S,
+	shared/startup/bspgetworkarea.c, shared/startup/bspstart.c,
+	shared/startup/linkcmds, shared/startup/setvec.c: New files.
+
+2010-06-05  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* sun4u/ usiii/: Moved sun4u to usiii.
+
+2010-05-13  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* shared/startup/linkcmds: Some alignment changes, added some sections.
+	* helenos/loader/ofwasm.S: clear g4 register after calling ofw_cif. 
+
+2010-05-12  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* helenos/: New subdir to encapsulate sources taken from HelenOS.
+
+2010-05-10  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* shared/ofw/: Move sun4v/ofw to shared/ofw.
+
+2010-05-10  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* shared/startup/ sun4v/startup: Move sun4v/startup to shared/startup.
+
+2010-05-10  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* shared/start/start.S: cleaned up. should bootstrap any sparc64 target.
+
+2010-05-10  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* sun4u/: New BSP directory
+	* shared/: Shared directory added
+
+2010-05-02  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* sparc64/sun4v/Makefile.am sparc64/m5sim/Makefile.am:
+		Link to new libcpu directories and sources.
+
+2010-05-02  Gedare Bloom <gedare at gwmail.gwu.edu>
+
+	* m5sim: new directory for BSP for M5 syscall emulator of UltraSparc T1
+
+2009-10-19	Eugen Leontie <eugen at gwu.edu>
+
+	* ChangeLog, Makefile.am, acinclude.m4, configure.ac: New files.
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/Makefile.am:1.1
--- /dev/null	Thu Jun 17 12:13:03 2010
+++ rtems/c/src/lib/libbsp/sparc64/Makefile.am	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,13 @@
+##
+## $Id$
+##
+
+ACLOCAL_AMFLAGS = -I ../../../aclocal
+
+## Descend into the @RTEMS_BSP_FAMILY@ directory
+SUBDIRS = @RTEMS_BSP_FAMILY@
+
+EXTRA_DIST = 
+
+include $(top_srcdir)/../../../automake/subdirs.am
+include $(top_srcdir)/../../../automake/local.am

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/acinclude.m4:1.1
--- /dev/null	Thu Jun 17 12:13:03 2010
+++ rtems/c/src/lib/libbsp/sparc64/acinclude.m4	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,12 @@
+# RTEMS_CHECK_BSPDIR(RTEMS_BSP_FAMILY)
+AC_DEFUN([RTEMS_CHECK_BSPDIR],
+[
+  case "$1" in
+  niagara )
+    AC_CONFIG_SUBDIRS([niagara]);;
+  usiii )
+    AC_CONFIG_SUBDIRS([usiii]);;
+  *)
+    AC_MSG_ERROR([Invalid BSP]);;
+  esac
+])

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/configure.ac:1.1
--- /dev/null	Thu Jun 17 12:13:04 2010
+++ rtems/c/src/lib/libbsp/sparc64/configure.ac	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,25 @@
+## Process this file with autoconf to produce a configure script.
+## 
+## $Id$
+
+AC_PREREQ(2.60)
+AC_INIT([rtems-c-src-lib-libbsp-sparc64],[_RTEMS_VERSION],[http://www.rtems.org/bugzilla])
+
+# GAB: ./shared is used by sparc v7/8 bsps
+# AC_CONFIG_SRCDIR([shared])
+
+RTEMS_TOP(../../../../..)
+
+RTEMS_CANONICAL_TARGET_CPU
+AM_INIT_AUTOMAKE([no-define foreign 1.10])
+AM_MAINTAINER_MODE
+
+RTEMS_ENV_RTEMSBSP
+
+RTEMS_PROJECT_ROOT
+
+RTEMS_CHECK_BSPDIR([$RTEMS_BSP_FAMILY])
+
+# Explicitly list all Makefiles here
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/asm/asm.S:1.1
--- /dev/null	Thu Jun 17 12:13:04 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/asm/asm.S	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2010
+ * Gedare Bloom
+ *
+ * The license and distribution terms for this file may be found in the file
+ * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
+ * 
+ * $Id$
+ */
+
+#include <rtems/asm.h>
+
+.text
+
+PUBLIC(halt)
+  .global halt
+  SYM(halt):
+	b halt
+	nop

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/clock/ckinit.c:1.1
--- /dev/null	Thu Jun 17 12:13:04 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/clock/ckinit.c	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,118 @@
+/*  ckinit.c
+ *
+ *  This file provides a template for the clock device driver initialization.
+ *
+ *  Modified for sun4v - niagara
+ *
+ *  COPYRIGHT (c) 1989-1999.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  Modifications Copyright (c) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <stdlib.h>
+
+#include <rtems.h>
+#include <bsp.h>
+#include <bspopts.h>
+#include <boot/ofw.h>
+
+/* this is default frequency for simics simulator of niagara. Use the 
+ * get_Frequency function to determine the CPU clock frequency at runtime.
+ */
+#define CPU_FREQ (5000000)
+
+uint64_t sparc64_cycles_per_tick;
+
+/* TICK_CMPR and STICK_CMPR trigger soft interrupt 14 */
+#define CLOCK_VECTOR SPARC_SYNCHRONOUS_TRAP(0x4E)
+
+static unsigned int get_Frequency(void)
+{
+	phandle root = ofw_find_device("/");
+	unsigned int freq;
+	if (ofw_get_property(root, "clock-frequency", &freq, sizeof(freq)) <= 0) {
+		printk("Unable to determine frequency, default: 0x%x\n",CPU_FREQ);
+		return CPU_FREQ;
+	}
+
+	return freq;
+} 
+
+
+void Clock_driver_support_at_tick(void)
+{
+  uint64_t tick_reg;
+  int bit_mask;
+
+
+  bit_mask = SPARC_SOFTINT_TM_MASK | SPARC_SOFTINT_SM_MASK | (1<<14);
+  sparc64_clear_interrupt_bits(bit_mask);
+
+  /* Note: sun4v uses stick_cmpr for clock driver for M5 simulator, which 
+   * does not currently have tick_cmpr implemented */
+  /* TODO: this could be more efficiently implemented as a single assembly 
+   * inline */
+#if defined (SUN4U)
+  sparc64_read_tick(tick_reg);
+#elif defined (SUN4V)
+  sparc64_read_stick(tick_reg);
+#endif
+  tick_reg &= ~(1UL<<63); /* mask out NPT bit, prevents int_dis from being set */
+
+  tick_reg += sparc64_cycles_per_tick;
+
+#if defined (SUN4U)
+  sparc64_write_tick_cmpr(tick_reg);
+#elif defined (SUN4V)
+  sparc64_write_stick_cmpr(tick_reg);
+#endif
+}
+
+#define Clock_driver_support_install_isr(_new, _old) \
+  do { \
+    _old = set_vector( _new, CLOCK_VECTOR, 1 ); \
+  } while ( 0 )
+
+void Clock_driver_support_initialize_hardware(void)
+{
+  uint64_t tick_reg; 	
+  int bit_mask;
+
+
+  bit_mask = SPARC_SOFTINT_TM_MASK | SPARC_SOFTINT_SM_MASK | (1<<14);
+  sparc64_clear_interrupt_bits(bit_mask);
+
+  sparc64_cycles_per_tick = rtems_configuration_get_microseconds_per_tick()*(get_Frequency()/1000000);
+
+#if defined (SUN4U)
+  sparc64_read_tick(tick_reg);
+#elif defined (SUN4V)
+  sparc64_read_stick(tick_reg);
+#endif
+
+  tick_reg &= ~(1UL<<63); /* mask out NPT bit, prevents int_dis from being set */
+  tick_reg += sparc64_cycles_per_tick;
+
+#if defined (SUN4U)
+  sparc64_write_tick_cmpr(tick_reg);
+#elif defined (SUN4V)
+  sparc64_write_stick_cmpr(tick_reg);
+#endif
+}
+
+
+#define Clock_driver_support_shutdown_hardware( ) \
+  do { \
+    \
+  } while ( 0 )
+
+
+#include "../../../shared/clockdrv_shell.h"
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/console/conscfg.c:1.1
--- /dev/null	Thu Jun 17 12:13:04 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/console/conscfg.c	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,115 @@
+/*
+ *  COPYRIGHT (c) 2010 Eugen Leontie.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+
+#include <bsp.h>
+
+#include <libchip/serial.h>
+
+extern void ofw_write(const char *,const int );
+extern void ofw_read(void *,int );
+
+int sun4v_console_device_first_open(int major, int minor, void *arg)
+{
+	return 0;
+}
+
+static ssize_t sun4v_console_poll_write(int minor, const char *buf, size_t n)
+{
+	ofw_write(buf, n);
+	return 0;
+}
+
+void sun4v_console_deviceInitialize (int minor)
+{
+	
+}
+
+int sun4v_console_poll_read(int minor){
+	int a;
+	ofw_read(&a,1);
+	if(a!=0){
+		return a>>24;
+	}
+	return -1;
+}
+
+
+bool sun4v_console_deviceProbe (int minor){
+	return true;
+}
+
+/*
+ *  Polled mode functions
+ */
+console_fns pooled_functions={
+ sun4v_console_deviceProbe, /*bool    (*deviceProbe)(int minor);*/
+ sun4v_console_device_first_open, /*int     (*deviceFirstOpen)(int major, int minor, void *arg);*/
+ NULL, /*int     (*deviceLastClose)(int major, int minor, void *arg);*/
+ sun4v_console_poll_read, /*int     (*deviceRead)(int minor);*/
+ sun4v_console_poll_write, /*ssize_t     (*deviceWrite)(int minor, const char *buf, size_t len);*/
+ sun4v_console_deviceInitialize, /*void    (*deviceInitialize)(int minor);*/
+ NULL, /*void    (*deviceWritePolled)(int minor, char cChar);*/
+ NULL, /*int     (*deviceSetAttributes)(int minor, const struct termios *t);*/
+ NULL /*bool    deviceOutputUsesInterrupts;*/
+};
+
+console_flow sun4v_console_console_flow={
+  NULL,/*int (*deviceStopRemoteTx)(int minor);*/
+  NULL/*int (*deviceStartRemoteTx)(int minor);*/
+};
+
+
+console_tbl     Console_Port_Tbl[] = {
+{
+  "/dev/console",                          /* sDeviceName */
+   SERIAL_CUSTOM,                    	   /* deviceType */
+   &pooled_functions,                      /* pDeviceFns */
+   NULL,              						/* deviceProbe, assume it is there */
+   &sun4v_console_console_flow,             /* pDeviceFlow */
+   0,                                      /* ulMargin */
+   0,                                      /* ulHysteresis */
+   (void *) NULL,               /* NULL */ /* pDeviceParams */
+   0,  									   /* ulCtrlPort1 */
+   0,                   				   /* ulCtrlPort2 */
+   1,                          	           /* ulDataPort */
+   NULL,                                   /* getRegister */
+   NULL,                                   /* setRegister */
+   NULL, /* unused */                      /* getData */
+   NULL, /* unused */                      /* setData */
+   0,                             		   /* ulClock */
+   0      							   	   /* ulIntVector -- base for port */
+},
+};
+
+
+
+/*
+ *  Declare some information used by the console driver
+ */
+
+#define NUM_CONSOLE_PORTS 1
+
+unsigned long  Console_Port_Count = NUM_CONSOLE_PORTS;
+
+console_data  Console_Port_Data[NUM_CONSOLE_PORTS];
+
+rtems_device_minor_number  Console_Port_Minor;
+
+
+/* putchar/getchar for printk */
+
+static void bsp_out_char (char c)
+{
+  ofw_write(&c, 1);
+}
+
+BSP_output_char_function_type BSP_output_char = bsp_out_char;
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/LICENSE:1.1
--- /dev/null	Thu Jun 17 12:13:04 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/LICENSE	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,10 @@
+Copyright (C) 2001-2009 HelenOS project
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+    * The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/README:1.1
--- /dev/null	Thu Jun 17 12:13:04 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/README	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,53 @@
+# 
+# $Id$
+#
+
+The sources in this directory are from the HelenOS project.
+See: http://www.helenos.org
+
+These sources are from release 0.4.2 
+See: http://www.helenos.org/releases/HelenOS-0.4.2.tar.bz2
+
+Unless otherwise indicated, these files are licensed under a BSD-like 
+license without advertising clause.
+See: http://www.helenos.org/license
+Or the file LICENSE in this directory.
+
+Source modifications are mostly documented in the individual source code files.
+Source that is removed is discarded by #ifdef 0 ... #endif blocks.
+
+The subdirectories here correspond to the following subdirectories in the 
+HelenOS source tree (as of release 0.4.2):
+
+boot
+HelenOS-0.4.2/boot
+Various subdirectories related to booting the sparc64
+
+boot/genarch
+HelenOS-0.4.2/boot/genarch
+
+boot/generic
+HelenOS-0.4.2/boot/generic
+
+boot/include
+Various .h files from the following directories:
+  HelenOS-0.4.2/boot/genarch
+  HelenOS-0.4.2/boot/generic
+  HelenOS-0.4.2/boot/arch/sparc64/loader
+
+boot/sparc64
+HelenOS-0.4.2/boot/arch/sparc64
+
+kernel
+HelenOS-0.4.2/kernel
+Various subdirectories related to kernel code and services for the sparc64
+
+kernel/genarch
+HelenOS-0.4.2/kernel/genarch
+
+kernel/generic
+HelenOS-0.4.2/kernel/generic
+
+kernel/sparc64
+HelenOS-0.4.2/kernel/arch/sparc64/
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/genarch/balloc.c:1.1
--- /dev/null	Thu Jun 17 12:13:04 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/genarch/balloc.c	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * $Id$
+ *
+ * Modifications are made to compile for RTEMS. Removes asm.h and replaces 
+ * the necessary defines in-line
+ *
+ */
+
+
+#include <boot/balloc.h>
+#if 0
+#include <asm.h>
+#endif
+#include <boot/types.h>
+#include <boot/align.h>
+
+static ballocs_t *ballocs;
+static uintptr_t phys_base;
+
+void balloc_init(ballocs_t *ball, uintptr_t base, uintptr_t kernel_base)
+{
+	ballocs = ball;
+	phys_base = base;
+	ballocs->base = kernel_base;
+	ballocs->size = 0;
+}
+
+void *balloc(size_t size, size_t alignment)
+{
+	/* Enforce minimal alignment. */
+	alignment = ALIGN_UP(alignment, 4);
+	
+	uintptr_t addr = phys_base + ALIGN_UP(ballocs->size, alignment);
+	
+	if (ALIGN_UP(ballocs->size, alignment) + size > BALLOC_MAX_SIZE)
+		return NULL;
+	
+	ballocs->size = ALIGN_UP(ballocs->size, alignment) + size;
+	
+	return (void *) addr;
+}
+
+void *balloc_rebase(void *ptr)
+{
+	return (void *) ((uintptr_t) ptr - phys_base + ballocs->base);
+}

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/genarch/ofw.c:1.1
--- /dev/null	Thu Jun 17 12:13:04 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/genarch/ofw.c	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,466 @@
+/*
+ * Copyright (c) 2005 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * $Id$
+ *
+ * Modifications are made to compile for RTEMS. Removes asm.h and printf.h.
+ * Adds asm.h (rtems bsp). Adds ofw_read() and ofw_stdin variable. Uses 
+ * printk instead of puts for error messages.
+ *
+ */
+
+#include <bsp.h>
+#include <rtems/bspIo.h>
+
+#include <boot/ofw.h>
+#include <boot/ofwarch.h>
+#if 0
+#include <boot/printf.h>
+#include <boot/asm.h>
+#endif
+#include <boot/types.h>
+#include <string.h>
+#include <asm.h>
+
+#define RED(i)    (((i) >> 5) & ((1 << 3) - 1))
+#define GREEN(i)  (((i) >> 3) & ((1 << 2) - 1))
+#define BLUE(i)   ((i) & ((1 << 3) - 1))
+#define CLIP(i)   ((i) <= 255 ? (i) : 255)
+
+uintptr_t ofw_cif;
+
+phandle ofw_chosen;
+ihandle ofw_stdout;
+ihandle ofw_stdin;
+
+phandle ofw_root;
+ihandle ofw_mmu;
+ihandle ofw_memory_prop;
+phandle ofw_memory;
+
+void ofw_init(void)
+{
+	ofw_chosen = ofw_find_device("/chosen");
+	if (ofw_chosen == -1)
+		halt();
+	
+	if (ofw_get_property(ofw_chosen, "stdout", &ofw_stdout,
+	    sizeof(ofw_stdout)) <= 0)
+		ofw_stdout = 0;
+	
+  if (ofw_get_property(ofw_chosen, "stdin", &ofw_stdin,
+		sizeof(ofw_stdin)) <= 0)
+		ofw_stdin = 0;
+
+	ofw_root = ofw_find_device("/");
+	if (ofw_root == -1) {
+		printk("\r\nError: Unable to find / device, halted.\r\n");
+		halt();
+	}
+	
+	if (ofw_get_property(ofw_chosen, "mmu", &ofw_mmu,
+	    sizeof(ofw_mmu)) <= 0) {
+		printk("\r\nError: Unable to get mmu property, halted.\r\n");
+		halt();
+	}
+	if (ofw_get_property(ofw_chosen, "memory", &ofw_memory_prop,
+	    sizeof(ofw_memory_prop)) <= 0) {
+		printk("\r\nError: Unable to get memory property, halted.\r\n");
+		halt();
+	}
+	
+	ofw_memory = ofw_find_device("/memory");
+	if (ofw_memory == -1) {
+		printk("\r\nError: Unable to find /memory device, halted.\r\n");
+		halt();
+	}
+}
+
+/** Perform a call to OpenFirmware client interface.
+ *
+ * @param service String identifying the service requested.
+ * @param nargs   Number of input arguments.
+ * @param nret    Number of output arguments. This includes the return
+ *                value.
+ * @param rets    Buffer for output arguments or NULL. The buffer must
+ *                accommodate nret - 1 items.
+ *
+ * @return Return value returned by the client interface.
+ *
+ */
+unsigned long
+ofw_call(const char *service, const int nargs, const int nret, ofw_arg_t *rets,
+    ...)
+{
+	va_list list;
+	ofw_args_t args;
+	int i;
+	
+	args.service = (ofw_arg_t) service;
+	args.nargs = nargs;
+	args.nret = nret;
+	
+	va_start(list, rets);
+	for (i = 0; i < nargs; i++)
+		args.args[i] = va_arg(list, ofw_arg_t);
+	va_end(list);
+	
+	for (i = 0; i < nret; i++)
+		args.args[i + nargs] = 0;
+	
+	(void) ofw(&args);
+
+	for (i = 1; i < nret; i++)
+		rets[i - 1] = args.args[i + nargs];
+
+	return args.args[nargs];
+}
+
+phandle ofw_find_device(const char *name)
+{
+	return ofw_call("finddevice", 1, 1, NULL, name);
+}
+
+int ofw_get_property(const phandle device, const char *name, void *buf,
+    const int buflen)
+{
+	return ofw_call("getprop", 4, 1, NULL, device, name, buf, buflen);
+}
+
+int ofw_get_proplen(const phandle device, const char *name)
+{
+	return ofw_call("getproplen", 2, 1, NULL, device, name);
+}
+
+int ofw_next_property(const phandle device, char *previous, char *buf)
+{
+	return ofw_call("nextprop", 3, 1, NULL, device, previous, buf);
+}
+
+int ofw_package_to_path(const phandle device, char *buf, const int buflen)
+{
+	return ofw_call("package-to-path", 3, 1, NULL, device, buf, buflen);
+}
+
+unsigned int ofw_get_address_cells(const phandle device)
+{
+	unsigned int ret = 1;
+	
+	if (ofw_get_property(device, "#address-cells", &ret, sizeof(ret)) <= 0)
+		if (ofw_get_property(ofw_root, "#address-cells", &ret,
+		    sizeof(ret)) <= 0)
+			ret = OFW_ADDRESS_CELLS;
+	
+	return ret;
+}
+
+unsigned int ofw_get_size_cells(const phandle device)
+{
+	unsigned int ret;
+	
+	if (ofw_get_property(device, "#size-cells", &ret, sizeof(ret)) <= 0)
+		if (ofw_get_property(ofw_root, "#size-cells", &ret,
+		    sizeof(ret)) <= 0)
+			ret = OFW_SIZE_CELLS;
+	
+	return ret;
+}
+
+phandle ofw_get_child_node(const phandle node)
+{
+	return ofw_call("child", 1, 1, NULL, node);
+}
+
+phandle ofw_get_peer_node(const phandle node)
+{
+	return ofw_call("peer", 1, 1, NULL, node);
+}
+
+static ihandle ofw_open(const char *name)
+{
+	return ofw_call("open", 1, 1, NULL, name);
+}
+
+
+void ofw_write(const char *str, const int len)
+{
+	if (ofw_stdout == 0)
+		return;
+	
+	ofw_call("write", 3, 1, NULL, ofw_stdout, str, len);
+}
+
+void ofw_read(void *str, const int len)
+{
+  if (ofw_stdin == 0)
+    return;
+
+  ofw_call("read", 3, 1, NULL, ofw_stdin, str, len);
+}
+
+void *ofw_translate(const void *virt)
+{
+	ofw_arg_t result[4];
+	int shift;
+
+	if (ofw_call("call-method", 4, 5, result, "translate", ofw_mmu,
+	    virt, 0) != 0) {
+		printk("Error: MMU method translate() failed, halting.\n");
+		halt();
+	}
+
+	if (ofw_translate_failed(result[0]))
+		return NULL;
+
+	if (sizeof(unative_t) == 8)
+		shift = 32;
+	else
+		shift = 0;
+
+	return (void *) ((result[2] << shift) | result[3]);
+}
+
+void *ofw_claim_virt(const void *virt, const unsigned int len)
+{
+	ofw_arg_t retaddr;
+
+	if (ofw_call("call-method", 5, 2, &retaddr, "claim", ofw_mmu, 0, len,
+	    virt) != 0) {
+		printk("Error: MMU method claim() failed, halting.\n");
+		halt();
+	}
+
+	return (void *) retaddr;
+}
+
+static void *ofw_claim_phys_internal(const void *phys, const unsigned int len, const unsigned int alignment)
+{
+	/*
+	 * Note that the return value check will help
+	 * us to discover conflicts between OpenFirmware
+	 * allocations and our use of physical memory.
+	 * It is better to detect collisions here
+	 * than to cope with weird errors later.
+	 *
+	 * So this is really not to make the loader
+	 * more generic; it is here for debugging
+	 * purposes.
+	 */
+	
+	if (sizeof(unative_t) == 8) {
+		ofw_arg_t retaddr[2];
+		int shift = 32;
+		
+		if (ofw_call("call-method", 6, 3, retaddr, "claim",
+		    ofw_memory_prop, alignment, len, ((uintptr_t) phys) >> shift,
+		    ((uintptr_t) phys) & ((uint32_t) -1)) != 0) {
+			printk("Error: memory method claim() failed, halting.\n");
+			halt();
+		}
+		
+		return (void *) ((retaddr[0] << shift) | retaddr[1]);
+	} else {
+		ofw_arg_t retaddr[1];
+		
+		if (ofw_call("call-method", 5, 2, retaddr, "claim",
+		    ofw_memory_prop, alignment, len, (uintptr_t) phys) != 0) {
+			printk("Error: memory method claim() failed, halting.\n");
+			halt();
+		}
+		
+		return (void *) retaddr[0];
+	}
+}
+
+void *ofw_claim_phys(const void *phys, const unsigned int len)
+{
+	return ofw_claim_phys_internal(phys, len, 0);
+}
+
+void *ofw_claim_phys_any(const unsigned int len, const unsigned int alignment)
+{
+	return ofw_claim_phys_internal(NULL, len, alignment);
+}
+
+int ofw_map(const void *phys, const void *virt, const unsigned int size, const int mode)
+{
+	uintptr_t phys_hi, phys_lo;
+
+	if (sizeof(unative_t) == 8) {
+		int shift = 32;
+		phys_hi = (uintptr_t) phys >> shift;
+		phys_lo = (uintptr_t) phys & 0xffffffff;
+	} else {
+		phys_hi = 0;
+		phys_lo = (uintptr_t) phys;
+	}
+
+	return ofw_call("call-method", 7, 1, NULL, "map", ofw_mmu, mode, size,
+	    virt, phys_hi, phys_lo);
+}
+
+/** Save OpenFirmware physical memory map.
+ *
+ * @param map Memory map structure where the map will be saved.
+ *
+ * @return Zero on failure, non-zero on success.
+ */
+int ofw_memmap(memmap_t *map)
+{
+	unsigned int ac = ofw_get_address_cells(ofw_memory) /
+	    (sizeof(uintptr_t) / sizeof(uint32_t));
+	unsigned int sc = ofw_get_size_cells(ofw_memory) /
+	    (sizeof(uintptr_t) / sizeof(uint32_t));
+
+	uintptr_t buf[((ac + sc) * MEMMAP_MAX_RECORDS)];
+	int ret = ofw_get_property(ofw_memory, "reg", buf, sizeof(buf));
+	if (ret <= 0)		/* ret is the number of written bytes */
+		return false;
+
+	int pos;
+	map->total = 0;
+	map->count = 0;
+	for (pos = 0; (pos < ret / sizeof(uintptr_t)) &&
+	    (map->count < MEMMAP_MAX_RECORDS); pos += ac + sc) {
+		void *start = (void *) (buf[pos + ac - 1]);
+		unsigned int size = buf[pos + ac + sc - 1];
+
+		/*
+		 * This is a hot fix of the issue which occurs on machines
+		 * where there are holes in the physical memory (such as
+		 * SunBlade 1500). Should we detect a hole in the physical
+		 * memory, we will ignore any memory detected behind
+		 * the hole and pretend the hole does not exist.
+		 */
+		if ((map->count > 0) && (map->zones[map->count - 1].start +
+		    map->zones[map->count - 1].size < start))
+			break;
+
+		if (size > 0) {
+			map->zones[map->count].start = start;
+			map->zones[map->count].size = size;
+			map->count++;
+			map->total += size;
+		}
+	}
+	
+	return true;
+}
+
+static void ofw_setup_screen(phandle handle)
+{
+	/* Check for device type */
+	char device_type[OFW_TREE_PROPERTY_MAX_VALUELEN];
+	if (ofw_get_property(handle, "device_type", device_type, OFW_TREE_PROPERTY_MAX_VALUELEN) <= 0)
+		return;
+	
+	device_type[OFW_TREE_PROPERTY_MAX_VALUELEN - 1] = '\0';
+	if (strcmp(device_type, "display") != 0)
+		return;
+	
+	/* Check for 8 bit depth */
+	uint32_t depth;
+	if (ofw_get_property(handle, "depth", &depth, sizeof(uint32_t)) <= 0)
+		depth = 0;
+	
+	/* Get device path */
+	static char path[OFW_TREE_PATH_MAX_LEN + 1];
+	size_t len = ofw_package_to_path(handle, path, OFW_TREE_PATH_MAX_LEN);
+	if (len == -1)
+		return;
+	
+	path[len] = '\0';
+	
+	/* Open the display to initialize it */
+	ihandle screen = ofw_open(path);
+	if (screen == -1)
+		return;
+	
+	if (depth == 8) {
+		/* Setup the palette so that the (inverted) 3:2:3 scheme is usable */
+		unsigned int i;
+		for (i = 0; i < 256; i++) {
+			ofw_call("call-method", 6, 1, NULL, "color!", screen,
+			    255 - i, CLIP(BLUE(i) * 37), GREEN(i) * 85, CLIP(RED(i) * 37));
+		}
+	}
+}
+
+static void ofw_setup_screens_internal(phandle current)
+{
+	while ((current != 0) && (current != -1)) {
+		ofw_setup_screen(current);
+		
+		/*
+		 * Recursively process the potential child node.
+		 */
+		phandle child = ofw_get_child_node(current);
+		if ((child != 0) && (child != -1))
+			ofw_setup_screens_internal(child);
+		
+		/*
+		 * Iteratively process the next peer node.
+		 * Note that recursion is a bad idea here.
+		 * Due to the topology of the OpenFirmware device tree,
+		 * the nesting of peer nodes could be to wide and the
+		 * risk of overflowing the stack is too real.
+		 */
+		phandle peer = ofw_get_peer_node(current);
+		if ((peer != 0) && (peer != -1)) {
+			current = peer;
+			/*
+			 * Process the peer in next iteration.
+			 */
+			continue;
+		}
+		
+		/*
+		 * No more peers on this level.
+		 */
+		break;
+	}
+}
+
+/** Setup all screens which can be detected.
+ *
+ * Open all screens which can be detected and set up the palette for the 8-bit
+ * color depth configuration so that the 3:2:3 color scheme can be used.
+ * Check that setting the palette makes sense (the color depth is not greater
+ * than 8).
+ *
+ */
+void ofw_setup_screens(void)
+{
+	ofw_setup_screens_internal(ofw_root);
+}
+
+void ofw_quiesce(void)
+{
+	ofw_call("quiesce", 0, 0, NULL);
+}

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/genarch/ofw_tree.c:1.1
--- /dev/null	Thu Jun 17 12:13:04 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/genarch/ofw_tree.c	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,257 @@
+/*
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * $Id$
+ *
+ * Modifications are made to compile for RTEMS. Removes asm.h and memstr.h.
+ *
+ */
+
+
+#include <boot/ofw_tree.h>
+#include <boot/ofw.h>
+#include <boot/ofwarch.h>
+#include <boot/types.h>
+#include <string.h>
+#include <boot/balloc.h>
+#if 0
+#include <asm.h>
+#include <memstr.h>
+#endif
+
+static ofw_tree_node_t *ofw_tree_node_alloc(void)
+{
+	return balloc(sizeof(ofw_tree_node_t), sizeof(ofw_tree_node_t));
+}
+
+static ofw_tree_property_t *ofw_tree_properties_alloc(unsigned count)
+{
+	return balloc(count * sizeof(ofw_tree_property_t),
+	    sizeof(ofw_tree_property_t));
+}
+
+static void *ofw_tree_space_alloc(size_t size)
+{
+	/*
+	 * What we do here is a nasty hack :-)
+	 * Problem: string property values that are allocated via this
+	 * function typically do not contain the trailing '\0'. This
+	 * is very uncomfortable for kernel, which is supposed to deal
+	 * with the properties.
+	 * Solution: when allocating space via this function, we always
+	 * allocate space for the extra '\0' character that we store
+	 * behind the requested memory.
+	 */
+	char *addr = balloc(size + 1, size);
+	if (addr)
+		addr[size] = '\0';
+	
+	return addr;
+}
+
+/** Transfer information from one OpenFirmware node into its memory
+ * representation.
+ *
+ * Transfer entire information from the OpenFirmware device tree 'current' node
+ * to its memory representation in 'current_node'. This function recursively
+ * processes all node's children. Node's peers are processed iteratively in
+ * order to prevent stack from overflowing.
+ *
+ * @param current_node Pointer to uninitialized ofw_tree_node structure that
+ *                     will become the memory represenation of 'current'.
+ * @param parent_node  Parent ofw_tree_node structure or NULL in case of root
+ *                     node.
+ * @param current      OpenFirmware phandle to the current device tree node.
+ *
+ */
+static void ofw_tree_node_process(ofw_tree_node_t *current_node,
+    ofw_tree_node_t *parent_node, phandle current)
+{
+	while (current_node) {
+		/*
+		 * Initialize node.
+		 */
+		current_node->parent = (ofw_tree_node_t *) balloc_rebase(parent_node);
+		current_node->peer = NULL;
+		current_node->child = NULL;
+		current_node->node_handle = current;
+		current_node->properties = 0;
+		current_node->property = NULL;
+		current_node->device = NULL;
+		
+		/*
+		 * Get the disambigued name.
+		 */
+		static char path[OFW_TREE_PATH_MAX_LEN + 1];
+		size_t len = ofw_package_to_path(current, path, OFW_TREE_PATH_MAX_LEN);
+		if (len == -1)
+			return;
+		
+		path[len] = '\0';
+		
+		/* Find last slash */
+		int i;
+		for (i = len - 1; (i >= 0) && (path[i] != '/'); i--);
+		
+		/* Do not include the slash */
+		i++;
+		len -= i;
+		
+		/* Add space for trailing '\0' */
+		char *da_name = ofw_tree_space_alloc(len + 1);
+		if (!da_name)
+			return;
+		
+		memcpy(da_name, &path[i], len);
+		da_name[len] = '\0';
+		current_node->da_name = (char *) balloc_rebase(da_name);
+		
+		/*
+		 * Recursively process the potential child node.
+		 */
+		phandle child = ofw_get_child_node(current);
+		if ((child != 0) && (child != -1)) {
+			ofw_tree_node_t *child_node = ofw_tree_node_alloc();
+			if (child_node) {
+				ofw_tree_node_process(child_node, current_node,
+				    child);
+				current_node->child =
+				    (ofw_tree_node_t *) balloc_rebase(child_node);
+			}
+		}
+		
+		/*
+		 * Count properties.
+		 */
+		static char name[OFW_TREE_PROPERTY_MAX_NAMELEN];
+		static char name2[OFW_TREE_PROPERTY_MAX_NAMELEN];
+		name[0] = '\0';
+		while (ofw_next_property(current, name, name2) == 1) {
+			current_node->properties++;
+			memcpy(name, name2, OFW_TREE_PROPERTY_MAX_NAMELEN);
+		}
+		
+		if (!current_node->properties)
+			return;
+		
+		/*
+		 * Copy properties.
+		 */
+		ofw_tree_property_t *property =
+		    ofw_tree_properties_alloc(current_node->properties);
+		if (!property)
+			return;
+		
+		name[0] = '\0';
+		for (i = 0; ofw_next_property(current, name, name2) == 1; i++) {
+			if (i == current_node->properties)
+				break;
+			
+			memcpy(name, name2, OFW_TREE_PROPERTY_MAX_NAMELEN);
+			memcpy(property[i].name, name, OFW_TREE_PROPERTY_MAX_NAMELEN);
+			property[i].name[OFW_TREE_PROPERTY_MAX_NAMELEN - 1] = '\0';
+			
+			size_t size = ofw_get_proplen(current, name);
+			property[i].size = size;
+			
+			if (size) {
+				void *buf = ofw_tree_space_alloc(size);
+				if (buf) {
+					/*
+					 * Copy property value to memory node.
+					 */
+					(void) ofw_get_property(current, name, buf, size);
+					property[i].value = balloc_rebase(buf);
+				}
+			} else
+				property[i].value = NULL;
+		}
+		
+		/* Just in case we ran out of memory. */
+		current_node->properties = i;
+		current_node->property = (ofw_tree_property_t *) balloc_rebase(property);
+		
+		
+		/*
+		 * Iteratively process the next peer node.
+		 * Note that recursion is a bad idea here.
+		 * Due to the topology of the OpenFirmware device tree,
+		 * the nesting of peer nodes could be to wide and the
+		 * risk of overflowing the stack is too real.
+		 */
+		phandle peer = ofw_get_peer_node(current);
+		if ((peer != 0) && (peer != -1)) {
+			ofw_tree_node_t *peer_node = ofw_tree_node_alloc();
+			if (peer_node) {
+				current_node->peer = (ofw_tree_node_t *) balloc_rebase(peer_node);
+				current_node = peer_node;
+				current = peer;
+				/*
+				 * Process the peer in next iteration.
+				 */
+				continue;
+			}
+		}
+		
+		/*
+		 * No more peers on this level.
+		 */
+		break;
+	}
+}
+
+/** Construct memory representation of OpenFirmware device tree.
+ *
+ * @return NULL on failure or kernel pointer to the root node.
+ *
+ */
+ofw_tree_node_t *ofw_tree_build(void)
+{
+	ofw_tree_node_t *root = ofw_tree_node_alloc();
+	if (root)
+		ofw_tree_node_process(root, NULL, ofw_root);
+	
+	/*
+	 * The firmware client interface does not automatically include the
+	 * "ssm" node in the list of children of "/". A nasty yet working
+	 * solution is to explicitly stick "ssm" to the OFW tree.
+	 */
+	phandle ssm_node = ofw_find_device("/ssm at 0,0");
+	if (ssm_node != -1) {
+		ofw_tree_node_t *ssm = ofw_tree_node_alloc();
+		if (ssm) {
+			ofw_tree_node_process(ssm, root,
+			    ofw_find_device("/ssm at 0,0"));
+			ssm->peer = root->child;
+			root->child = (ofw_tree_node_t *) balloc_rebase(ssm);
+		}
+	}
+	
+	return (ofw_tree_node_t *) balloc_rebase(root);
+}

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/generic/string.c:1.1
--- /dev/null	Thu Jun 17 12:13:04 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/generic/string.c	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,213 @@
+/*
+ * Copyright (c) 2001-2004 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup generic	
+ * @{
+ */
+
+/*
+ * $Id$
+ *
+ * Modifications are made to compile for RTEMS. Remove strncpy() and atoi() 
+ *
+ */
+
+
+#include <string.h>
+
+/**
+ * @file
+ * @brief	String manipulation functions.
+ */
+
+/** Return number of characters in a string.
+ *
+ * @param str		NULL terminated string.
+ *
+ * @return		Number of characters in str.
+ */
+size_t strlen(const char *str)
+{
+	int i;
+	
+	for (i = 0; str[i]; i++)
+		;
+	
+	return i;
+}
+
+/** Compare two NULL terminated strings.
+ *
+ * Do a char-by-char comparison of two NULL terminated strings.
+ * The strings are considered equal iff they consist of the same
+ * characters on the minimum of their lengths.
+ *
+ * @param src		First string to compare.
+ * @param dst		Second string to compare.
+ *
+ * @return		0 if the strings are equal, -1 if first is smaller,
+ * 			1 if second smaller.
+ *
+ */
+int strcmp(const char *src, const char *dst)
+{
+	for (; *src && *dst; src++, dst++) {
+		if (*src < *dst)
+			return -1;
+		if (*src > *dst)
+			return 1;
+	}
+	if (*src == *dst)
+		return 0;
+	if (!*src)
+		return -1;
+	return 1;
+}
+
+
+/** Compare two NULL terminated strings.
+ *
+ * Do a char-by-char comparison of two NULL terminated strings.
+ * The strings are considered equal iff they consist of the same
+ * characters on the minimum of their lengths and specified maximal
+ * length.
+ *
+ * @param src		First string to compare.
+ * @param dst		Second string to compare.
+ * @param len		Maximal length for comparison.
+ *
+ * @return		0 if the strings are equal, -1 if first is smaller,
+ * 			1 if second smaller.
+ *
+ */
+int strncmp(const char *src, const char *dst, size_t len)
+{
+	int i;
+	
+	for (i = 0; *src && *dst && i < len; src++, dst++, i++) {
+		if (*src < *dst)
+			return -1;
+		if (*src > *dst)
+			return 1;
+	}
+	if (i == len || *src == *dst)
+		return 0;
+	if (!*src)
+		return -1;
+	return 1;
+}
+#if 0
+/** Copy NULL terminated string.
+ *
+ * Copy at most 'len' characters from string 'src' to 'dest'.
+ * If 'src' is shorter than 'len', '\0' is inserted behind the
+ * last copied character.
+ *
+ * @param src		Source string.
+ * @param dest		Destination buffer.
+ * @param len		Size of destination buffer.
+ */
+void strncpy(char *dest, const char *src, size_t len)
+{
+	int i;
+	for (i = 0; i < len; i++) {
+		if (!(dest[i] = src[i]))
+			return;
+	}
+	dest[i-1] = '\0';
+}
+
+/** Convert ascii representation to unative_t.
+ *
+ * Supports 0x for hexa & 0 for octal notation.
+ * Does not check for overflows, does not support negative numbers
+ *
+ * @param text		Textual representation of number.
+ * @return		Converted number or 0 if no valid number found.
+ */
+unative_t atoi(const char *text)
+{
+	int base = 10;
+	unative_t result = 0;
+
+	if (text[0] == '0' && text[1] == 'x') {
+		base = 16;
+		text += 2;
+	} else if (text[0] == '0')
+		base = 8;
+
+	while (*text) {
+		if (base != 16 &&
+		    ((*text >= 'A' && *text <= 'F') ||
+		    (*text >='a' && *text <='f')))
+			break;
+		if (base == 8 && *text >='8')
+			break;
+
+		if (*text >= '0' && *text <= '9') {
+			result *= base;
+			result += *text - '0';
+		} else if (*text >= 'A' && *text <= 'F') {
+			result *= base;
+			result += *text - 'A' + 10;
+		} else if (*text >= 'a' && *text <= 'f') {
+			result *= base;
+			result += *text - 'a' + 10;
+		} else
+			break;
+		text++;
+	}
+
+	return result;
+}
+#endif
+/** Move piece of memory to another, possibly overlapping, location.
+ *
+ * @param dst		Destination address.
+ * @param src		Source address.
+ * @param len		Number of bytes to move.
+ *
+ * @return		Destination address.
+ */
+void *memmove(void *dst, const void *src, size_t len)
+{
+	char *d = dst;
+	const char *s = src;
+	if (s < d) {
+		while (len--)
+			*(d + len) = *(s + len);
+	} else {
+		while (len--)
+			*d++ = *s++;
+	}
+	
+	return dst;
+}
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/align.h:1.1
--- /dev/null	Thu Jun 17 12:13:05 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/align.h	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup generic
+ * @{
+ */
+/** @file
+ */
+
+#ifndef BOOT_ALIGN_H_
+#define BOOT_ALIGN_H_
+
+/** Align to the nearest higher address.
+ *
+ * @param addr  Address or size to be aligned.
+ * @param align Size of alignment, must be power of 2.
+ */
+#define ALIGN_UP(addr, align) (((addr) + ((align) - 1)) & ~((align) - 1))
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/balloc.h:1.1
--- /dev/null	Thu Jun 17 12:13:05 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/balloc.h	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * $Id$
+ *
+ * Modifications are made to compile for RTEMS. Move BALLOC_MAX_SIZE from 
+ * asm.h to here.
+ *
+ */
+
+
+#ifndef BOOT_BALLOC_H_
+#define BOOT_BALLOC_H_
+
+#include <boot/types.h>
+
+#define BALLOC_MAX_SIZE  (128 * 1024)
+
+typedef struct {
+	uintptr_t base;
+	size_t size;
+} ballocs_t;
+
+extern void balloc_init(ballocs_t *ball, uintptr_t base, uintptr_t kernel_base);
+extern void *balloc(size_t size, size_t alignment);
+extern void *balloc_rebase(void *ptr);
+
+#endif

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/gentypes.h:1.1
--- /dev/null	Thu Jun 17 12:13:05 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/gentypes.h	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2006 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup generic	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef BOOT_GENTYPES_H_
+#define BOOT_GENTYPES_H_
+
+#define NULL 0
+#define false 0
+#define true 1
+
+typedef unsigned long size_t;
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/main.h:1.1
--- /dev/null	Thu Jun 17 12:13:05 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/main.h	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2005 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BOOT_sparc64_MAIN_H_
+#define BOOT_sparc64_MAIN_H_
+
+#include <boot/ofw.h>
+#include <boot/ofw_tree.h>
+#include <boot/balloc.h>
+#include <boot/types.h>
+
+#define KERNEL_VIRTUAL_ADDRESS  0x400000
+
+#define TASKMAP_MAX_RECORDS  32
+
+/** Size of buffer for storing task name in task_t. */
+#define BOOTINFO_TASK_NAME_BUFLEN  32
+
+#define BSP_PROCESSOR  1
+#define AP_PROCESSOR   0
+
+#define SUBARCH_US   1
+#define SUBARCH_US3  3
+
+typedef struct {
+	void *addr;
+	uint32_t size;
+	char name[BOOTINFO_TASK_NAME_BUFLEN];
+} task_t;
+
+typedef struct {
+	uint32_t count;
+	task_t tasks[TASKMAP_MAX_RECORDS];
+} taskmap_t;
+
+typedef struct {
+	uintptr_t physmem_start;
+	taskmap_t taskmap;
+	memmap_t memmap;
+	ballocs_t ballocs;
+	ofw_tree_node_t *ofw_root;
+} bootinfo_t;
+
+extern uint32_t silo_ramdisk_image;
+extern uint32_t silo_ramdisk_size;
+
+extern void start(void);
+extern void bootstrap(void);
+
+#endif

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/ofw.h:1.1
--- /dev/null	Thu Jun 17 12:13:05 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/ofw.h	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2005 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BOOT_OFW_H_
+#define BOOT_OFW_H_
+
+#include <boot/types.h>
+#include <stdarg.h>
+
+#define MEMMAP_MAX_RECORDS  32
+#define MAX_OFW_ARGS        12
+
+#define OFW_TREE_PATH_MAX_LEN           256
+#define OFW_TREE_PROPERTY_MAX_NAMELEN   32
+#define OFW_TREE_PROPERTY_MAX_VALUELEN  64
+
+typedef unative_t ofw_arg_t;
+typedef unsigned int ihandle;
+typedef unsigned int phandle;
+
+/** OpenFirmware command structure
+ *
+ */
+typedef struct {
+	ofw_arg_t service;             /**< Command name. */
+	ofw_arg_t nargs;               /**< Number of in arguments. */
+	ofw_arg_t nret;                /**< Number of out arguments. */
+	ofw_arg_t args[MAX_OFW_ARGS];  /**< List of arguments. */
+} ofw_args_t;
+
+typedef struct {
+	void *start;
+	uint32_t size;
+} memzone_t;
+
+typedef struct {
+	uint32_t total;
+	uint32_t count;
+	memzone_t zones[MEMMAP_MAX_RECORDS];
+} memmap_t;
+
+typedef struct {
+	uint32_t info;
+	uint32_t addr_hi;
+	uint32_t addr_lo;
+} pci_addr_t;
+
+typedef struct {
+	pci_addr_t addr;
+	uint32_t size_hi;
+	uint32_t size_lo;
+} pci_reg_t;
+
+extern uintptr_t ofw_cif;
+
+extern phandle ofw_chosen;
+extern ihandle ofw_stdout;
+extern phandle ofw_root;
+extern ihandle ofw_mmu;
+extern phandle ofw_memory;
+
+extern void ofw_init(void);
+
+extern void ofw_write(const char *str, const int len);
+
+extern int ofw_get_property(const phandle device, const char *name, void *buf, const int buflen);
+extern int ofw_get_proplen(const phandle device, const char *name);
+extern int ofw_next_property(const phandle device, char *previous, char *buf);
+
+extern phandle ofw_get_child_node(const phandle node);
+extern phandle ofw_get_peer_node(const phandle node);
+extern phandle ofw_find_device(const char *name);
+
+extern int ofw_package_to_path(const phandle device, char *buf, const int buflen);
+
+extern int ofw(ofw_args_t *arg);
+extern unsigned long ofw_call(const char *service, const int nargs, const int nret, ofw_arg_t *rets, ...);
+extern unsigned int ofw_get_address_cells(const phandle device);
+extern unsigned int ofw_get_size_cells(const phandle device);
+extern void *ofw_translate(const void *virt);
+extern int ofw_translate_failed(ofw_arg_t flag);
+extern void *ofw_claim_virt(const void *virt, const unsigned int len);
+extern void *ofw_claim_phys(const void *virt, const unsigned int len);
+extern void *ofw_claim_phys_any(const unsigned int len, const unsigned int alignment);
+extern int ofw_map(const void *phys, const void *virt, const unsigned int size, const int mode);
+extern int ofw_memmap(memmap_t *map);
+extern void ofw_setup_screens(void);
+extern void ofw_quiesce(void);
+
+#endif

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/ofw_tree.h:1.1
--- /dev/null	Thu Jun 17 12:13:05 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/ofw_tree.h	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BOOT_OFW_TREE_H_
+#define BOOT_OFW_TREE_H_
+
+#include <boot/types.h>
+#include <boot/ofw.h>
+
+
+/** Memory representation of OpenFirmware device tree node property. */
+typedef struct {
+	char name[OFW_TREE_PROPERTY_MAX_NAMELEN];
+	size_t size;
+	void *value;
+} ofw_tree_property_t;
+
+/** Memory representation of OpenFirmware device tree node. */
+typedef struct ofw_tree_node {
+	struct ofw_tree_node *parent;
+	struct ofw_tree_node *peer;
+	struct ofw_tree_node *child;
+	
+	uint32_t node_handle;           /**< Old OpenFirmware node handle. */
+	
+	char *da_name;                  /**< Disambigued name. */
+	
+	unsigned int properties;        /**< Number of properties. */
+	ofw_tree_property_t *property;
+	
+	void *device;                   /**< Member used solely by the kernel. */
+} ofw_tree_node_t;
+
+extern ofw_tree_node_t *ofw_tree_build(void);
+
+#endif

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/ofwarch.h:1.1
--- /dev/null	Thu Jun 17 12:13:05 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/ofwarch.h	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BOOT_sparc64_OFWARCH_H_
+#define BOOT_sparc64_OFWARCH_H_
+
+#include "main.h"
+#include "types.h"
+
+#define OFW_ADDRESS_CELLS  2
+#define OFW_SIZE_CELLS     2
+
+extern int ofw_cpu(uint16_t mid_mask, uintptr_t physmem_start);
+extern int ofw_get_physmem_start(uintptr_t *start);
+
+#endif

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/register.h:1.1
--- /dev/null	Thu Jun 17 12:13:05 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/register.h	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BOOT_sparc64_REGISTER_H_
+#define BOOT_sparc64_REGISTER_H_
+
+#define PSTATE_IE_BIT    2
+#define PSTATE_PRIV_BIT  4
+#define PSTATE_AM_BIT    8
+
+#define ASI_ICBUS_CONFIG        0x4a
+#define ICBUS_CONFIG_MID_SHIFT  17
+
+#endif

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/stack.h:1.1
--- /dev/null	Thu Jun 17 12:13:05 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/stack.h	Thu Jun 17 11:20:44 2010
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BOOT_sparc64_STACK_H_
+#define BOOT_sparc64_STACK_H_
+
+#define STACK_ALIGNMENT              16
+#define STACK_BIAS                   2047
+#define STACK_WINDOW_SAVE_AREA_SIZE  (16 * 8)
+
+#endif

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/types.h:1.1
--- /dev/null	Thu Jun 17 12:13:05 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/include/types.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2006 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BOOT_sparc64_TYPES_H_
+#define BOOT_sparc64_TYPES_H_
+
+#include <boot/gentypes.h>
+
+typedef signed char int8_t;
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+typedef unsigned long uint64_t;
+
+typedef uint64_t uintptr_t;
+typedef uint64_t unative_t;
+
+#endif

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/sparc64/loader/main.c:1.1
--- /dev/null	Thu Jun 17 12:13:05 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/sparc64/loader/main.c	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,439 @@
+/*
+ * Copyright (c) 2005 Martin Decky
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * $Id$
+ *
+ * Modifications are made to switch to using printk rather than printf,
+ * and to remove portions of the HelenOS bootstrap process that are 
+ * unnecessary on RTEMS.  The removed code is elided with #if 0 ... #endif
+ * blocks.
+ *
+ * Removes some header files. Adds back some missing defines.
+ */
+
+#define RTEMS
+
+#include <bsp.h>
+#include <rtems/bspIo.h>
+
+#include <boot/main.h>
+#include <boot/balloc.h>
+#include <boot/ofw.h>
+#include <boot/ofw_tree.h>
+#include <boot/ofwarch.h>
+#include <boot/align.h>
+
+#if 0
+#include "asm.h"
+#include <printf.h>
+#include "_components.h"
+#include <macros.h>
+#include <string.h>
+#include <memstr.h>
+#endif
+
+#include <asm.h>
+
+#define PAGE_WIDTH  14
+#define PAGE_SIZE   (1 << PAGE_WIDTH)
+
+static bootinfo_t bootinfo;
+#if 0
+static component_t components[COMPONENTS];
+static char *release = STRING(RELEASE);
+
+#ifdef REVISION
+	static char *revision = ", revision " STRING(REVISION);
+#else
+	static char *revision = "";
+#endif
+
+#ifdef TIMESTAMP
+	static char *timestamp = "\nBuilt on " STRING(TIMESTAMP);
+#else
+	static char *timestamp = "";
+#endif
+#endif
+
+#if 0
+/** UltraSPARC subarchitecture - 1 for US, 3 for US3, 0 for other */
+static uint8_t subarchitecture = 0;
+#endif
+
+#if 0
+/**
+ * mask of the MID field inside the ICBUS_CONFIG register shifted by
+ * MID_SHIFT bits to the right
+ */
+static uint16_t mid_mask;
+#endif
+
+#if 0
+/** Print version information. */
+static void version_print(void)
+{
+	printk("HelenOS SPARC64 Bootloader\nRelease %s%s%s\n"
+	    "Copyright (c) 2006 HelenOS project\n",
+	    release, revision, timestamp);
+}
+#endif
+
+/* the lowest ID (read from the VER register) of some US3 CPU model */
+#define FIRST_US3_CPU  0x14
+
+/* the greatest ID (read from the VER register) of some US3 CPU model */
+#define LAST_US3_CPU   0x19
+
+/* UltraSPARC IIIi processor implementation code */
+#define US_IIIi_CODE   0x15
+
+/* max. length of the "compatible" property of the root node */
+#define COMPATIBLE_PROP_MAXLEN	64
+
+/*
+ * HelenOS bootloader will use these constants to distinguish particular
+ * UltraSPARC architectures
+ */
+#define COMPATIBLE_SUN4U	10
+#define COMPATIBLE_SUN4V	20
+
+/** US architecture. COMPATIBLE_SUN4U for sun4v, COMPATIBLE_SUN4V for sun4u */
+static uint8_t architecture;
+
+/**
+ * Detects the UltraSPARC architecture (sun4u and sun4v currently supported)
+ * by inspecting the property called "compatible" in the OBP root node.
+ */
+static void detect_architecture(void)
+{
+	phandle root = ofw_find_device("/");
+	char compatible[COMPATIBLE_PROP_MAXLEN];
+
+	if (ofw_get_property(root, "compatible", compatible,
+			COMPATIBLE_PROP_MAXLEN) <= 0) {
+		printk("Unable to determine architecture, default: sun4u.\n");
+		architecture = COMPATIBLE_SUN4U;
+		return;
+	}
+
+	if (strcmp(compatible, "sun4v") == 0) {
+		architecture = COMPATIBLE_SUN4V;
+	} else {
+		/*
+	 	 * As not all sun4u machines have "sun4u" in their "compatible"
+ 	 	 * OBP property (e.g. Serengeti's OBP "compatible" property is
+ 	 	 * "SUNW,Serengeti"), we will by default fallback to sun4u if
+	 	 * an unknown value of the "compatible" property is encountered.
+ 		 */
+		architecture = COMPATIBLE_SUN4U;
+	}
+}
+
+#if 0
+/**
+ * Detects the subarchitecture (US, US3) of the sun4u
+ * processor. Sets the global variables "subarchitecture" and "mid_mask" to
+ * correct values.
+ */
+static void detect_subarchitecture(void)
+{
+	uint64_t v;
+	asm volatile (
+		"rdpr %%ver, %0\n"
+		: "=r" (v)
+	);
+	
+	v = (v << 16) >> 48;
+	if ((v >= FIRST_US3_CPU) && (v <= LAST_US3_CPU)) {
+		subarchitecture = SUBARCH_US3;
+		if (v == US_IIIi_CODE)
+			mid_mask = (1 << 5) - 1;
+		else
+			mid_mask = (1 << 10) - 1;
+	} else if (v < FIRST_US3_CPU) {
+		subarchitecture = SUBARCH_US;
+		mid_mask = (1 << 5) - 1;
+	} else
+		printk("\nThis CPU is not supported by HelenOS.");
+}
+#endif
+
+#if 0
+/**
+ * Performs sun4u-specific initialization. The components are expected
+ * to be already copied and boot allocator initialized.
+ *
+ * @param base	kernel base virtual address
+ * @param top	virtual address above which the boot allocator
+ * 		can make allocations
+ */
+static void bootstrap_sun4u(void *base, unsigned int top)
+{
+	void *balloc_base;
+	/*
+  	 * Claim and map the physical memory for the boot allocator.
+  	 * Initialize the boot allocator.
+  	 */
+	balloc_base = base + ALIGN_UP(top, PAGE_SIZE);
+	(void) ofw_claim_phys(bootinfo.physmem_start + balloc_base,
+	    BALLOC_MAX_SIZE);
+	(void) ofw_map(bootinfo.physmem_start + balloc_base, balloc_base,
+	    BALLOC_MAX_SIZE, -1);
+	balloc_init(&bootinfo.ballocs, (uintptr_t) balloc_base,
+	    (uintptr_t) balloc_base);
+#if 0	
+	printf("Setting up screens...");
+	ofw_setup_screens();
+	printf("done.\n");
+#endif
+#if 0
+	printf("Canonizing OpenFirmware device tree...");
+#endif
+	bootinfo.ofw_root = ofw_tree_build();
+#if 0
+	printf("done.\n");
+#endif
+#if 0
+#ifdef CONFIG_AP
+	printf("Checking for secondary processors...");
+	if (!ofw_cpu(mid_mask, bootinfo.physmem_start))
+		printf("Error: unable to get CPU properties\n");
+	printf("done.\n");
+#endif
+#endif
+}
+#endif
+
+#if 0
+/**
+ *  * Performs sun4v-specific initialization. The components are expected
+ *   * to be already copied and boot allocator initialized.
+ *    */
+static void bootstrap_sun4v(void)
+{
+	/*
+	 * When SILO booted, the OBP had established a virtual to physical
+	 * memory mapping. This mapping is not an identity (because the
+	 * physical memory starts on non-zero address) - this is not
+	 * surprising. But! The mapping even does not map virtual address
+	 * 0 onto the starting address of the physical memory, but onto an
+	 * address which is 0x400000 bytes higher. The reason is that the
+	 * OBP had already used the memory just at the beginning of the
+	 * physical memory, so that memory cannot be used by SILO (nor
+	 * bootloader). As for now, we solve it by a nasty workaround:
+	 * we pretend that the physical memory starts 0x400000 bytes further
+	 * than it actually does (and hence pretend that the physical memory
+	 * is 0x400000 bytes smaller). Of course, the value 0x400000 will most
+	 * probably depend on the machine and OBP version (the workaround now
+	 * works on Simics). A solution would be to inspect the "available"
+	 * property of the "/memory" node to find out which parts of memory
+	 * are used by OBP and redesign the algorithm of copying
+	 * kernel/init tasks/ramdisk from the bootable image to memory
+	 * (which we must do anyway because of issues with claiming the memory
+	 * on Serengeti).
+ 	 */
+	bootinfo.physmem_start += 0x400000;
+	bootinfo.memmap.zones[0].start += 0x400000;
+	bootinfo.memmap.zones[0].size -= 0x400000;
+#if 0
+	printf("The sun4v init finished.");
+#endif
+}
+#endif
+
+void bootstrap(void)
+{
+#if 0
+	void *base = (void *) KERNEL_VIRTUAL_ADDRESS;
+	unsigned int top = 0;
+	unsigned int i;
+	unsigned int j;
+#endif
+
+  detect_architecture();
+#if 0
+	init_components(components);
+#endif
+	
+	if (!ofw_get_physmem_start(&bootinfo.physmem_start)) {
+		printk("Error: unable to get start of physical memory.\n");
+		halt();
+	}
+	
+	if (!ofw_memmap(&bootinfo.memmap)) {
+		printk("Error: unable to get memory map, halting.\n");
+		halt();
+	}
+	
+	if (bootinfo.memmap.total == 0) {
+		printk("Error: no memory detected, halting.\n");
+		halt();
+	}
+	
+	/*
+	 * SILO for some reason adds 0x400000 and subtracts
+	 * bootinfo.physmem_start to/from silo_ramdisk_image.
+	 * We just need plain physical address so we fix it up.
+	 */
+	if (silo_ramdisk_image) {
+		silo_ramdisk_image += bootinfo.physmem_start;
+		silo_ramdisk_image -= 0x400000;
+		
+		/* Install 1:1 mapping for the RAM disk. */
+		if (ofw_map((void *) ((uintptr_t) silo_ramdisk_image),
+		    (void *) ((uintptr_t) silo_ramdisk_image),
+		    silo_ramdisk_size, -1) != 0) {
+			printk("Failed to map RAM disk.\n");
+			halt();
+		}
+	}
+	
+  printk("\nMemory statistics (total %d MB, starting at %x)\n",
+	    bootinfo.memmap.total >> 20, bootinfo.physmem_start);
+	printk(" %x: kernel entry point\n", KERNEL_VIRTUAL_ADDRESS);
+	printk(" %x: boot info structure\n", &bootinfo);
+
+#if 0
+	/*
+	 * Figure out destination address for each component.
+	 * In this phase, we don't copy the components yet because we want to
+	 * to be careful not to overwrite anything, especially the components
+	 * which haven't been copied yet.
+	 */
+	bootinfo.taskmap.count = 0;
+	for (i = 0; i < COMPONENTS; i++) {
+		printf(" %P: %s image (size %d bytes)\n", components[i].start,
+		    components[i].name, components[i].size);
+		top = ALIGN_UP(top, PAGE_SIZE);
+		if (i > 0) {
+			if (bootinfo.taskmap.count == TASKMAP_MAX_RECORDS) {
+				printf("Skipping superfluous components.\n");
+				break;
+			}
+			
+			bootinfo.taskmap.tasks[bootinfo.taskmap.count].addr =
+			    base + top;
+			bootinfo.taskmap.tasks[bootinfo.taskmap.count].size =
+			    components[i].size;
+			strncpy(bootinfo.taskmap.tasks[
+			    bootinfo.taskmap.count].name, components[i].name,
+			    BOOTINFO_TASK_NAME_BUFLEN);
+			bootinfo.taskmap.count++;
+		}
+		top += components[i].size;
+	}
+	
+	printf("\n");
+
+	/* Do not consider RAM disk */
+	j = bootinfo.taskmap.count - 1;
+	
+	if (silo_ramdisk_image) {
+		/* Treat the RAM disk as the last bootinfo task. */
+		if (bootinfo.taskmap.count == TASKMAP_MAX_RECORDS) {
+			printf("Skipping RAM disk.\n");
+			goto skip_ramdisk;
+		}
+		
+		top = ALIGN_UP(top, PAGE_SIZE);
+		bootinfo.taskmap.tasks[bootinfo.taskmap.count].addr = 
+		    base + top;
+		bootinfo.taskmap.tasks[bootinfo.taskmap.count].size =
+		    silo_ramdisk_size;
+		bootinfo.taskmap.count++;
+		printf("Copying RAM disk...");
+		
+		/*
+		 * Claim and map the whole ramdisk as it may exceed the area
+		 * given to us by SILO.
+		 */
+		(void) ofw_claim_phys(base + top, silo_ramdisk_size);
+		(void) ofw_map(bootinfo.physmem_start + base + top, base + top,
+		    silo_ramdisk_size, -1);
+		memmove(base + top, (void *) ((uintptr_t) silo_ramdisk_image),
+		    silo_ramdisk_size);
+		
+		printf("done.\n");
+		top += silo_ramdisk_size;
+	}
+skip_ramdisk:
+	
+	/*
+	 * Now we can proceed to copy the components. We do it in reverse order
+	 * so that we don't overwrite anything even if the components overlap
+	 * with base.
+	 */
+	printf("Copying tasks...");
+	for (i = COMPONENTS - 1; i > 0; i--, j--) {
+		printf("%s ", components[i].name);
+		
+		/*
+		 * At this point, we claim the physical memory that we are
+		 * going to use. We should be safe in case of the virtual
+		 * address space because the OpenFirmware, according to its
+		 * SPARC binding, should restrict its use of virtual memory
+		 * to addresses from [0xffd00000; 0xffefffff] and
+		 * [0xfe000000; 0xfeffffff].
+		 *
+		 * XXX We don't map this piece of memory. We simply rely on
+		 *     SILO to have it done for us already in this case.
+		 */
+		(void) ofw_claim_phys(bootinfo.physmem_start +
+		    bootinfo.taskmap.tasks[j].addr,
+		    ALIGN_UP(components[i].size, PAGE_SIZE));
+		
+		memcpy((void *) bootinfo.taskmap.tasks[j].addr,
+		    components[i].start, components[i].size);
+		
+	}
+	printf(".\n");
+	
+	printf("Copying kernel...");
+	(void) ofw_claim_phys(bootinfo.physmem_start + base,
+	    ALIGN_UP(components[0].size, PAGE_SIZE));
+	memcpy(base, components[0].start, components[0].size);
+	printf("done.\n");
+	
+	/* perform architecture-specific initialization */
+	if (architecture == COMPATIBLE_SUN4U) {
+		bootstrap_sun4u(base, top);
+	} else if (architecture == COMPATIBLE_SUN4V) {
+		bootstrap_sun4v();
+	} else {
+		printf("Unknown architecture.\n");
+		halt();
+	}
+	
+	printf("Booting the kernel...\n");
+	jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS,
+	    bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo,
+	    sizeof(bootinfo), subarchitecture);
+#endif
+}

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/sparc64/loader/ofwarch.c:1.1
--- /dev/null	Thu Jun 17 12:13:06 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/sparc64/loader/ofwarch.c	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) 2005 Martin Decky
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file
+ * @brief Architecture dependent parts of OpenFirmware interface.
+ */
+
+/*
+ * $Id$
+ *
+ * Modifications are made to compile for RTEMS. Removes asm.h and printf.h.
+ * Removes write().
+ *
+ */
+
+
+#include <boot/ofwarch.h>
+#include <boot/ofw.h>
+#include <string.h>
+#include <boot/register.h>
+#include <boot/main.h>
+#if 0
+#include "asm.h"
+#include <printf.h>
+#endif
+
+#if 0 /* contaminates libc */
+void write(const char *str, const int len)
+{
+	int i;
+	
+	for (i = 0; i < len; i++) {
+		if (str[i] == '\n')
+			ofw_write("\r", 1);
+		ofw_write(&str[i], 1);
+	}
+}
+#endif
+
+int ofw_translate_failed(ofw_arg_t flag)
+{
+	return flag != -1;
+}
+
+/**
+ * Starts all CPUs represented by following siblings of the given node,
+ * except for the current CPU.
+ *
+ * @param child         The first child of the OFW tree node whose children
+ *                      represent CPUs to be woken up.
+ * @param current_mid   MID of the current CPU, the current CPU will
+ *                      (of course) not be woken up.
+ * @param physmem_start Starting address of the physical memory.
+ *
+ * @return Number of CPUs which have the same parent node as
+ *         "child".
+ *
+ */
+static int wake_cpus_in_node(phandle child, uint64_t current_mid,
+    uintptr_t physmem_start)
+{
+	int cpus;
+	
+	for (cpus = 0; (child != 0) && (child != -1);
+	    child = ofw_get_peer_node(child), cpus++) {
+		char type_name[OFW_TREE_PROPERTY_MAX_VALUELEN];
+		
+		if (ofw_get_property(child, "device_type", type_name,
+		    OFW_TREE_PROPERTY_MAX_VALUELEN) > 0) {
+			type_name[OFW_TREE_PROPERTY_MAX_VALUELEN - 1] = 0;
+			if (strcmp(type_name, "cpu") == 0) {
+				uint32_t mid;
+				
+				/*
+				 * "upa-portid" for US, "portid" for US-III,
+				 * "cpuid" for US-IV
+				 */
+				if ((ofw_get_property(child, "upa-portid", &mid, sizeof(mid)) <= 0)
+				    && (ofw_get_property(child, "portid", &mid, sizeof(mid)) <= 0)
+				    && (ofw_get_property(child, "cpuid", &mid, sizeof(mid)) <= 0))
+					continue;
+				
+				if (current_mid != mid) {
+					/*
+					 * Start secondary processor.
+					 */
+					(void) ofw_call("SUNW,start-cpu", 3, 1,
+					    NULL, child, KERNEL_VIRTUAL_ADDRESS,
+					    physmem_start | AP_PROCESSOR);
+				}
+			}
+		}
+	}
+	
+	return cpus;
+}
+
+/**
+ * Finds out the current CPU's MID and wakes up all AP processors.
+ */
+int ofw_cpu(uint16_t mid_mask, uintptr_t physmem_start)
+{
+	/* Get the current CPU MID */
+	uint64_t current_mid;
+	
+	asm volatile (
+		"ldxa [%1] %2, %0\n"
+		: "=r" (current_mid)
+		: "r" (0), "i" (ASI_ICBUS_CONFIG)
+	);
+	
+	current_mid >>= ICBUS_CONFIG_MID_SHIFT;
+	current_mid &= mid_mask;
+	
+	/* Wake up the CPUs */
+	
+	phandle cpus_parent = ofw_find_device("/ssm at 0,0");
+	if ((cpus_parent == 0) || (cpus_parent == -1))
+		cpus_parent = ofw_find_device("/");
+	
+	phandle node = ofw_get_child_node(cpus_parent);
+	int cpus = wake_cpus_in_node(node, current_mid, physmem_start);
+	while ((node != 0) && (node != -1)) {
+		char name[OFW_TREE_PROPERTY_MAX_VALUELEN];
+		
+		if (ofw_get_property(node, "name", name,
+		    OFW_TREE_PROPERTY_MAX_VALUELEN) > 0) {
+			name[OFW_TREE_PROPERTY_MAX_VALUELEN - 1] = 0;
+			if (strcmp(name, "cmp") == 0) {
+				phandle subnode = ofw_get_child_node(node);
+				cpus += wake_cpus_in_node(subnode,
+					current_mid, physmem_start);
+			}
+		}
+		node = ofw_get_peer_node(node);
+	}
+	
+	return cpus;
+}
+
+/** Get physical memory starting address.
+ *
+ * @param start Pointer to variable where the physical memory starting
+ *              address will be stored.
+ *
+ * @return Non-zero on succes, zero on failure.
+ *
+ */
+int ofw_get_physmem_start(uintptr_t *start)
+{
+	uint32_t memreg[4];
+	if (ofw_get_property(ofw_memory, "reg", &memreg, sizeof(memreg)) <= 0)
+		return 0;
+	
+	*start = (((uint64_t) memreg[0]) << 32) | memreg[1];
+	return 1;
+}

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/sparc64/loader/ofwasm.S:1.1
--- /dev/null	Thu Jun 17 12:13:06 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/boot/sparc64/loader/ofwasm.S	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,64 @@
+#
+# Copyright (c) 2006 Martin Decky
+# Copyright (c) 2006 Jakub Jermar 
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+/*
+ * $Id$
+ *
+ * This code is originally in asm.S. This is the only function used from that
+ * file, so it has been relocated to this new file ofw.S which is not actually
+ * located in the HelenOS code base.
+ */
+
+#include <boot/stack.h>
+#include <boot/register.h>
+
+.register %g2, #scratch
+.register %g3, #scratch
+
+.text
+
+.global ofw
+ofw:
+	save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
+	set ofw_cif, %l0
+	ldx [%l0], %l0
+	
+	rdpr  %pstate, %l1
+	and  %l1, ~PSTATE_AM_BIT, %l2
+	wrpr  %l2, 0, %pstate
+	
+	jmpl %l0, %o7
+	mov %i0, %o0
+
+  clr %g4     ! correction for gcc's ABI change
+
+	wrpr %l1, 0, %pstate
+	
+	ret
+	restore %o0, 0, %o0

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/genarch/include/ofw/ofw_tree.h:1.1
--- /dev/null	Thu Jun 17 12:13:06 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/genarch/include/ofw/ofw_tree.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef KERN_OFW_TREE_H_
+#define KERN_OFW_TREE_H_
+
+#include <arch/types.h>
+#include <typedefs.h>
+
+#define OFW_TREE_PROPERTY_MAX_NAMELEN  32
+
+/** Memory representation of OpenFirmware device tree node property. */
+typedef struct {
+	char name[OFW_TREE_PROPERTY_MAX_NAMELEN];
+	size_t size;
+	void *value;
+} ofw_tree_property_t;
+
+/** Memory representation of OpenFirmware device tree node. */
+typedef struct ofw_tree_node {
+	struct ofw_tree_node *parent;
+	struct ofw_tree_node *peer;
+	struct ofw_tree_node *child;
+	
+	uint32_t node_handle;           /**< Old OpenFirmware node handle. */
+	
+	char *da_name;                  /**< Disambigued name. */
+	
+	unsigned int properties;        /**< Number of properties. */
+	ofw_tree_property_t *property;
+	
+	/**
+	 * Pointer to a structure representing respective device.
+	 * Its semantics is device dependent.
+	 */
+	void *device;
+} ofw_tree_node_t;
+
+/* Walker for visiting OpenFirmware device tree nodes. */
+typedef bool (* ofw_tree_walker_t)(ofw_tree_node_t *, void *);
+
+extern void ofw_tree_init(ofw_tree_node_t *);
+extern void ofw_tree_print(void);
+
+extern const char *ofw_tree_node_name(const ofw_tree_node_t *);
+extern ofw_tree_node_t *ofw_tree_lookup(const char *);
+extern ofw_tree_property_t *ofw_tree_getprop(const ofw_tree_node_t *,
+    const char *);
+extern void ofw_tree_walk_by_device_type(const char *, ofw_tree_walker_t,
+    void *);
+
+extern ofw_tree_node_t *ofw_tree_find_child(ofw_tree_node_t *, const char *);
+extern ofw_tree_node_t *ofw_tree_find_child_by_device_type(ofw_tree_node_t *,
+    const char *);
+
+extern ofw_tree_node_t *ofw_tree_find_peer_by_device_type(ofw_tree_node_t *,
+    const char *);
+extern ofw_tree_node_t *ofw_tree_find_peer_by_name(ofw_tree_node_t *,
+    const char *);
+extern ofw_tree_node_t *ofw_tree_find_node_by_handle(ofw_tree_node_t *,
+    uint32_t);
+
+#endif

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/generic/include/align.h:1.1
--- /dev/null	Thu Jun 17 12:13:06 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/generic/include/align.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup generic
+ * @ingroup others
+ * @{
+ */
+/**
+ * @file
+ * @brief Macros for making values and addresses aligned.
+ */
+
+#ifndef KERN_ALIGN_H_
+#define KERN_ALIGN_H_
+
+/** Align to the nearest lower address.
+ *
+ * @param s Address or size to be aligned.
+ * @param a Size of alignment, must be power of 2.
+ */
+#define ALIGN_DOWN(s, a)  ((s) & ~((a) - 1))
+
+
+/** Align to the nearest higher address.
+ *
+ * @param s Address or size to be aligned.
+ * @param a Size of alignment, must be power of 2.
+ */
+#define ALIGN_UP(s, a)  (((s) + ((a) - 1)) & ~((a) - 1))
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/arch.h:1.1
--- /dev/null	Thu Jun 17 12:13:06 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/arch.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64	
+ * @{
+ */
+/**
+ * @file
+ * @brief	Various sparc64-specific macros.
+ */
+
+#ifndef KERN_sparc64_ARCH_H_
+#define KERN_sparc64_ARCH_H_
+
+#if defined (SUN4U)
+#include <arch/sun4u/arch.h>
+#elif defined (SUN4V)
+#include <arch/sun4v/arch.h>
+#endif
+
+#define ASI_AIUP		0x10	/** Access to primary context with user privileges. */
+#define ASI_AIUS		0x11	/** Access to secondary context with user privileges. */
+
+#define NWINDOWS		8	/** Number of register window sets. */
+
+#ifndef __ASM__
+
+extern void arch_pre_main(void);
+
+#endif /* __ASM__ */
+
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/boot.h:1.1
--- /dev/null	Thu Jun 17 12:13:06 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/boot.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_BOOT_H_
+#define KERN_sparc64_BOOT_H_
+
+#if 0
+#define VMA			0x400000
+#endif
+#define VMA     0x4000
+#define LMA			VMA
+
+#ifndef __ASM__
+#ifndef __LINKER__
+
+#include <config.h>
+#include <arch/types.h>
+#include <genarch/ofw/ofw_tree.h>
+
+#define TASKMAP_MAX_RECORDS	32
+#define MEMMAP_MAX_RECORDS	32
+
+#define BOOTINFO_TASK_NAME_BUFLEN 32
+
+typedef struct {
+	void * addr;
+	uint32_t size;
+	char name[BOOTINFO_TASK_NAME_BUFLEN];
+} utask_t;
+
+typedef struct {
+	uint32_t count;
+	utask_t tasks[TASKMAP_MAX_RECORDS];
+} taskmap_t;
+
+typedef struct {
+	uintptr_t start;
+	uint32_t size;
+} memzone_t;
+
+typedef struct {
+	uint32_t total;
+	uint32_t count;
+	memzone_t zones[MEMMAP_MAX_RECORDS];
+} memmap_t;
+
+/** Bootinfo structure.
+ *
+ * Must be in sync with bootinfo structure used by the boot loader.
+ */
+typedef struct {
+	uintptr_t physmem_start;
+	taskmap_t taskmap;
+	memmap_t memmap;
+	ballocs_t ballocs;
+	ofw_tree_node_t *ofw_root;
+} bootinfo_t;
+
+extern bootinfo_t bootinfo;
+
+#endif
+#endif
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/cache_spec.h:1.1
--- /dev/null	Thu Jun 17 12:13:06 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/cache_spec.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2008 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64mm	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_CACHE_SPEC_H_
+#define KERN_sparc64_CACHE_SPEC_H_
+
+/*
+ * The following macros are valid for the following processors:
+ *
+ * 	UltraSPARC, UltraSPARC II, UltraSPARC IIi, UltraSPARC III,
+ * 	UltraSPARC III+, UltraSPARC IV, UltraSPARC IV+
+ * 
+ * Should we support other UltraSPARC processors, we need to make sure that
+ * the macros are defined correctly for them.
+ */
+ 
+#if defined (US)
+#define DCACHE_SIZE		(16 * 1024)
+#elif defined (US3)
+#define DCACHE_SIZE		(64 * 1024)
+#endif
+#define DCACHE_LINE_SIZE	32	
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/frame.h:1.1
--- /dev/null	Thu Jun 17 12:13:06 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/frame.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64mm	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_FRAME_H_
+#define KERN_sparc64_FRAME_H_
+
+#if defined (SUN4U)
+#include <arch/mm/sun4u/frame.h>
+#elif defined (SUN4V)
+#include <arch/mm/sun4v/frame.h>
+#endif
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/mmu.h:1.1
--- /dev/null	Thu Jun 17 12:13:06 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/mmu.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64mm	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_MMU_H_
+#define KERN_sparc64_MMU_H_
+
+#if defined (SUN4U)
+#include <arch/mm/sun4u/mmu.h>
+#elif defined (SUN4V)
+#include <arch/mm/sun4v/mmu.h>
+#endif
+
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/page.h:1.1
--- /dev/null	Thu Jun 17 12:13:06 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/page.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64mm	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_PAGE_H_
+#define KERN_sparc64_PAGE_H_
+
+#include <arch/mm/frame.h>
+
+/*
+ * On the TLB and TSB level, we still use 8K pages, which are supported by the
+ * MMU.
+ */
+#define MMU_PAGE_WIDTH	MMU_FRAME_WIDTH
+#define MMU_PAGE_SIZE	MMU_FRAME_SIZE
+
+/*
+ * On the page table level, we use 16K pages. 16K pages are not supported by
+ * the MMU but we emulate them with pairs of 8K pages.
+ */
+#define PAGE_WIDTH	FRAME_WIDTH
+#define PAGE_SIZE	FRAME_SIZE
+
+#define MMU_PAGES_PER_PAGE	(1 << (PAGE_WIDTH - MMU_PAGE_WIDTH))
+
+#ifdef KERNEL
+
+#ifndef __ASM__
+
+#include <arch/interrupt.h>
+
+extern uintptr_t physmem_base;
+
+#define KA2PA(x)	(((uintptr_t) (x)) + physmem_base)
+#define PA2KA(x)	(((uintptr_t) (x)) - physmem_base)
+
+typedef union {
+	uintptr_t address;
+	struct {
+		uint64_t vpn : 51;		/**< Virtual Page Number. */
+		unsigned offset : 13;		/**< Offset. */
+	} __attribute__ ((packed));
+} page_address_t;
+
+extern void page_arch_init(void);
+
+#endif /* !def __ASM__ */
+
+#endif /* KERNEL */
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/frame.h:1.1
--- /dev/null	Thu Jun 17 12:13:06 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/frame.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64mm	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_SUN4U_FRAME_H_
+#define KERN_sparc64_SUN4U_FRAME_H_
+
+/*
+ * Page size supported by the MMU.
+ * For 8K there is the nasty illegal virtual aliasing problem.
+ * Therefore, the kernel uses 8K only internally on the TLB and TSB levels.
+ */
+#define MMU_FRAME_WIDTH		13	/* 8K */
+#define MMU_FRAME_SIZE		(1 << MMU_FRAME_WIDTH)
+
+/*
+ * Page size exported to the generic memory management subsystems.
+ * This page size is not directly supported by the MMU, but we can emulate
+ * each 16K page with a pair of adjacent 8K pages.
+ */
+#define FRAME_WIDTH		14	/* 16K */
+#define FRAME_SIZE		(1 << FRAME_WIDTH)
+
+#ifdef KERNEL
+#ifndef __ASM__
+
+#include <arch/types.h>
+
+union frame_address {
+	uintptr_t address;
+	struct {
+#if defined (US)
+		unsigned : 23;
+		uint64_t pfn : 28;		/**< Physical Frame Number. */
+#elif defined (US3)
+		unsigned : 21;
+		uint64_t pfn : 30;		/**< Physical Frame Number. */
+#endif
+		unsigned offset : 13;		/**< Offset. */
+	} __attribute__ ((packed));
+};
+
+typedef union frame_address frame_address_t;
+
+extern uintptr_t last_frame;
+extern uintptr_t end_of_identity;
+
+extern void frame_arch_init(void);
+#define physmem_print()
+
+#endif
+#endif
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/mmu.h:1.1
--- /dev/null	Thu Jun 17 12:13:07 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/mmu.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64mm	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_sun4u_MMU_H_
+#define KERN_sparc64_sun4u_MMU_H_
+
+#if defined(US)
+/* LSU Control Register ASI. */
+#define ASI_LSU_CONTROL_REG		0x45	/**< Load/Store Unit Control Register. */
+#endif
+
+/* I-MMU ASIs. */
+#define ASI_IMMU			0x50
+#define ASI_IMMU_TSB_8KB_PTR_REG	0x51	
+#define ASI_IMMU_TSB_64KB_PTR_REG	0x52
+#define ASI_ITLB_DATA_IN_REG		0x54
+#define ASI_ITLB_DATA_ACCESS_REG	0x55
+#define ASI_ITLB_TAG_READ_REG		0x56
+#define ASI_IMMU_DEMAP			0x57
+
+/* Virtual Addresses within ASI_IMMU. */
+#define VA_IMMU_TSB_TAG_TARGET		0x0	/**< IMMU TSB tag target register. */
+#define VA_IMMU_SFSR			0x18	/**< IMMU sync fault status register. */
+#define VA_IMMU_TSB_BASE		0x28	/**< IMMU TSB base register. */
+#define VA_IMMU_TAG_ACCESS		0x30	/**< IMMU TLB tag access register. */
+#if defined (US3)
+#define VA_IMMU_PRIMARY_EXTENSION	0x48	/**< IMMU TSB primary extension register */
+#define VA_IMMU_NUCLEUS_EXTENSION	0x58	/**< IMMU TSB nucleus extension register */
+#endif
+
+
+/* D-MMU ASIs. */
+#define ASI_DMMU			0x58
+#define ASI_DMMU_TSB_8KB_PTR_REG	0x59	
+#define ASI_DMMU_TSB_64KB_PTR_REG	0x5a
+#define ASI_DMMU_TSB_DIRECT_PTR_REG	0x5b
+#define ASI_DTLB_DATA_IN_REG		0x5c
+#define ASI_DTLB_DATA_ACCESS_REG	0x5d
+#define ASI_DTLB_TAG_READ_REG		0x5e
+#define ASI_DMMU_DEMAP			0x5f
+
+/* Virtual Addresses within ASI_DMMU. */
+#define VA_DMMU_TSB_TAG_TARGET		0x0	/**< DMMU TSB tag target register. */
+#define VA_PRIMARY_CONTEXT_REG		0x8	/**< DMMU primary context register. */
+#define VA_SECONDARY_CONTEXT_REG	0x10	/**< DMMU secondary context register. */
+#define VA_DMMU_SFSR			0x18	/**< DMMU sync fault status register. */
+#define VA_DMMU_SFAR			0x20	/**< DMMU sync fault address register. */
+#define VA_DMMU_TSB_BASE		0x28	/**< DMMU TSB base register. */
+#define VA_DMMU_TAG_ACCESS		0x30	/**< DMMU TLB tag access register. */
+#define VA_DMMU_VA_WATCHPOINT_REG	0x38	/**< DMMU VA data watchpoint register. */
+#define VA_DMMU_PA_WATCHPOINT_REG	0x40	/**< DMMU PA data watchpoint register. */
+#if defined (US3)
+#define VA_DMMU_PRIMARY_EXTENSION	0x48	/**< DMMU TSB primary extension register */
+#define VA_DMMU_SECONDARY_EXTENSION	0x50	/**< DMMU TSB secondary extension register */
+#define VA_DMMU_NUCLEUS_EXTENSION	0x58	/**< DMMU TSB nucleus extension register */
+#endif
+
+#ifndef __ASM__
+
+#include <arch/asm.h>
+#include <arch/barrier.h>
+#include <arch/types.h>
+
+#if defined(US)
+/** LSU Control Register. */
+typedef union {
+	uint64_t value;
+	struct {
+		unsigned : 23;
+		unsigned pm : 8;
+		unsigned vm : 8;
+		unsigned pr : 1;
+		unsigned pw : 1;
+		unsigned vr : 1;
+		unsigned vw : 1;
+		unsigned : 1;
+		unsigned fm : 16;	
+		unsigned dm : 1;	/**< D-MMU enable. */
+		unsigned im : 1;	/**< I-MMU enable. */
+		unsigned dc : 1;	/**< D-Cache enable. */
+		unsigned ic : 1;	/**< I-Cache enable. */
+		
+	} __attribute__ ((packed));
+} lsu_cr_reg_t;
+#endif /* US */
+
+#endif /* !def __ASM__ */
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/page.h:1.1
--- /dev/null	Thu Jun 17 12:13:07 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/page.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64mm	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_PAGE_H_
+#define KERN_sparc64_PAGE_H_
+
+#include <arch/mm/frame.h>
+
+/*
+ * On the TLB and TSB level, we still use 8K pages, which are supported by the
+ * MMU.
+ */
+#define MMU_PAGE_WIDTH	MMU_FRAME_WIDTH
+#define MMU_PAGE_SIZE	MMU_FRAME_SIZE
+
+/*
+ * On the page table level, we use 16K pages. 16K pages are not supported by
+ * the MMU but we emulate them with pairs of 8K pages.
+ */
+#define PAGE_WIDTH	FRAME_WIDTH
+#define PAGE_SIZE	FRAME_SIZE
+
+#define MMU_PAGES_PER_PAGE	(1 << (PAGE_WIDTH - MMU_PAGE_WIDTH))
+
+#ifdef KERNEL
+
+#ifndef __ASM__
+
+#include <arch/interrupt.h>
+
+extern uintptr_t physmem_base;
+
+#define KA2PA(x)	(((uintptr_t) (x)) + physmem_base)
+#define PA2KA(x)	(((uintptr_t) (x)) - physmem_base)
+
+typedef union {
+	uintptr_t address;
+	struct {
+		uint64_t vpn : 51;		/**< Virtual Page Number. */
+		unsigned offset : 13;		/**< Offset. */
+	} __attribute__ ((packed));
+} page_address_t;
+
+extern void page_arch_init(void);
+
+#endif /* !def __ASM__ */
+
+#endif /* KERNEL */
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/tlb.h:1.1
--- /dev/null	Thu Jun 17 12:13:07 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/tlb.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,693 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64mm	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_TLB_sun4u_H_
+#define KERN_sparc64_TLB_sun4u_H_
+
+#if defined (US)
+#define ITLB_ENTRY_COUNT		64
+#define DTLB_ENTRY_COUNT		64
+#define DTLB_MAX_LOCKED_ENTRIES		DTLB_ENTRY_COUNT
+#endif
+
+/** TLB_DSMALL is the only of the three DMMUs that can hold locked entries. */
+#if defined (US3)
+#define DTLB_MAX_LOCKED_ENTRIES		16
+#endif
+
+#define MEM_CONTEXT_KERNEL		0
+#define MEM_CONTEXT_TEMP		1
+
+/** Page sizes. */
+#define PAGESIZE_8K	0
+#define PAGESIZE_64K	1
+#define PAGESIZE_512K	2
+#define PAGESIZE_4M	3
+
+/** Bit width of the TLB-locked portion of kernel address space. */
+#define KERNEL_PAGE_WIDTH       22	/* 4M */
+
+/* TLB Demap Operation types. */
+#define TLB_DEMAP_PAGE		0
+#define TLB_DEMAP_CONTEXT	1
+#if defined (US3)
+#define TLB_DEMAP_ALL		2
+#endif
+
+#define TLB_DEMAP_TYPE_SHIFT	6
+
+/* TLB Demap Operation Context register encodings. */
+#define TLB_DEMAP_PRIMARY	0
+#define TLB_DEMAP_SECONDARY	1
+#define TLB_DEMAP_NUCLEUS	2
+
+/* There are more TLBs in one MMU in US3, their codes are defined here. */
+#if defined (US3)
+/* D-MMU: one small (16-entry) TLB and two big (512-entry) TLBs */
+#define TLB_DSMALL	0
+#define TLB_DBIG_0	2
+#define TLB_DBIG_1	3
+	
+/* I-MMU: one small (16-entry) TLB and one big TLB */
+#define TLB_ISMALL	0
+#define TLB_IBIG	2
+#endif
+
+#define TLB_DEMAP_CONTEXT_SHIFT	4
+
+/* TLB Tag Access shifts */
+#define TLB_TAG_ACCESS_CONTEXT_SHIFT	0
+#define TLB_TAG_ACCESS_CONTEXT_MASK	((1 << 13) - 1)
+#define TLB_TAG_ACCESS_VPN_SHIFT	13
+
+#ifndef __ASM__
+
+#include <arch/mm/tte.h>
+#include <arch/mm/mmu.h>
+#include <arch/mm/page.h>
+#include <arch/asm.h>
+#include <arch/barrier.h>
+#include <arch/types.h>
+#include <arch/register.h>
+#include <arch/cpu.h>
+
+union tlb_context_reg {
+	uint64_t v;
+	struct {
+		unsigned long : 51;
+		unsigned context : 13;		/**< Context/ASID. */
+	} __attribute__ ((packed));
+};
+typedef union tlb_context_reg tlb_context_reg_t;
+
+/** I-/D-TLB Data In/Access Register type. */
+typedef tte_data_t tlb_data_t;
+
+/** I-/D-TLB Data Access Address in Alternate Space. */
+
+#if defined (US)
+
+union tlb_data_access_addr {
+	uint64_t value;
+	struct {
+		uint64_t : 55;
+		unsigned tlb_entry : 6;
+		unsigned : 3;
+	} __attribute__ ((packed));
+};
+typedef union tlb_data_access_addr dtlb_data_access_addr_t;
+typedef union tlb_data_access_addr dtlb_tag_read_addr_t;
+typedef union tlb_data_access_addr itlb_data_access_addr_t;
+typedef union tlb_data_access_addr itlb_tag_read_addr_t;
+
+#elif defined (US3)
+
+/*
+ * In US3, I-MMU and D-MMU have different formats of the data
+ * access register virtual address. In the corresponding
+ * structures the member variable for the entry number is
+ * called "local_tlb_entry" - it contrasts with the "tlb_entry"
+ * for the US data access register VA structure. The rationale
+ * behind this is to prevent careless mistakes in the code
+ * caused by setting only the entry number and not the TLB
+ * number in the US3 code (when taking the code from US). 
+ */
+
+union dtlb_data_access_addr {
+	uint64_t value;
+	struct {
+		uint64_t : 45;
+		unsigned : 1;
+		unsigned tlb_number : 2;
+		unsigned : 4;
+		unsigned local_tlb_entry : 9;
+		unsigned : 3;
+	} __attribute__ ((packed));
+};
+typedef union dtlb_data_access_addr dtlb_data_access_addr_t;
+typedef union dtlb_data_access_addr dtlb_tag_read_addr_t;
+
+union itlb_data_access_addr {
+	uint64_t value;
+	struct {
+		uint64_t : 45;
+		unsigned : 1;
+		unsigned tlb_number : 2;
+		unsigned : 6;
+		unsigned local_tlb_entry : 7;
+		unsigned : 3;
+	} __attribute__ ((packed));
+};
+typedef union itlb_data_access_addr itlb_data_access_addr_t;
+typedef union itlb_data_access_addr itlb_tag_read_addr_t;
+
+#endif
+
+/** I-/D-TLB Tag Read Register. */
+union tlb_tag_read_reg {
+	uint64_t value;
+	struct {
+		uint64_t vpn : 51;	/**< Virtual Address bits 63:13. */
+		unsigned context : 13;	/**< Context identifier. */
+	} __attribute__ ((packed));
+};
+typedef union tlb_tag_read_reg tlb_tag_read_reg_t;
+typedef union tlb_tag_read_reg tlb_tag_access_reg_t;
+
+
+/** TLB Demap Operation Address. */
+union tlb_demap_addr {
+	uint64_t value;
+	struct {
+		uint64_t vpn: 51;	/**< Virtual Address bits 63:13. */
+#if defined (US)
+		unsigned : 6;		/**< Ignored. */
+		unsigned type : 1;	/**< The type of demap operation. */
+#elif defined (US3)
+		unsigned : 5;		/**< Ignored. */
+		unsigned type: 2;	/**< The type of demap operation. */
+#endif
+		unsigned context : 2;	/**< Context register selection. */
+		unsigned : 4;		/**< Zero. */
+	} __attribute__ ((packed));
+};
+typedef union tlb_demap_addr tlb_demap_addr_t;
+
+/** TLB Synchronous Fault Status Register. */
+union tlb_sfsr_reg {
+	uint64_t value;
+	struct {
+#if defined (US)
+		unsigned long : 40;	/**< Implementation dependent. */
+		unsigned asi : 8;	/**< ASI. */
+		unsigned : 2;
+		unsigned ft : 7;	/**< Fault type. */
+#elif defined (US3)
+		unsigned long : 39;	/**< Implementation dependent. */
+		unsigned nf : 1;	/**< Non-faulting load. */
+		unsigned asi : 8;	/**< ASI. */
+		unsigned tm : 1;	/**< I-TLB miss. */
+		unsigned : 3;		/**< Reserved. */
+		unsigned ft : 5;	/**< Fault type. */
+#endif
+		unsigned e : 1;		/**< Side-effect bit. */
+		unsigned ct : 2;	/**< Context Register selection. */
+		unsigned pr : 1;	/**< Privilege bit. */
+		unsigned w : 1;		/**< Write bit. */
+		unsigned ow : 1;	/**< Overwrite bit. */
+		unsigned fv : 1;	/**< Fault Valid bit. */
+	} __attribute__ ((packed));
+};
+typedef union tlb_sfsr_reg tlb_sfsr_reg_t;
+
+#if defined (US3)
+
+/*
+ * Functions for determining the number of entries in TLBs. They either return
+ * a constant value or a value based on the CPU autodetection.
+ */
+
+/**
+ * Determine the number of entries in the DMMU's small TLB. 
+ */
+static inline uint16_t tlb_dsmall_size(void)
+{
+	return 16;
+}
+
+/**
+ * Determine the number of entries in each DMMU's big TLB. 
+ */
+static inline uint16_t tlb_dbig_size(void)
+{
+	return 512;
+}
+
+/**
+ * Determine the number of entries in the IMMU's small TLB. 
+ */
+static inline uint16_t tlb_ismall_size(void)
+{
+	return 16;
+}
+
+/**
+ * Determine the number of entries in the IMMU's big TLB. 
+ */
+static inline uint16_t tlb_ibig_size(void)
+{
+	if (((ver_reg_t) ver_read()).impl == IMPL_ULTRASPARCIV_PLUS)
+		return 512;
+	else
+		return 128;
+}
+
+#endif
+
+/** Read MMU Primary Context Register.
+ *
+ * @return		Current value of Primary Context Register.
+ */
+static inline uint64_t mmu_primary_context_read(void)
+{
+	return asi_u64_read(ASI_DMMU, VA_PRIMARY_CONTEXT_REG);
+}
+
+/** Write MMU Primary Context Register.
+ *
+ * @param v		New value of Primary Context Register.
+ */
+static inline void mmu_primary_context_write(uint64_t v)
+{
+	asi_u64_write(ASI_DMMU, VA_PRIMARY_CONTEXT_REG, v);
+	flush_pipeline();
+}
+
+/** Read MMU Secondary Context Register.
+ *
+ * @return		Current value of Secondary Context Register.
+ */
+static inline uint64_t mmu_secondary_context_read(void)
+{
+	return asi_u64_read(ASI_DMMU, VA_SECONDARY_CONTEXT_REG);
+}
+
+/** Write MMU Primary Context Register.
+ *
+ * @param v		New value of Primary Context Register.
+ */
+static inline void mmu_secondary_context_write(uint64_t v)
+{
+	asi_u64_write(ASI_DMMU, VA_SECONDARY_CONTEXT_REG, v);
+	flush_pipeline();
+}
+
+#if defined (US)
+
+/** Read IMMU TLB Data Access Register.
+ *
+ * @param entry		TLB Entry index.
+ *
+ * @return		Current value of specified IMMU TLB Data Access
+ * 			Register.
+ */
+static inline uint64_t itlb_data_access_read(size_t entry)
+{
+	itlb_data_access_addr_t reg;
+	
+	reg.value = 0;
+	reg.tlb_entry = entry;
+	return asi_u64_read(ASI_ITLB_DATA_ACCESS_REG, reg.value);
+}
+
+/** Write IMMU TLB Data Access Register.
+ *
+ * @param entry		TLB Entry index.
+ * @param value		Value to be written.
+ */
+static inline void itlb_data_access_write(size_t entry, uint64_t value)
+{
+	itlb_data_access_addr_t reg;
+	
+	reg.value = 0;
+	reg.tlb_entry = entry;
+	asi_u64_write(ASI_ITLB_DATA_ACCESS_REG, reg.value, value);
+	flush_pipeline();
+}
+
+/** Read DMMU TLB Data Access Register.
+ *
+ * @param entry		TLB Entry index.
+ *
+ * @return		Current value of specified DMMU TLB Data Access
+ * 			Register.
+ */
+static inline uint64_t dtlb_data_access_read(size_t entry)
+{
+	dtlb_data_access_addr_t reg;
+	
+	reg.value = 0;
+	reg.tlb_entry = entry;
+	return asi_u64_read(ASI_DTLB_DATA_ACCESS_REG, reg.value);
+}
+
+/** Write DMMU TLB Data Access Register.
+ *
+ * @param entry		TLB Entry index.
+ * @param value		Value to be written.
+ */
+static inline void dtlb_data_access_write(size_t entry, uint64_t value)
+{
+	dtlb_data_access_addr_t reg;
+	
+	reg.value = 0;
+	reg.tlb_entry = entry;
+	asi_u64_write(ASI_DTLB_DATA_ACCESS_REG, reg.value, value);
+	membar();
+}
+
+/** Read IMMU TLB Tag Read Register.
+ *
+ * @param entry		TLB Entry index.
+ *
+ * @return		Current value of specified IMMU TLB Tag Read Register.
+ */
+static inline uint64_t itlb_tag_read_read(size_t entry)
+{
+	itlb_tag_read_addr_t tag;
+
+	tag.value = 0;
+	tag.tlb_entry =	entry;
+	return asi_u64_read(ASI_ITLB_TAG_READ_REG, tag.value);
+}
+
+/** Read DMMU TLB Tag Read Register.
+ *
+ * @param entry		TLB Entry index.
+ *
+ * @return		Current value of specified DMMU TLB Tag Read Register.
+ */
+static inline uint64_t dtlb_tag_read_read(size_t entry)
+{
+	dtlb_tag_read_addr_t tag;
+
+	tag.value = 0;
+	tag.tlb_entry =	entry;
+	return asi_u64_read(ASI_DTLB_TAG_READ_REG, tag.value);
+}
+
+#elif defined (US3)
+
+
+/** Read IMMU TLB Data Access Register.
+ *
+ * @param tlb		TLB number (one of TLB_ISMALL or TLB_IBIG)
+ * @param entry		TLB Entry index.
+ *
+ * @return		Current value of specified IMMU TLB Data Access
+ * 			Register.
+ */
+static inline uint64_t itlb_data_access_read(int tlb, size_t entry)
+{
+	itlb_data_access_addr_t reg;
+	
+	reg.value = 0;
+	reg.tlb_number = tlb;
+	reg.local_tlb_entry = entry;
+	return asi_u64_read(ASI_ITLB_DATA_ACCESS_REG, reg.value);
+}
+
+/** Write IMMU TLB Data Access Register.
+ * @param tlb		TLB number (one of TLB_ISMALL or TLB_IBIG)
+ * @param entry		TLB Entry index.
+ * @param value		Value to be written.
+ */
+static inline void itlb_data_access_write(int tlb, size_t entry,
+	uint64_t value)
+{
+	itlb_data_access_addr_t reg;
+	
+	reg.value = 0;
+	reg.tlb_number = tlb;
+	reg.local_tlb_entry = entry;
+	asi_u64_write(ASI_ITLB_DATA_ACCESS_REG, reg.value, value);
+	flush_pipeline();
+}
+
+/** Read DMMU TLB Data Access Register.
+ *
+ * @param tlb		TLB number (one of TLB_DSMALL, TLB_DBIG, TLB_DBIG) 
+ * @param entry		TLB Entry index.
+ *
+ * @return		Current value of specified DMMU TLB Data Access
+ * 			Register.
+ */
+static inline uint64_t dtlb_data_access_read(int tlb, size_t entry)
+{
+	dtlb_data_access_addr_t reg;
+	
+	reg.value = 0;
+	reg.tlb_number = tlb;
+	reg.local_tlb_entry = entry;
+	return asi_u64_read(ASI_DTLB_DATA_ACCESS_REG, reg.value);
+}
+
+/** Write DMMU TLB Data Access Register.
+ *
+ * @param tlb		TLB number (one of TLB_DSMALL, TLB_DBIG_0, TLB_DBIG_1)  
+ * @param entry		TLB Entry index.
+ * @param value		Value to be written.
+ */
+static inline void dtlb_data_access_write(int tlb, size_t entry,
+	uint64_t value)
+{
+	dtlb_data_access_addr_t reg;
+	
+	reg.value = 0;
+	reg.tlb_number = tlb;
+	reg.local_tlb_entry = entry;
+	asi_u64_write(ASI_DTLB_DATA_ACCESS_REG, reg.value, value);
+	membar();
+}
+
+/** Read IMMU TLB Tag Read Register.
+ *
+ * @param tlb		TLB number (one of TLB_ISMALL or TLB_IBIG) 
+ * @param entry		TLB Entry index.
+ *
+ * @return		Current value of specified IMMU TLB Tag Read Register.
+ */
+static inline uint64_t itlb_tag_read_read(int tlb, size_t entry)
+{
+	itlb_tag_read_addr_t tag;
+
+	tag.value = 0;
+	tag.tlb_number = tlb;
+	tag.local_tlb_entry = entry;
+	return asi_u64_read(ASI_ITLB_TAG_READ_REG, tag.value);
+}
+
+/** Read DMMU TLB Tag Read Register.
+ *
+ * @param tlb		TLB number (one of TLB_DSMALL, TLB_DBIG_0, TLB_DBIG_1)
+ * @param entry		TLB Entry index.
+ *
+ * @return		Current value of specified DMMU TLB Tag Read Register.
+ */
+static inline uint64_t dtlb_tag_read_read(int tlb, size_t entry)
+{
+	dtlb_tag_read_addr_t tag;
+
+	tag.value = 0;
+	tag.tlb_number = tlb;
+	tag.local_tlb_entry = entry;
+	return asi_u64_read(ASI_DTLB_TAG_READ_REG, tag.value);
+}
+
+#endif
+
+
+/** Write IMMU TLB Tag Access Register.
+ *
+ * @param v		Value to be written.
+ */
+static inline void itlb_tag_access_write(uint64_t v)
+{
+	asi_u64_write(ASI_IMMU, VA_IMMU_TAG_ACCESS, v);
+	flush_pipeline();
+}
+
+/** Read IMMU TLB Tag Access Register.
+ *
+ * @return		Current value of IMMU TLB Tag Access Register.
+ */
+static inline uint64_t itlb_tag_access_read(void)
+{
+	return asi_u64_read(ASI_IMMU, VA_IMMU_TAG_ACCESS);
+}
+
+/** Write DMMU TLB Tag Access Register.
+ *
+ * @param v		Value to be written.
+ */
+static inline void dtlb_tag_access_write(uint64_t v)
+{
+	asi_u64_write(ASI_DMMU, VA_DMMU_TAG_ACCESS, v);
+	membar();
+}
+
+/** Read DMMU TLB Tag Access Register.
+ *
+ * @return 		Current value of DMMU TLB Tag Access Register.
+ */
+static inline uint64_t dtlb_tag_access_read(void)
+{
+	return asi_u64_read(ASI_DMMU, VA_DMMU_TAG_ACCESS);
+}
+
+
+/** Write IMMU TLB Data in Register.
+ *
+ * @param v		Value to be written.
+ */
+static inline void itlb_data_in_write(uint64_t v)
+{
+	asi_u64_write(ASI_ITLB_DATA_IN_REG, 0, v);
+	flush_pipeline();
+}
+
+/** Write DMMU TLB Data in Register.
+ *
+ * @param v		Value to be written.
+ */
+static inline void dtlb_data_in_write(uint64_t v)
+{
+	asi_u64_write(ASI_DTLB_DATA_IN_REG, 0, v);
+	membar();
+}
+
+/** Read ITLB Synchronous Fault Status Register.
+ *
+ * @return		Current content of I-SFSR register.
+ */
+static inline uint64_t itlb_sfsr_read(void)
+{
+	return asi_u64_read(ASI_IMMU, VA_IMMU_SFSR);
+}
+
+/** Write ITLB Synchronous Fault Status Register.
+ *
+ * @param v		New value of I-SFSR register.
+ */
+static inline void itlb_sfsr_write(uint64_t v)
+{
+	asi_u64_write(ASI_IMMU, VA_IMMU_SFSR, v);
+	flush_pipeline();
+}
+
+/** Read DTLB Synchronous Fault Status Register.
+ *
+ * @return		Current content of D-SFSR register.
+ */
+static inline uint64_t dtlb_sfsr_read(void)
+{
+	return asi_u64_read(ASI_DMMU, VA_DMMU_SFSR);
+}
+
+/** Write DTLB Synchronous Fault Status Register.
+ *
+ * @param v		New value of D-SFSR register.
+ */
+static inline void dtlb_sfsr_write(uint64_t v)
+{
+	asi_u64_write(ASI_DMMU, VA_DMMU_SFSR, v);
+	membar();
+}
+
+/** Read DTLB Synchronous Fault Address Register.
+ *
+ * @return		Current content of D-SFAR register.
+ */
+static inline uint64_t dtlb_sfar_read(void)
+{
+	return asi_u64_read(ASI_DMMU, VA_DMMU_SFAR);
+}
+
+/** Perform IMMU TLB Demap Operation.
+ *
+ * @param type		Selects between context and page demap (and entire MMU
+ * 			demap on US3).
+ * @param context_encoding Specifies which Context register has Context ID for
+ * 			demap.
+ * @param page		Address which is on the page to be demapped.
+ */
+static inline void itlb_demap(int type, int context_encoding, uintptr_t page)
+{
+	tlb_demap_addr_t da;
+	page_address_t pg;
+	
+	da.value = 0;
+	pg.address = page;
+	
+	da.type = type;
+	da.context = context_encoding;
+	da.vpn = pg.vpn;
+	
+	/* da.value is the address within the ASI */ 
+	asi_u64_write(ASI_IMMU_DEMAP, da.value, 0);
+
+	flush_pipeline();
+}
+
+/** Perform DMMU TLB Demap Operation.
+ *
+ * @param type		Selects between context and page demap (and entire MMU
+ * 			demap on US3).
+ * @param context_encoding Specifies which Context register has Context ID for
+ * 			demap.
+ * @param page		Address which is on the page to be demapped.
+ */
+static inline void dtlb_demap(int type, int context_encoding, uintptr_t page)
+{
+	tlb_demap_addr_t da;
+	page_address_t pg;
+	
+	da.value = 0;
+	pg.address = page;
+	
+	da.type = type;
+	da.context = context_encoding;
+	da.vpn = pg.vpn;
+	
+	/* da.value is the address within the ASI */ 
+	asi_u64_write(ASI_DMMU_DEMAP, da.value, 0);
+
+	membar();
+}
+
+extern void fast_instruction_access_mmu_miss(unative_t, istate_t *);
+extern void fast_data_access_mmu_miss(tlb_tag_access_reg_t, istate_t *);
+extern void fast_data_access_protection(tlb_tag_access_reg_t , istate_t *);
+
+extern void dtlb_insert_mapping(uintptr_t, uintptr_t, int, bool, bool);
+
+extern void dump_sfsr_and_sfar(void);
+extern void describe_dmmu_fault(void);
+
+#endif /* !def __ASM__ */
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/tte.h:1.1
--- /dev/null	Thu Jun 17 12:13:07 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/sun4u/tte.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64mm	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_sun4u_TTE_H_
+#define KERN_sparc64_sun4u_TTE_H_
+
+#define TTE_G		(1 << 0)
+#define TTE_W		(1 << 1)
+#define TTE_P		(1 << 2)
+#define TTE_E		(1 << 3)
+#define TTE_CV		(1 << 4)
+#define TTE_CP		(1 << 5)
+#define TTE_L		(1 << 6)
+
+#define TTE_V_SHIFT	63
+#define TTE_SIZE_SHIFT	61
+
+#ifndef __ASM__
+
+#include <arch/types.h>
+
+/* TTE tag's VA_tag field contains bits <63:VA_TAG_PAGE_SHIFT> of the VA */
+#define VA_TAG_PAGE_SHIFT	22
+
+/** Translation Table Entry - Tag. */
+union tte_tag {
+	uint64_t value;
+	struct {
+		unsigned g : 1;		/**< Global. */
+		unsigned : 2;		/**< Reserved. */
+		unsigned context : 13;	/**< Context identifier. */
+		unsigned : 6;		/**< Reserved. */
+		uint64_t va_tag : 42;	/**< Virtual Address Tag, bits 63:22. */
+	} __attribute__ ((packed));
+};
+
+typedef union tte_tag tte_tag_t;
+
+/** Translation Table Entry - Data. */
+union tte_data {
+	uint64_t value;
+	struct {
+		unsigned v : 1;		/**< Valid. */
+		unsigned size : 2;	/**< Page size of this entry. */
+		unsigned nfo : 1;	/**< No-Fault-Only. */
+		unsigned ie : 1;	/**< Invert Endianness. */
+		unsigned soft2 : 9;	/**< Software defined field. */
+#if defined (US)
+		unsigned diag : 9;	/**< Diagnostic data. */
+		unsigned pfn : 28;	/**< Physical Address bits, bits 40:13. */
+#elif defined (US3)
+		unsigned : 7;		/**< Reserved. */
+		unsigned pfn : 30;	/**< Physical Address bits, bits 42:13 */
+#endif
+		unsigned soft : 6;	/**< Software defined field. */
+		unsigned l : 1;		/**< Lock. */
+		unsigned cp : 1;	/**< Cacheable in physically indexed cache. */
+		unsigned cv : 1;	/**< Cacheable in virtually indexed cache. */
+		unsigned e : 1;		/**< Side-effect. */
+		unsigned p : 1;		/**< Privileged. */
+		unsigned w : 1;		/**< Writable. */
+		unsigned g : 1;		/**< Global. */
+	} __attribute__ ((packed));
+};
+
+typedef union tte_data tte_data_t;
+
+#endif /* !def __ASM__ */
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/tlb.h:1.1
--- /dev/null	Thu Jun 17 12:13:07 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/tlb.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64mm	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_TLB_H_
+#define KERN_sparc64_TLB_H_
+
+
+#if defined (SUN4U)
+#include <arch/mm/sun4u/tlb.h>
+#elif defined (SUN4V)
+#include <arch/mm/sun4v/tlb.h>
+#endif
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/tte.h:1.1
--- /dev/null	Thu Jun 17 12:13:07 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/mm/tte.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64mm	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_TTE_H_
+#define KERN_sparc64_TTE_H_
+
+#if defined (SUN4U)
+#include <arch/mm/sun4u/tte.h>
+#elif defined (SUN4V)
+#include <arch/mm/sun4v/tte.h>
+#endif
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/regdef.h:1.1
--- /dev/null	Thu Jun 17 12:13:07 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/regdef.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_REGDEF_H_
+#define KERN_sparc64_REGDEF_H_
+
+#define PSTATE_IE_BIT	(1 << 1)
+#define PSTATE_AM_BIT	(1 << 3)
+
+#define PSTATE_AG_BIT	(1 << 0)
+#define PSTATE_IG_BIT	(1 << 11)
+#define PSTATE_MG_BIT	(1 << 10)
+
+#define PSTATE_PRIV_BIT	(1 << 2)
+#define PSTATE_PEF_BIT	(1 << 4)
+
+#define TSTATE_PSTATE_SHIFT	8
+#define TSTATE_PRIV_BIT		(PSTATE_PRIV_BIT << TSTATE_PSTATE_SHIFT)
+#define TSTATE_IE_BIT		(PSTATE_IE_BIT << TSTATE_PSTATE_SHIFT)
+#define TSTATE_PEF_BIT		(PSTATE_PEF_BIT << TSTATE_PSTATE_SHIFT)
+
+#define TSTATE_CWP_MASK		0x1f
+
+#define WSTATE_NORMAL(n)	(n)
+#define WSTATE_OTHER(n)		((n) << 3)
+
+/*
+ * The following definitions concern the UPA_CONFIG register on US and the
+ * FIREPLANE_CONFIG register on US3. 
+ */
+#define ICBUS_CONFIG_MID_SHIFT    17
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/stack.h:1.1
--- /dev/null	Thu Jun 17 12:13:07 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/stack.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64	
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_sparc64_STACK_H_
+#define KERN_sparc64_STACK_H_
+
+#define STACK_ITEM_SIZE			8
+
+/** According to SPARC Compliance Definition, every stack frame is 16-byte aligned. */
+#define STACK_ALIGNMENT			16
+
+/**
+ * 16-extended-word save area for %i[0-7] and %l[0-7] registers.
+ */
+#define STACK_WINDOW_SAVE_AREA_SIZE	(16 * STACK_ITEM_SIZE)
+
+/**
+ * Six extended words for first six arguments.
+ */
+#define STACK_ARG_SAVE_AREA_SIZE	(6 * STACK_ITEM_SIZE)
+
+/**
+ * By convention, the actual top of the stack is %sp + STACK_BIAS.
+ */
+#define STACK_BIAS            2047
+
+/*
+ * Offsets of arguments on stack.
+ */
+#define STACK_ARG0			0
+#define STACK_ARG1			8
+#define STACK_ARG2			16
+#define STACK_ARG3			24
+#define STACK_ARG4			32
+#define STACK_ARG5			40
+#define STACK_ARG6			48
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/sun4u/arch.h:1.1
--- /dev/null	Thu Jun 17 12:13:07 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/include/sun4u/arch.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2005 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup sparc64	
+ * @{
+ */
+/**
+ * @file
+ * @brief	Various sun4u-specific macros.
+ */
+
+#ifndef KERN_sparc64_sun4u_ARCH_H_
+#define KERN_sparc64_sun4u_ARCH_H_
+
+#define ASI_NUCLEUS_QUAD_LDD	0x24	/** ASI for 16-byte atomic loads. */
+#define ASI_DCACHE_TAG		0x47	/** ASI D-Cache Tag. */
+#define ASI_ICBUS_CONFIG	0x4a	/** ASI of the UPA_CONFIG/FIREPLANE_CONFIG register. */
+
+#endif
+
+/** @}
+ */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/src/cache.S:1.1
--- /dev/null	Thu Jun 17 12:13:07 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/src/cache.S	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2006 Jakub Jermar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <rtems/asm.h>
+#include <arch/arch.h>
+#include <arch/mm/cache_spec.h>
+
+#define DCACHE_TAG_SHIFT	2
+
+.register %g2, #scratch
+.register %g3, #scratch
+
+/** Flush the whole D-cache. */
+.global dcache_flush
+dcache_flush:
+	set (DCACHE_SIZE - DCACHE_LINE_SIZE), %g1
+	stxa %g0, [%g1] ASI_DCACHE_TAG
+0:	membar #Sync
+	subcc %g1, DCACHE_LINE_SIZE, %g1
+	bnz,pt %xcc, 0b
+	stxa %g0, [%g1] ASI_DCACHE_TAG
+	membar #Sync			
+	retl
+	! beware SF Erratum #51, do not put the MEMBAR here
+	nop				

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/src/sun4u/takemmu.S:1.1
--- /dev/null	Thu Jun 17 12:13:08 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/helenos/kernel/sparc64/src/sun4u/takemmu.S	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,477 @@
+#
+# Copyright (c) 2005 Jakub Jermar
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+/*
+ * $Id$
+ *
+ * This file originally is sparc64/src/sun4u/start.S
+ * A lot of changes are made to the code, because we only need the relevant 
+ * portions for taking over the D- and I-MMUs.
+ *
+ */
+#define RTEMS
+
+#include <rtems/asm.h>
+
+/* RTEMS: moved all of these to a common include directory */
+#if 0
+#include <arch/arch.h>
+#include <arch/cpu.h>
+#include <arch/regdef.h>
+#endif
+#include <arch/boot.h>
+#include <arch/stack.h>
+
+#include <arch/mm/mmu.h>
+#include <arch/mm/tlb.h>
+#include <arch/mm/tte.h>
+
+#if 0
+#ifdef CONFIG_SMP
+#include <arch/context_offset.h>
+#endif
+#endif
+
+.register %g2, #scratch
+.register %g3, #scratch
+#if defined (RTEMS)
+.section BOOTSTRAP
+#endif
+
+#if 0
+.section K_TEXT_START, "ax"
+
+#define BSP_FLAG	1
+
+/*
+ * 2^PHYSMEM_ADDR_SIZE is the size of the physical address space on
+ * a given processor.
+ */
+#if defined (US)
+    #define PHYSMEM_ADDR_SIZE	41
+#elif defined (US3)
+    #define PHYSMEM_ADDR_SIZE	43
+#endif
+#endif
+
+#if defined (RTEMS)
+  #define PHYSMEM_ADDR_SIZE 43
+#endif
+
+#if 0
+/*
+ * Here is where the kernel is passed control from the boot loader.
+ * 
+ * The registers are expected to be in this state:
+ * - %o0 starting address of physical memory + bootstrap processor flag
+ * 	bits 63...1:	physical memory starting address / 2
+ *	bit 0:		non-zero on BSP processor, zero on AP processors
+ * - %o1 bootinfo structure address (BSP only)
+ * - %o2 bootinfo structure size (BSP only)
+ *
+ * Moreover, we depend on boot having established the following environment:
+ * - TLBs are on
+ * - identity mapping for the kernel image
+ */
+.global kernel_image_start
+kernel_image_start:
+	mov BSP_FLAG, %l0
+	and %o0, %l0, %l7			! l7 <= bootstrap processor?
+	andn %o0, %l0, %l6			! l6 <= start of physical memory
+
+	! Get bits (PHYSMEM_ADDR_SIZE - 1):13 of physmem_base.
+	srlx %l6, 13, %l5
+	
+	! l5 <= physmem_base[(PHYSMEM_ADDR_SIZE - 1):13]
+	sllx %l5, 13 + (63 - (PHYSMEM_ADDR_SIZE - 1)), %l5
+	srlx %l5, 63 - (PHYSMEM_ADDR_SIZE - 1), %l5	
+
+	/*
+	 * Setup basic runtime environment.
+	 */
+
+	wrpr %g0, NWINDOWS - 2, %cansave	! set maximum saveable windows
+	wrpr %g0, 0, %canrestore		! get rid of windows we will
+						! never need again
+	wrpr %g0, 0, %otherwin			! make sure the window state is
+						! consistent
+	wrpr %g0, NWINDOWS - 1, %cleanwin	! prevent needless clean_window
+						! traps for kernel
+						
+	wrpr %g0, 0, %wstate			! use default spill/fill trap
+
+	wrpr %g0, 0, %tl			! TL = 0, primary context
+						! register is used
+
+	wrpr %g0, PSTATE_PRIV_BIT, %pstate	! disable interrupts and disable
+						! 32-bit address masking
+
+	wrpr %g0, 0, %pil			! intialize %pil
+#endif
+
+#if defined (RTEMS)
+  /* pass o0 as start of physical memory */
+.global _take_mmu
+_take_mmu:
+	save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
+  mov %i0, %l6
+#endif
+  
+  /* these are copied from above */
+  ! Get bits (PHYSMEM_ADDR_SIZE - 1):13 of physmem_base.
+  srlx %l6, 13, %l5
+
+  ! l5 <= physmem_base[(PHYSMEM_ADDR_SIZE - 1):13]
+  sllx %l5, 13 + (63 - (PHYSMEM_ADDR_SIZE - 1)), %l5
+  srlx %l5, 63 - (PHYSMEM_ADDR_SIZE - 1), %l5
+	
+  /*
+	 * Switch to kernel trap table.
+	 */
+	sethi %hi(trap_table), %g1
+	wrpr %g1, %lo(trap_table), %tba
+
+
+	/* 
+	 * Take over the DMMU by installing locked TTE entry identically
+	 * mapping the first 4M of memory.
+	 *
+	 * In case of DMMU, no FLUSH instructions need to be issued. Because of
+	 * that, the old DTLB contents can be demapped pretty straightforwardly
+	 * and without causing any traps.
+	 */
+
+	wr %g0, ASI_DMMU, %asi
+/*
+#define SET_TLB_DEMAP_CMD(r1, context_id) \
+	set (TLB_DEMAP_CONTEXT << TLB_DEMAP_TYPE_SHIFT) | (context_id << \
+		TLB_DEMAP_CONTEXT_SHIFT), %r1
+*/
+/*	
+	! demap context 0
+	SET_TLB_DEMAP_CMD(g1, TLB_DEMAP_NUCLEUS)
+	stxa %g0, [%g1] ASI_DMMU_DEMAP			
+	membar #Sync
+*/
+#define SET_TLB_TAG(r1, context) \
+	set VMA | (context << TLB_TAG_ACCESS_CONTEXT_SHIFT), %r1
+
+	! write DTLB tag
+	SET_TLB_TAG(g1, MEM_CONTEXT_KERNEL)
+	stxa %g1, [VA_DMMU_TAG_ACCESS] %asi			
+	membar #Sync
+
+#ifdef CONFIG_VIRT_IDX_DCACHE
+#define TTE_LOW_DATA(imm) 	(TTE_CP | TTE_CV | TTE_P | LMA | (imm))
+#else /* CONFIG_VIRT_IDX_DCACHE */
+#define TTE_LOW_DATA(imm) 	(TTE_CP | TTE_P | LMA | (imm))
+#endif /* CONFIG_VIRT_IDX_DCACHE */
+
+#define SET_TLB_DATA(r1, r2, imm) \
+	set TTE_LOW_DATA(imm), %r1; \
+	or %r1, %l5, %r1; \
+	mov PAGESIZE_4M, %r2; \
+	sllx %r2, TTE_SIZE_SHIFT, %r2; \
+	or %r1, %r2, %r1; \
+	mov 1, %r2; \
+	sllx %r2, TTE_V_SHIFT, %r2; \
+	or %r1, %r2, %r1;
+	
+	! write DTLB data and install the kernel mapping
+	SET_TLB_DATA(g1, g2, TTE_L | TTE_W)	! use non-global mapping
+	stxa %g1, [%g0] ASI_DTLB_DATA_IN_REG		
+	membar #Sync
+
+	/*
+	 * Because we cannot use global mappings (because we want to have
+	 * separate 64-bit address spaces for both the kernel and the
+	 * userspace), we prepare the identity mapping also in context 1. This
+	 * step is required by the code installing the ITLB mapping.
+	 */
+/*	! write DTLB tag of context 1 (i.e. MEM_CONTEXT_TEMP)
+	SET_TLB_TAG(g1, MEM_CONTEXT_TEMP)
+	stxa %g1, [VA_DMMU_TAG_ACCESS] %asi			
+	membar #Sync
+
+	! write DTLB data and install the kernel mapping in context 1
+	SET_TLB_DATA(g1, g2, TTE_W)			! use non-global mapping
+	stxa %g1, [%g0] ASI_DTLB_DATA_IN_REG		
+	membar #Sync
+*/
+	/*
+	 * Now is time to take over the IMMU. Unfortunatelly, it cannot be done
+	 * as easily as the DMMU, because the IMMU is mapping the code it
+	 * executes.
+	 *
+	 * [ Note that brave experiments with disabling the IMMU and using the
+	 * DMMU approach failed after a dozen of desparate days with only little
+	 * success. ]
+	 *
+	 * The approach used here is inspired from OpenBSD. First, the kernel
+	 * creates IMMU mapping for itself in context 1 (MEM_CONTEXT_TEMP) and
+	 * switches to it. Context 0 (MEM_CONTEXT_KERNEL) can be demapped
+	 * afterwards and replaced with the kernel permanent mapping. Finally,
+	 * the kernel switches back to context 0 and demaps context 1.
+	 *
+	 * Moreover, the IMMU requires use of the FLUSH instructions. But that
+	 * is OK because we always use operands with addresses already mapped by
+	 * the taken over DTLB.
+	 */
+#if 0	
+	set kernel_image_start, %g5
+#endif
+#if defined (RTEMS)
+  set _take_mmu, %g5
+#endif
+/*	
+	! write ITLB tag of context 1
+	SET_TLB_TAG(g1, MEM_CONTEXT_TEMP)
+	mov VA_DMMU_TAG_ACCESS, %g2
+	stxa %g1, [%g2] ASI_IMMU
+	flush %g5
+
+	! write ITLB data and install the temporary mapping in context 1
+	SET_TLB_DATA(g1, g2, 0)			! use non-global mapping
+	stxa %g1, [%g0] ASI_ITLB_DATA_IN_REG		
+	flush %g5
+	
+	! switch to context 1
+	mov MEM_CONTEXT_TEMP, %g1
+	stxa %g1, [VA_PRIMARY_CONTEXT_REG] %asi	! ASI_DMMU is correct here !!!
+	flush %g5
+	
+	! demap context 0
+	SET_TLB_DEMAP_CMD(g1, TLB_DEMAP_NUCLEUS)
+	stxa %g0, [%g1] ASI_IMMU_DEMAP			
+	flush %g5
+*/
+	! write ITLB tag of context 0
+	SET_TLB_TAG(g1, MEM_CONTEXT_KERNEL)
+	mov VA_DMMU_TAG_ACCESS, %g2
+	stxa %g1, [%g2] ASI_IMMU
+	flush %g5
+
+	! write ITLB data and install the permanent kernel mapping in context 0
+	SET_TLB_DATA(g1, g2, TTE_L)		! use non-global mapping
+	stxa %g1, [%g0] ASI_ITLB_DATA_IN_REG		
+	flush %g5
+/*
+	! enter nucleus - using context 0
+	wrpr %g0, 1, %tl
+
+	! demap context 1
+	SET_TLB_DEMAP_CMD(g1, TLB_DEMAP_PRIMARY)
+	stxa %g0, [%g1] ASI_IMMU_DEMAP			
+	flush %g5
+	
+	! set context 0 in the primary context register
+	stxa %g0, [VA_PRIMARY_CONTEXT_REG] %asi	! ASI_DMMU is correct here !!!
+	flush %g5
+	
+	! leave nucleus - using primary context, i.e. context 0
+	wrpr %g0, 0, %tl
+
+  wrpr %g0, 0, %wstate ! default spill/fill trap
+*/
+#if 0
+	brz %l7, 1f				! skip if you are not the bootstrap CPU
+	nop
+
+	/*
+	 * Save physmem_base for use by the mm subsystem.
+	 * %l6 contains starting physical address
+	 */
+	sethi %hi(physmem_base), %l4
+	stx %l6, [%l4 + %lo(physmem_base)]
+
+	/*
+	 * Precompute kernel 8K TLB data template.
+	 * %l5 contains starting physical address
+	 * bits [(PHYSMEM_ADDR_SIZE - 1):13]
+	 */
+	sethi %hi(kernel_8k_tlb_data_template), %l4
+	ldx [%l4 + %lo(kernel_8k_tlb_data_template)], %l3
+	or %l3, %l5, %l3
+	stx %l3, [%l4 + %lo(kernel_8k_tlb_data_template)]
+#endif
+
+	/*
+	 * Flush D-Cache.
+	 */
+	call dcache_flush
+	nop
+
+#if 0
+	/*
+	 * So far, we have not touched the stack.
+	 * It is a good idea to set the kernel stack to a known state now.
+	 */
+	sethi %hi(temporary_boot_stack), %sp
+	or %sp, %lo(temporary_boot_stack), %sp
+	sub %sp, STACK_BIAS, %sp
+
+	sethi %hi(bootinfo), %o0
+	call memcpy				! copy bootinfo
+	or %o0, %lo(bootinfo), %o0
+
+	call arch_pre_main
+	nop
+	
+	call main_bsp
+	nop
+#endif
+
+#if defined (RTEMS)
+  ret
+  restore
+#endif
+
+	/* Not reached. */
+
+0:
+	ba %xcc, 0b
+	nop
+
+#if 0
+1:
+#ifdef CONFIG_SMP
+	/*
+	 * Determine the width of the MID and save its mask to %g3. The width
+	 * is
+	 * 	* 5 for US and US-IIIi,
+	 * 	* 10 for US3 except US-IIIi.
+	 */
+#if defined(US)
+	mov 0x1f, %g3
+#elif defined(US3)
+	mov 0x3ff, %g3
+	rdpr %ver, %g2
+	sllx %g2, 16, %g2
+	srlx %g2, 48, %g2
+	cmp %g2, IMPL_ULTRASPARCIII_I
+	move %xcc, 0x1f, %g3
+#endif
+
+	/*
+	 * Read MID from the processor.
+	 */
+	ldxa [%g0] ASI_ICBUS_CONFIG, %g1
+	srlx %g1, ICBUS_CONFIG_MID_SHIFT, %g1
+	and %g1, %g3, %g1
+
+	/*
+	 * Active loop for APs until the BSP picks them up. A processor cannot
+	 * leave the loop until the global variable 'waking_up_mid' equals its
+	 * MID.
+	 */
+	set waking_up_mid, %g2
+2:
+	ldx [%g2], %g3
+	cmp %g3, %g1
+	bne %xcc, 2b
+	nop
+
+	/*
+	 * Configure stack for the AP.
+	 * The AP is expected to use the stack saved
+	 * in the ctx global variable.
+	 */
+	set ctx, %g1
+	add %g1, OFFSET_SP, %g1
+	ldx [%g1], %o6
+
+	call main_ap
+	nop
+
+	/* Not reached. */
+#endif
+	
+0:
+	ba %xcc, 0b
+	nop
+
+
+.section K_DATA_START, "aw", @progbits
+
+/*
+ * Create small stack to be used by the bootstrap processor. It is going to be
+ * used only for a very limited period of time, but we switch to it anyway,
+ * just to be sure we are properly initialized.
+ */
+
+#define INITIAL_STACK_SIZE	1024
+
+.align STACK_ALIGNMENT
+	.space INITIAL_STACK_SIZE
+.align STACK_ALIGNMENT
+temporary_boot_stack:
+	.space STACK_WINDOW_SAVE_AREA_SIZE
+
+#endif /* 0 */
+
+.data
+
+.align 8
+.global physmem_base		! copy of the physical memory base address
+physmem_base:
+	.quad 0
+
+/*
+ * The fast_data_access_mmu_miss_data_hi label and the end_of_identity and
+ * kernel_8k_tlb_data_template variables are meant to stay together,
+ * aligned on 16B boundary.
+ */
+.global fast_data_access_mmu_miss_data_hi
+.global end_of_identity 
+.global kernel_8k_tlb_data_template
+
+.align 16
+/*
+ * This label is used by the fast_data_access_MMU_miss trap handler.
+ */
+fast_data_access_mmu_miss_data_hi:
+/*
+ * This variable is used by the fast_data_access_MMU_miss trap handler.
+ * In runtime, it is modified to contain the address of the end of physical
+ * memory.
+ */
+end_of_identity:
+	.quad -1 
+/*
+ * This variable is used by the fast_data_access_MMU_miss trap handler.
+ * In runtime, it is further modified to reflect the starting address of
+ * physical memory.
+ */
+kernel_8k_tlb_data_template:
+#ifdef CONFIG_VIRT_IDX_DCACHE
+	.quad ((1 << TTE_V_SHIFT) | (PAGESIZE_8K << TTE_SIZE_SHIFT) | TTE_CP | \
+		 TTE_CV | TTE_P | TTE_W)
+#else /* CONFIG_VIRT_IDX_DCACHE */
+	.quad ((1 << TTE_V_SHIFT) | (PAGESIZE_8K << TTE_SIZE_SHIFT) | TTE_CP | \
+		TTE_P | TTE_W)
+#endif /* CONFIG_VIRT_IDX_DCACHE */

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/include/asm.h:1.1
--- /dev/null	Thu Jun 17 12:13:08 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/include/asm.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,15 @@
+/*
+ * asm.h
+ *
+ * Copyright 2010 Gedare Bloom
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+
+extern void halt( void );
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/include/traptable.h:1.1
--- /dev/null	Thu Jun 17 12:13:08 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/include/traptable.h	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,21 @@
+/*
+ * traptable.h
+ *
+ * Copyright 2010 Gedare Bloom
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+/* This file can be included by assembly code */
+
+#define ENTRY_SIZE (32)
+#define TABLE_SIZE (1024*ENTRY_SIZE)
+
+#ifndef ASM
+extern void* trap_table[TABLE_SIZE];
+#endif
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/start/start.S:1.1
--- /dev/null	Thu Jun 17 12:13:08 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/start/start.S	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,176 @@
+#
+# Copyright (c) 2006 Martin Decky
+# Copyright (c) 2006 Jakub Jermar
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+/*
+ * start.S
+ *
+ * Start code for Sparc64 RTEMS
+ *
+ * This is based on the boot.S file of the HelenOS sparc64 architecture.
+ * http://www.helenos.org/
+ * ${helenos}/boot/arch/sparc64/loader/boot.S
+ *
+ * Modifications for the RTEMS executive are 
+ *   COPYRIGHT (c) 2010 Gedare Bloom.
+ *   COPYRIGHT (c) 2010 Eugen Leontie.
+ *
+ * $Id$
+ */
+
+#include <rtems/asm.h>
+#include <rtems/score/cpu.h>
+
+#define PSTATE_PRIV_BIT	4
+
+.register %g2, #scratch
+.register %g3, #scratch
+.register %g6, #scratch
+.register %g7, #scratch
+
+#if 0
+#define _BSP_DEBUG
+#endif
+
+#if _BSP_DEBUG
+/*
+ * This is for debug and script support to identify RTEMS app termination
+ */
+.section 	.data
+	.align 8
+_end_token_string:
+	.asciz "END_TOKEN\n"
+#endif
+
+.section BOOTSTRAP, "ax"
+
+PUBLIC(_start)
+  .global _start
+  SYM(_start):
+    start:
+    b 1f
+    nop
+
+    /*
+     * This header forces SILO to load the image at 0x4000.
+     * More precisely, SILO will think this is an old version of Linux.
+     */
+    .ascii "HdrS"
+    .word 0
+    .half 0
+    .half 0
+    .half 0
+    .half 0
+    .global silo_ramdisk_image
+    silo_ramdisk_image:
+    .word 0
+    .global silo_ramdisk_size
+    silo_ramdisk_size:
+    .word 0
+
+    .align 8
+    1:	
+    /*
+     * Disable interrupts and disable address masking.
+     */
+    wrpr %g0, PSTATE_PRIV_BIT, %pstate
+
+    wrpr %g0, SPARC_NUMBER_OF_REGISTER_WINDOWS - 2, %cansave	! set maximum saveable windows
+    wrpr %g0, 0, %canrestore		! get rid of windows we will never need again
+    wrpr %g0, 0, %otherwin			! make sure the window state is consistent
+    wrpr %g0, SPARC_NUMBER_OF_REGISTER_WINDOWS - 1, %cleanwin	! prevent needless clean_window traps for kernel
+
+  /* g4 needs to be cleared for gcc */
+  mov %g0, %g4
+
+  /* Clear the bss */
+	setx	SYM(bss_start), %l0, %g2	! g2 = start of bss
+	setx	SYM(_end), %l0, %g3		    ! g3 = end of bss
+zerobss:
+	stx	%g0, [%g2]
+	add	%g2, 8, %g2
+	cmp	%g2, %g3
+	bleu,a	zerobss
+	nop
+
+  /* Install stack */
+setstack:
+	set SYM(StackStart), %sp
+	add %sp, -STACK_BIAS, %sp
+
+	setx ofw_cif, %l0, %l1
+ 
+	call ofw_init		! initialize OpenFirmware
+	stx %o4, [%l1]
+
+  call bootstrap
+  nop
+
+  /* BSP-specific pre-bootcard initializations */
+  call SYM(_BSP_init)
+  nop
+
+  /* Set up ISR handler for interrupt enable/disable */
+	setx SYM(syscall), %l0, %o1
+	setx param_space, %l0, %o2
+	call SYM(_CPU_ISR_install_raw_handler)
+	mov 0x100, %o0 
+
+  /* Don't need to copy initialized data to RAM--link puts all in RAM already */
+
+	mov	%g0, %o0		! clear command line passed to main
+	call SYM(boot_card)
+	sub	%sp, 0x60, %sp		! make room on stack (necessary?)
+
+#if _BSP_DEBUG
+  /* execution returns here when RTEMS terminates */
+	sethi %hi(_end_token_string), %g1
+	add %g1, %lo(_end_token_string), %o0
+	call SYM(printk)
+	nop
+#endif
+
+  call SYM(halt)
+  nop
+
+halted:	nop
+	    b SYM(halted)
+
+  .align CPU_ALIGNMENT
+  param_space:
+  	.space 8
+
+    .global _fini
+    _fini:
+    nop
+    nop
+
+    .global _init
+    _init:
+    nop
+    nop

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/start/trap_table.S:1.1
--- /dev/null	Thu Jun 17 12:13:08 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/start/trap_table.S	Thu Jun 17 11:20:45 2010
@@ -0,0 +1,204 @@
+/*
+ * trap_table.S
+ *
+ * trap code for Sparc64 RTEMS.
+ *
+ *  COPYRIGHT (c) 2010 Gedare Bloom.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ * 
+ *  This code defines the space for the trap table used by sun4u.
+ *
+ *  This file is currently unused.
+ *
+ * $Id$
+ */
+
+
+#include <rtems/asm.h>
+#include <rtems/score/cpu.h>
+#include <traptable.h>
+
+#define BAD_TRAP \
+    ta  0; \
+  nop; \
+  nop; \
+  nop; \
+  nop; \
+  nop; \
+  nop; \
+  nop;
+
+.section .ttable
+  .align (TABLE_SIZE)
+PUBLIC(trap_table)
+  SYM(trap_table):
+  .space TABLE_SIZE
+
+/* These are just bogus traps that aren't used ever
+
+.org trap_table + 8*32
+    BAD_TRAP;                                     ! 8 IAE
+.org trap_table + 9*32
+    BAD_TRAP;                                     ! 9
+.org trap_table + 10*32
+    BAD_TRAP;                                     ! A
+
+.org trap_table + 11*32
+    BAD_TRAP;                                     ! B
+.org trap_table + 12*32
+    BAD_TRAP;                                     ! C
+
+.org trap_table + 16*32
+    BAD_TRAP;                                     ! 10 illegal instruction
+.org trap_table + 17*32
+    BAD_TRAP;                                     ! 11 privileged op_code
+
+.org trap_table + 18*32
+    BAD_TRAP;                                     ! 12 unimplemented LDD
+.org trap_table + 19*32
+    BAD_TRAP;                                     ! 13 unimplemented std
+.org trap_table + 20*32
+    BAD_TRAP;                                     ! 14 dae invalid asi
+.org trap_table + 21*32
+    BAD_TRAP;                                     ! 15 dae priv violation
+.org trap_table + 22*32
+    BAD_TRAP;                                     ! 16 dae nc page
+.org trap_table + 23*32
+    BAD_TRAP;                                     ! 17 dae nfo page
+
+.org trap_table + 32*32
+    BAD_TRAP;                                     ! 20 fp_disabled
+.org trap_table + 33*32
+    BAD_TRAP;                                     ! 21 fp_exception_ieee_754
+.org trap_table + 34*32
+    BAD_TRAP;                                     ! 22 fp_exception_other
+
+.org trap_table + 35*32
+    BAD_TRAP;                                     ! 23 tag_overflow
+
+.org trap_table + 36*32
+    BAD_TRAP;                         ! 24-27 clean_window
+
+
+.org trap_table + 40*32
+    BAD_TRAP;                                     ! 28 div by zero
+    
+.org trap_table + 48*32
+    BAD_TRAP;                                     ! 30 data access exception
+
+.org trap_table + 49*32
+    BAD_TRAP;                                     ! 31 data mmu miss
+.org trap_table + 50*32
+    BAD_TRAP;                                     ! 32 data access error
+
+.org trap_table + 52*32
+    BAD_TRAP;                                     ! 34 mem address not aligned 
+.org trap_table + 53*32
+    BAD_TRAP;                                     ! 35 LDDF mem address not aligned 
+.org trap_table + 54*32
+    BAD_TRAP;                                     ! 36 STDF mem addr not aligned
+.org trap_table + 55*32
+    BAD_TRAP;                                     ! 37 privileged action
+.org trap_table + 56*32
+    BAD_TRAP;                                     ! 38 LDQF mem addr not aligned
+.org trap_table + 57*32
+    BAD_TRAP;                                     ! 39 STQF mem addr not aligned
+
+
+.org trap_table + 65*32
+    BAD_TRAP;                                     ! 41-4F
+                                                  ! interrupt_level_n (1-15) 
+.org trap_table + 66*32
+    BAD_TRAP;                                     ! 
+.org trap_table + 67*32
+    BAD_TRAP;                                     ! 
+.org trap_table + 68*32
+    BAD_TRAP;                                     ! 
+.org trap_table + 69*32
+    BAD_TRAP;                                     ! 
+.org trap_table + 70*32
+    BAD_TRAP;                                     ! 
+.org trap_table + 71*32
+    BAD_TRAP;                                     ! 
+.org trap_table + 72*32
+    BAD_TRAP;                                     ! 
+.org trap_table + 73*32
+    BAD_TRAP;                                     ! 
+.org trap_table + 74*32
+    BAD_TRAP;                                     ! 
+.org trap_table + 75*32
+    BAD_TRAP;                                     ! 
+.org trap_table + 76*32
+    BAD_TRAP;                                     ! 
+.org trap_table + 77*32
+    BAD_TRAP;                                     ! 
+.org trap_table + 78*32
+    BAD_TRAP;                                     ! 
+.org trap_table + 79*32
+    BAD_TRAP;                                     ! 
+
+.org trap_table + 124*32
+    BAD_TRAP;                                     ! 7C cpu mondo
+
+.org trap_table + 125*32
+    BAD_TRAP;                                     ! 7D dev mondo
+
+.org trap_table + 128*32
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! 80-83 spill_0_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! 84-87 spill_1_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! 88-8B spill_2_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! 8C-8F spill_3_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! 90-93 spill_4_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! 94-97 spill_5_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! 98-9B spill_6_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! 9C-9F spill_7_normal
+
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! A0-A3 spill_0_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! A4-A7 spill_1_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! A8-AB spill_2_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! AC-AF spill_3_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! B0-B3 spill_4_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! B4-B7 spill_5_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! B8-BB spill_6_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! BC-BF spill_7_other
+
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! C0-C3 fill_0_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! C4-C7 fill_1_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! C8-CB fill_2_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! CC-CF fill_3_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! D0-D3 fill_4_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! D4-D7 fill_5_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! D8-DB fill_6_normal
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! DC-DF fill_7_normal
+
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! E0-E3 fill_0_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! E4-E7 fill_1_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! E8-EB fill_2_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! EC-EF fill_3_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! F0-F3 fill_4_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! F4-F7 fill_5_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! F8-FB fill_6_other
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;          ! FC-FF fill_7_other
+
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;                   ! 100-17F trap instruction
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;                                    
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+    BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;BAD_TRAP;
+*/
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/startup/bspgetworkarea.c:1.1
--- /dev/null	Thu Jun 17 12:13:08 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/startup/bspgetworkarea.c	Thu Jun 17 11:20:46 2010
@@ -0,0 +1,93 @@
+/*
+ *  This routine is an implementation of the bsp_get_work_area()
+ *  that can be used by all BSPs following linkcmds conventions
+ *  regarding heap, stack, and workspace allocation.
+ *
+ *  COPYRIGHT (c) 1989-2008.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <bsp.h>
+#include <bsp/bootcard.h>
+#ifdef BSP_GET_WORK_AREA_DEBUG
+  #include <rtems/bspIo.h>
+#endif
+
+/*
+ *  These are provided by the linkcmds for ALL of the BSPs which use this file.
+ */
+extern char WorkAreaBase[];
+extern char HeapSize[];
+extern char HeapBase[];
+
+
+/*
+ *  We may get the size information from U-Boot or the linker scripts.
+ */
+#ifdef HAS_UBOOT
+  extern bd_t bsp_uboot_board_info;
+#else
+  extern char RamBase[];
+  extern char RamSize[];
+#endif /* HAS_UBOOT */
+
+/*
+ *  This method returns the base address and size of the area which
+ *  is to be allocated between the RTEMS Workspace and the C Program
+ *  Heap.
+ */
+void bsp_get_work_area(
+  void      **work_area_start,
+  uintptr_t  *work_area_size,
+  void      **heap_start,
+  uintptr_t  *heap_size
+)
+{
+  uintptr_t ram_end;
+
+  #ifdef HAS_UBOOT
+    ram_end = (uintptr_t) bsp_uboot_board_info.bi_memstart +
+                          bsp_uboot_board_info.bi_memsize;
+  #else
+    ram_end = (uintptr_t)RamBase + (uintptr_t)RamSize;
+  #endif
+
+  *work_area_start = WorkAreaBase;
+  *work_area_size  = ram_end - (uintptr_t) WorkAreaBase;
+  *heap_start      = (void*) HeapBase;
+  *heap_size       = (uintptr_t) HeapSize;
+
+  /*
+   *  The following may be helpful in debugging what goes wrong when
+   *  you are allocating the Work Area in a new BSP.
+   */
+  #ifdef BSP_GET_WORK_AREA_DEBUG
+    {
+      void *sp = __builtin_frame_address(0);
+      void *end = *work_area_start + *work_area_size;
+      printk(
+		"bsp_get_work_area\n\r"
+        "work_area_start = 0x%p\n\r"
+        "work_area_size = %d 0x%08x\n\r"
+        "end = 0x%p\n\r"
+        "heap_start = 0x%p\n\r"
+        "heap_size = %d\n\r"
+        "current stack pointer = 0x%p%s\n\r",
+        *work_area_start,
+        *work_area_size,  /* decimal */
+        *work_area_size,  /* hexadecimal */
+        end,
+        *heap_start,
+        *heap_size,
+        sp,
+        ((sp >= *work_area_start && sp <= end) ? " OVERLAPS!" : "")
+     );
+  }
+ #endif
+}

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/startup/bspstart.c:1.1
--- /dev/null	Thu Jun 17 12:13:08 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/startup/bspstart.c	Thu Jun 17 11:20:46 2010
@@ -0,0 +1,33 @@
+/*
+ *  This routine starts the application.  It includes application,
+ *  board, and monitor specific initialization and configuration.
+ *  The generic CPU dependent initialization has been performed
+ *  before this routine is invoked.
+ *
+ *  COPYRIGHT (c) 1989-1999.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <string.h>
+
+#include <bsp.h>
+
+extern void sparc64_install_isr_entries(void);
+
+/*
+ *  bsp_start
+ *
+ *  This routine does the bulk of the system initialization.
+ */
+
+void bsp_start( void )
+{
+/*	bootstrap(); */
+	sparc64_install_isr_entries();
+}

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/startup/linkcmds:1.1
--- /dev/null	Thu Jun 17 12:13:08 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/startup/linkcmds	Thu Jun 17 11:20:46 2010
@@ -0,0 +1,211 @@
+/*  linkcmds
+ * 
+ *  $Id$
+ */
+
+/*
+ * For alignment, SPARC v9 specifies that instructions are 4-byte aligned, 
+ * and the worst-case alignment requirements for data are for quad-word 
+ * accesses, which must be 16-byte aligned.
+ */
+
+/*
+ * Declare some sizes.
+ */
+RamBase = DEFINED(RamBase) ? RamBase : 0x0;
+RamSize = DEFINED(RamSize) ? RamSize : 16M;
+HeapSize = DEFINED(HeapSize) ? HeapSize : 256k;
+StackSize = DEFINED(StackSize) ? StackSize : 256k;
+
+RAM_END = RamBase + RamSize;
+
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf64-sparc")
+ENTRY(start)
+
+MEMORY
+        {
+	        ram : ORIGIN = 0x0, LENGTH = 16M
+	}
+
+
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  .hash          : { *(.hash)		}
+  .dynsym        : { *(.dynsym)		}
+  .dynstr        : { *(.dynstr)		}
+  .gnu.version   : { *(.gnu.version)	}
+  .gnu.version_d   : { *(.gnu.version_d)	}
+  .gnu.version_r   : { *(.gnu.version_r)	}
+  .rel.init      : { *(.rel.init)		}
+  .rela.init     : { *(.rela.init)	}
+  .rel.text      :
+    {
+      *(.rel.text)
+      *(.rel.text.*)
+      *(.rel.gnu.linkonce.t*)
+    }
+  .rela.text     :
+    {
+      *(.rela.text)
+      *(.rela.text.*)
+      *(.rela.gnu.linkonce.t*)
+    }
+  .rel.fini      : { *(.rel.fini)		}
+  .rela.fini     : { *(.rela.fini)	}
+  .rel.rodata    :
+    {
+      *(.rel.rodata)
+      *(.rel.rodata.*)
+      *(.rel.gnu.linkonce.r*)
+    }
+  .rela.rodata   :
+    {
+      *(.rela.rodata)
+      *(.rela.rodata.*)
+      *(.rela.gnu.linkonce.r*)
+    }
+  .rel.data      :
+    {
+      *(.rel.data)
+      *(.rel.data.*)
+      *(.rel.gnu.linkonce.d*)
+    }
+  .rela.data     :
+    {
+      *(.rela.data)
+      *(.rela.data.*)
+      *(.rela.gnu.linkonce.d*)
+    }
+  .rel.ctors     : { *(.rel.ctors)	}
+  .rela.ctors    : { *(.rela.ctors)	}
+  .rel.dtors     : { *(.rel.dtors)	}
+  .rela.dtors    : { *(.rela.dtors)	}
+  .rel.got       : { *(.rel.got)		}
+  .rela.got      : { *(.rela.got)		}
+  .rel.bss       : { *(.rel.bss)		}
+  .rela.bss      : { *(.rela.bss)		}
+  .rel.plt       : { *(.rel.plt)		}
+  .rela.plt      : { *(.rela.plt)		}
+  /* Internal text space or external memory */
+  .text 0x4000 : AT (0x4000)
+  {
+    *(BOOTSTRAP);
+    *(.text*)
+
+    /*
+     * Special FreeBSD sysctl sections.
+     */
+    . = ALIGN (16);
+    __start_set_sysctl_set = .;
+    *(set_sysctl_*);
+    __stop_set_sysctl_set = ABSOLUTE(.);
+    *(set_domain_*);
+    *(set_pseudo_*);
+
+    *(.eh_frame)
+    . = ALIGN (16);
+
+    *(.gnu.linkonce.t*)
+
+    /*
+     * C++ constructors
+     */
+    /* gcc uses crtbegin.o to find the start of
+       the constructors, so we make sure it is
+       first.  Because this is a wildcard, it
+       doesn't matter if the user does not
+       actually link against crtbegin.o; the
+       linker won't look for a file to match a
+       wildcard.  The wildcard also means that it
+       doesn't matter which directory crtbegin.o
+       is in.  */
+    KEEP (*crtbegin.o(.ctors))
+    KEEP (*crtbegin?.o(.ctors))
+    /* We don't want to include the .ctor section from
+       the crtend.o file until after the sorted ctors.
+       The .ctor section from the crtend file contains the
+       end of ctors marker and it must be last */
+    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
+    KEEP (*(SORT(.ctors.*)))
+    KEEP (*(.ctors))
+    KEEP (*crtbegin.o(.dtors))
+    KEEP (*crtbegin?.o(.dtors))
+    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
+    KEEP (*(SORT(.dtors.*)))
+    KEEP (*(.dtors))
+
+    _rodata_start = . ;
+    *(.rodata*)
+    *(.gnu.linkonce.r*)
+    _erodata = ALIGN( 0x10 ) ;
+
+    etext = ALIGN(2);
+    _etext = . ;
+
+    *(.init)
+    PROVIDE (_fini = .);
+    KEEP (*(.fini))
+    *(.lit)
+    *(.shdata)
+
+     . = ALIGN (16);
+    _endtext = . ;
+  } > ram 
+  
+  .data	  : AT (ADDR (.text) + SIZEOF (.text))
+  {
+     PROVIDE (__data_start = .) ;
+    data_start = . ;
+    _data_start = . ;
+    *(.data)
+    *(.data*)
+    *(.rodata)  /* We need to include .rodata here if gcc is used */
+    *(.rodata*) /* with -fdata-sections.  */
+    *(.gnu.linkonce.d*)
+    . = ALIGN(2);
+    edata = . ;
+    _edata = . ;
+     PROVIDE (__data_end = .) ;
+  } > ram
+ 
+  /* XXX
+   __data_load_start = LOADADDR(.data);
+   __data_load_end = __data_load_start + SIZEOF(.data);
+  */
+   . = ALIGN (16);
+  .dynamic	  : { *(.dynamic) 	} >ram
+  .jcr        : { *(.jcr)     } > ram
+  .shbss      : { *(.shbss)  } > ram
+  .bss        :
+  {
+    FILL(0x00000000);
+    . = ALIGN(16);
+    __bss_start = ALIGN(0x8);
+    bss_start = .;
+    bss_start = .;
+    *(.bss .bss* .gnu.linkonce.b*)
+    *(COMMON)
+    . = ALIGN (16);
+    end = .;
+    _end = .;
+    __end = .;
+  
+    . = ALIGN (16); /* arbitrary alignment */
+    PROVIDE (WorkAreaBase = .);
+    . += HeapSize;
+    PROVIDE (HeapBase = .);
+    . += HeapSize;
+    . += StackSize;
+     PROVIDE (__stack = .);
+     PROVIDE (StackStart = .);
+  } > ram
+
+  /* made-up section for the trap-table, which has a very high alignment */
+  . = ALIGN(1024*32);
+  .ttable   : { *(.ttable) } > ram
+  
+}
+
+

diff -u /dev/null rtems/c/src/lib/libbsp/sparc64/shared/startup/setvec.c:1.1
--- /dev/null	Thu Jun 17 12:13:08 2010
+++ rtems/c/src/lib/libbsp/sparc64/shared/startup/setvec.c	Thu Jun 17 11:20:46 2010
@@ -0,0 +1,59 @@
+/*  set_vector
+ *
+ *  This routine installs an interrupt vector on the sun4v niagara
+ *
+ *  INPUT PARAMETERS:
+ *    handler - interrupt handler entry point
+ *    vector  - vector number
+ *    type    - 0 indicates raw hardware connect
+ *              1 indicates RTEMS interrupt connect
+ *
+ *  OUTPUT PARAMETERS:  NONE
+ *
+ *  RETURNS:
+ *    address of previous interrupt handler
+ *
+ *  COPYRIGHT (c) 1989-1998.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <bsp.h>
+
+rtems_isr_entry set_vector(                   /* returns old vector */
+  rtems_isr_entry     handler,                /* isr routine        */
+  rtems_vector_number vector,                 /* vector number      */
+  int                 type                    /* RTEMS or RAW intr  */
+)
+{
+  rtems_isr_entry previous_isr;
+  uint32_t      real_trap;
+  uint32_t      source;
+  int bit_mask;
+
+  if ( type )
+    rtems_interrupt_catch( handler, vector, &previous_isr );
+  else 
+    _CPU_ISR_install_raw_handler( vector, handler, (void *)&previous_isr );
+
+  real_trap = SPARC_REAL_TRAP_NUMBER( vector );
+
+  /* check if this is an interrupt, if so, clear and unmask interrupts for
+   * this level
+   */
+  /* Interrupts have real_trap numbers between 0x41 and 0x4F (levels 1 - 15) */
+  if (real_trap >= 0x41 && real_trap <= 0x4F) {
+    source = real_trap - 0x40;
+    bit_mask = 1<<source;
+
+    sparc64_clear_interrupt_bits(bit_mask);
+  }
+
+
+  return previous_isr;
+}


 *ralf*:
2010-06-17	Ralf Corsépius <ralf.corsepius at rtems.org>

	* Makefile.inc.in, bsp.cfg.in, configure.ac, target.cfg.in:
	Remove itron.
	* aclocal/check-itron.m4, aclocal/enable-itron.m4: Remove.

M   1.71  c/src/make/ChangeLog
M   1.12  c/src/make/Makefile.inc.in
R    1.4  c/src/make/aclocal/check-itron.m4
R    1.2  c/src/make/aclocal/enable-itron.m4
M    1.7  c/src/make/bsp.cfg.in
M   1.31  c/src/make/configure.ac
M    1.8  c/src/make/target.cfg.in

diff -u rtems/c/src/make/ChangeLog:1.70 rtems/c/src/make/ChangeLog:1.71
--- rtems/c/src/make/ChangeLog:1.70	Wed Oct 21 05:10:10 2009
+++ rtems/c/src/make/ChangeLog	Thu Jun 17 11:30:05 2010
@@ -1,3 +1,9 @@
+2010-06-17	Ralf Corsépius <ralf.corsepius at rtems.org>
+
+	* Makefile.inc.in, bsp.cfg.in, configure.ac, target.cfg.in:
+	Remove itron.
+	* aclocal/check-itron.m4, aclocal/enable-itron.m4: Remove.
+
 2009-10-21	Ralf Corsépius <ralf.corsepius at rtems.org>
 
 	* bsp.mak: Remove RTEMS_BSP_FAMILY.

diff -u rtems/c/src/make/Makefile.inc.in:1.11 rtems/c/src/make/Makefile.inc.in:1.12
--- rtems/c/src/make/Makefile.inc.in:1.11	Tue Sep 18 12:55:35 2007
+++ rtems/c/src/make/Makefile.inc.in	Thu Jun 17 11:30:05 2010
@@ -38,7 +38,7 @@
 PROJECT_ROOT = $(prefix)
 RTEMS_USE_OWN_PDIR = no
 RTEMS_HAS_POSIX_API = @RTEMS_HAS_POSIX_API@
-RTEMS_HAS_ITRON_API = @RTEMS_HAS_ITRON_API@
+RTEMS_HAS_ITRON_API = no
 RTEMS_HAS_CPLUSPLUS = @RTEMS_HAS_CPLUSPLUS@
 
 export RTEMS_BSP

diff -u rtems/c/src/make/bsp.cfg.in:1.6 rtems/c/src/make/bsp.cfg.in:1.7
--- rtems/c/src/make/bsp.cfg.in:1.6	Fri Oct 16 09:33:55 2009
+++ rtems/c/src/make/bsp.cfg.in	Thu Jun 17 11:30:05 2010
@@ -18,7 +18,7 @@
 ##
 ## Does this BSP support RTEMS's ITRON API ?
 ##
-HAS_ITRON_API = @HAS_ITRON_API@
+HAS_ITRON_API = no
 
 ##
 ## Does this BSP support RTEMS's CXX API ?

diff -u rtems/c/src/make/configure.ac:1.30 rtems/c/src/make/configure.ac:1.31
--- rtems/c/src/make/configure.ac:1.30	Sat Nov 28 00:28:41 2009
+++ rtems/c/src/make/configure.ac	Thu Jun 17 11:30:05 2010
@@ -19,7 +19,6 @@
 
 RTEMS_ENABLE_MULTIPROCESSING
 RTEMS_ENABLE_POSIX
-RTEMS_ENABLE_ITRON
 RTEMS_ENABLE_NETWORKING
 RTEMS_ENABLE_CXX
 
@@ -64,7 +63,6 @@
 RTEMS_CHECK_NETWORKING(RTEMS_BSP)
 RTEMS_CHECK_POSIX_API(RTEMS_BSP)
 RTEMS_CHECK_CXX(RTEMS_BSP)
-RTEMS_CHECK_ITRON_API(RTEMS_BSP)
 
 AC_SUBST(rtems_cv_prog_cc_cross)
 AC_SUBST(RTEMS_HAS_CPLUSPLUS)

diff -u rtems/c/src/make/target.cfg.in:1.7 rtems/c/src/make/target.cfg.in:1.8
--- rtems/c/src/make/target.cfg.in:1.7	Sat Aug  4 00:45:16 2007
+++ rtems/c/src/make/target.cfg.in	Thu Jun 17 11:30:05 2010
@@ -33,7 +33,7 @@
 
 RTEMS_HAS_MULTIPROCESSING = @RTEMS_HAS_MULTIPROCESSING@
 RTEMS_HAS_POSIX_API = @RTEMS_HAS_POSIX_API@
-RTEMS_HAS_ITRON_API = @RTEMS_HAS_ITRON_API@
+RTEMS_HAS_ITRON_API = no
 RTEMS_HAS_NETWORKING = @RTEMS_HAS_NETWORKING@
 RTEMS_HAS_RDBG = no
 RTEMS_HAS_CPLUSPLUS = @RTEMS_HAS_CPLUSPLUS@


 *ralf*:
newlib-1.18.0-rtems4.11-20100617.diff.

M   1.14  contrib/crossrpms/rtems4.11/arm/gcc-sources.add
M   1.14  contrib/crossrpms/rtems4.11/avr/gcc-sources.add
M   1.14  contrib/crossrpms/rtems4.11/bfin/gcc-sources.add
M   1.14  contrib/crossrpms/rtems4.11/h8300/gcc-sources.add
M   1.14  contrib/crossrpms/rtems4.11/i386/gcc-sources.add
M   1.14  contrib/crossrpms/rtems4.11/lm32/gcc-sources.add
M   1.14  contrib/crossrpms/rtems4.11/m32c/gcc-sources.add
M   1.14  contrib/crossrpms/rtems4.11/m32r/gcc-sources.add
M   1.14  contrib/crossrpms/rtems4.11/m68k/gcc-sources.add
M   1.14  contrib/crossrpms/rtems4.11/mips/gcc-sources.add
M   1.14  contrib/crossrpms/rtems4.11/powerpc/gcc-sources.add
M   1.14  contrib/crossrpms/rtems4.11/sh/gcc-sources.add
M   1.14  contrib/crossrpms/rtems4.11/sparc/gcc-sources.add
M    1.5  contrib/crossrpms/rtems4.11/sparc64/gcc-sources.add

diff -u rtems/contrib/crossrpms/rtems4.11/arm/gcc-sources.add:1.13 rtems/contrib/crossrpms/rtems4.11/arm/gcc-sources.add:1.14
--- rtems/contrib/crossrpms/rtems4.11/arm/gcc-sources.add:1.13	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/arm/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif

diff -u rtems/contrib/crossrpms/rtems4.11/avr/gcc-sources.add:1.13 rtems/contrib/crossrpms/rtems4.11/avr/gcc-sources.add:1.14
--- rtems/contrib/crossrpms/rtems4.11/avr/gcc-sources.add:1.13	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/avr/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif

diff -u rtems/contrib/crossrpms/rtems4.11/bfin/gcc-sources.add:1.13 rtems/contrib/crossrpms/rtems4.11/bfin/gcc-sources.add:1.14
--- rtems/contrib/crossrpms/rtems4.11/bfin/gcc-sources.add:1.13	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/bfin/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif

diff -u rtems/contrib/crossrpms/rtems4.11/h8300/gcc-sources.add:1.13 rtems/contrib/crossrpms/rtems4.11/h8300/gcc-sources.add:1.14
--- rtems/contrib/crossrpms/rtems4.11/h8300/gcc-sources.add:1.13	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/h8300/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif

diff -u rtems/contrib/crossrpms/rtems4.11/i386/gcc-sources.add:1.13 rtems/contrib/crossrpms/rtems4.11/i386/gcc-sources.add:1.14
--- rtems/contrib/crossrpms/rtems4.11/i386/gcc-sources.add:1.13	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/i386/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif

diff -u rtems/contrib/crossrpms/rtems4.11/lm32/gcc-sources.add:1.13 rtems/contrib/crossrpms/rtems4.11/lm32/gcc-sources.add:1.14
--- rtems/contrib/crossrpms/rtems4.11/lm32/gcc-sources.add:1.13	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/lm32/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif

diff -u rtems/contrib/crossrpms/rtems4.11/m32c/gcc-sources.add:1.13 rtems/contrib/crossrpms/rtems4.11/m32c/gcc-sources.add:1.14
--- rtems/contrib/crossrpms/rtems4.11/m32c/gcc-sources.add:1.13	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/m32c/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif

diff -u rtems/contrib/crossrpms/rtems4.11/m32r/gcc-sources.add:1.13 rtems/contrib/crossrpms/rtems4.11/m32r/gcc-sources.add:1.14
--- rtems/contrib/crossrpms/rtems4.11/m32r/gcc-sources.add:1.13	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/m32r/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif

diff -u rtems/contrib/crossrpms/rtems4.11/m68k/gcc-sources.add:1.13 rtems/contrib/crossrpms/rtems4.11/m68k/gcc-sources.add:1.14
--- rtems/contrib/crossrpms/rtems4.11/m68k/gcc-sources.add:1.13	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/m68k/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif

diff -u rtems/contrib/crossrpms/rtems4.11/mips/gcc-sources.add:1.13 rtems/contrib/crossrpms/rtems4.11/mips/gcc-sources.add:1.14
--- rtems/contrib/crossrpms/rtems4.11/mips/gcc-sources.add:1.13	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/mips/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif

diff -u rtems/contrib/crossrpms/rtems4.11/powerpc/gcc-sources.add:1.13 rtems/contrib/crossrpms/rtems4.11/powerpc/gcc-sources.add:1.14
--- rtems/contrib/crossrpms/rtems4.11/powerpc/gcc-sources.add:1.13	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/powerpc/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif

diff -u rtems/contrib/crossrpms/rtems4.11/sh/gcc-sources.add:1.13 rtems/contrib/crossrpms/rtems4.11/sh/gcc-sources.add:1.14
--- rtems/contrib/crossrpms/rtems4.11/sh/gcc-sources.add:1.13	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/sh/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif

diff -u rtems/contrib/crossrpms/rtems4.11/sparc/gcc-sources.add:1.13 rtems/contrib/crossrpms/rtems4.11/sparc/gcc-sources.add:1.14
--- rtems/contrib/crossrpms/rtems4.11/sparc/gcc-sources.add:1.13	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/sparc/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif

diff -u rtems/contrib/crossrpms/rtems4.11/sparc64/gcc-sources.add:1.4 rtems/contrib/crossrpms/rtems4.11/sparc64/gcc-sources.add:1.5
--- rtems/contrib/crossrpms/rtems4.11/sparc64/gcc-sources.add:1.4	Wed Jun  9 02:29:33 2010
+++ rtems/contrib/crossrpms/rtems4.11/sparc64/gcc-sources.add	Thu Jun 17 11:32:18 2010
@@ -34,7 +34,7 @@
 %if %build_newlib
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 %endif


 *ralf*:
GCC_RPMREL = 14.

M   1.16  contrib/crossrpms/rtems4.11/arm/Makefile.am
M   1.17  contrib/crossrpms/rtems4.11/avr/Makefile.am
M   1.17  contrib/crossrpms/rtems4.11/bfin/Makefile.am
M   1.18  contrib/crossrpms/rtems4.11/h8300/Makefile.am
M   1.18  contrib/crossrpms/rtems4.11/i386/Makefile.am
M   1.19  contrib/crossrpms/rtems4.11/lm32/Makefile.am
M   1.19  contrib/crossrpms/rtems4.11/m32c/Makefile.am
M   1.16  contrib/crossrpms/rtems4.11/m32r/Makefile.am
M   1.18  contrib/crossrpms/rtems4.11/m68k/Makefile.am
M   1.18  contrib/crossrpms/rtems4.11/mips/Makefile.am
M   1.19  contrib/crossrpms/rtems4.11/powerpc/Makefile.am
M   1.18  contrib/crossrpms/rtems4.11/sh/Makefile.am
M   1.20  contrib/crossrpms/rtems4.11/sparc/Makefile.am
M    1.7  contrib/crossrpms/rtems4.11/sparc64/Makefile.am

diff -u rtems/contrib/crossrpms/rtems4.11/arm/Makefile.am:1.15 rtems/contrib/crossrpms/rtems4.11/arm/Makefile.am:1.16
--- rtems/contrib/crossrpms/rtems4.11/arm/Makefile.am:1.15	Wed Jun  9 01:59:05 2010
+++ rtems/contrib/crossrpms/rtems4.11/arm/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)

diff -u rtems/contrib/crossrpms/rtems4.11/avr/Makefile.am:1.16 rtems/contrib/crossrpms/rtems4.11/avr/Makefile.am:1.17
--- rtems/contrib/crossrpms/rtems4.11/avr/Makefile.am:1.16	Wed Jun  9 01:59:05 2010
+++ rtems/contrib/crossrpms/rtems4.11/avr/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)
 NEWLIB_RPMREL = `expr $(GCC_RPMREL)`

diff -u rtems/contrib/crossrpms/rtems4.11/bfin/Makefile.am:1.16 rtems/contrib/crossrpms/rtems4.11/bfin/Makefile.am:1.17
--- rtems/contrib/crossrpms/rtems4.11/bfin/Makefile.am:1.16	Wed Jun  9 01:39:28 2010
+++ rtems/contrib/crossrpms/rtems4.11/bfin/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)
 NEWLIB_RPMREL = `expr $(GCC_RPMREL)`

diff -u rtems/contrib/crossrpms/rtems4.11/h8300/Makefile.am:1.17 rtems/contrib/crossrpms/rtems4.11/h8300/Makefile.am:1.18
--- rtems/contrib/crossrpms/rtems4.11/h8300/Makefile.am:1.17	Wed Jun  9 01:59:05 2010
+++ rtems/contrib/crossrpms/rtems4.11/h8300/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)
 NEWLIB_RPMREL = `expr $(GCC_RPMREL)`

diff -u rtems/contrib/crossrpms/rtems4.11/i386/Makefile.am:1.17 rtems/contrib/crossrpms/rtems4.11/i386/Makefile.am:1.18
--- rtems/contrib/crossrpms/rtems4.11/i386/Makefile.am:1.17	Wed Jun  9 01:59:05 2010
+++ rtems/contrib/crossrpms/rtems4.11/i386/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)
 NEWLIB_RPMREL = `expr $(GCC_RPMREL)`

diff -u rtems/contrib/crossrpms/rtems4.11/lm32/Makefile.am:1.18 rtems/contrib/crossrpms/rtems4.11/lm32/Makefile.am:1.19
--- rtems/contrib/crossrpms/rtems4.11/lm32/Makefile.am:1.18	Wed Jun  9 01:59:05 2010
+++ rtems/contrib/crossrpms/rtems4.11/lm32/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)
 NEWLIB_RPMREL = `expr $(GCC_RPMREL)`

diff -u rtems/contrib/crossrpms/rtems4.11/m32c/Makefile.am:1.18 rtems/contrib/crossrpms/rtems4.11/m32c/Makefile.am:1.19
--- rtems/contrib/crossrpms/rtems4.11/m32c/Makefile.am:1.18	Wed Jun  9 01:59:05 2010
+++ rtems/contrib/crossrpms/rtems4.11/m32c/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)
 NEWLIB_RPMREL = `expr $(GCC_RPMREL)`

diff -u rtems/contrib/crossrpms/rtems4.11/m32r/Makefile.am:1.15 rtems/contrib/crossrpms/rtems4.11/m32r/Makefile.am:1.16
--- rtems/contrib/crossrpms/rtems4.11/m32r/Makefile.am:1.15	Wed Jun  9 01:59:05 2010
+++ rtems/contrib/crossrpms/rtems4.11/m32r/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)
 NEWLIB_RPMREL = `expr $(GCC_RPMREL)`

diff -u rtems/contrib/crossrpms/rtems4.11/m68k/Makefile.am:1.17 rtems/contrib/crossrpms/rtems4.11/m68k/Makefile.am:1.18
--- rtems/contrib/crossrpms/rtems4.11/m68k/Makefile.am:1.17	Wed Jun  9 01:59:05 2010
+++ rtems/contrib/crossrpms/rtems4.11/m68k/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)
 NEWLIB_RPMREL = `expr $(GCC_RPMREL)`

diff -u rtems/contrib/crossrpms/rtems4.11/mips/Makefile.am:1.17 rtems/contrib/crossrpms/rtems4.11/mips/Makefile.am:1.18
--- rtems/contrib/crossrpms/rtems4.11/mips/Makefile.am:1.17	Wed Jun  9 01:59:05 2010
+++ rtems/contrib/crossrpms/rtems4.11/mips/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)
 NEWLIB_RPMREL = `expr $(GCC_RPMREL)`

diff -u rtems/contrib/crossrpms/rtems4.11/powerpc/Makefile.am:1.18 rtems/contrib/crossrpms/rtems4.11/powerpc/Makefile.am:1.19
--- rtems/contrib/crossrpms/rtems4.11/powerpc/Makefile.am:1.18	Wed Jun  9 01:59:05 2010
+++ rtems/contrib/crossrpms/rtems4.11/powerpc/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)
 NEWLIB_RPMREL = `expr $(GCC_RPMREL)`

diff -u rtems/contrib/crossrpms/rtems4.11/sh/Makefile.am:1.17 rtems/contrib/crossrpms/rtems4.11/sh/Makefile.am:1.18
--- rtems/contrib/crossrpms/rtems4.11/sh/Makefile.am:1.17	Wed Jun  9 01:59:05 2010
+++ rtems/contrib/crossrpms/rtems4.11/sh/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)
 NEWLIB_RPMREL = `expr $(GCC_RPMREL)`

diff -u rtems/contrib/crossrpms/rtems4.11/sparc/Makefile.am:1.19 rtems/contrib/crossrpms/rtems4.11/sparc/Makefile.am:1.20
--- rtems/contrib/crossrpms/rtems4.11/sparc/Makefile.am:1.19	Wed Jun  9 01:59:05 2010
+++ rtems/contrib/crossrpms/rtems4.11/sparc/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)
 NEWLIB_RPMREL = `expr $(GCC_RPMREL)`

diff -u rtems/contrib/crossrpms/rtems4.11/sparc64/Makefile.am:1.6 rtems/contrib/crossrpms/rtems4.11/sparc64/Makefile.am:1.7
--- rtems/contrib/crossrpms/rtems4.11/sparc64/Makefile.am:1.6	Wed Jun  9 01:59:05 2010
+++ rtems/contrib/crossrpms/rtems4.11/sparc64/Makefile.am	Thu Jun 17 11:33:51 2010
@@ -13,7 +13,7 @@
 
 GCC_VERS = 4.5.0
 GCC_PKGVERS = $(GCC_VERS)
-GCC_RPMREL = 13
+GCC_RPMREL = 14
 NEWLIB_VERS = 1.18.0
 NEWLIB_PKGVERS = $(NEWLIB_VERS)
 NEWLIB_RPMREL = `expr $(GCC_RPMREL)`


 *ralf*:
Regenerate.

M   1.21  contrib/crossrpms/rtems4.11/arm/rtems-4.11-arm-rtems4.11-gcc.spec
M   1.22  contrib/crossrpms/rtems4.11/avr/rtems-4.11-avr-rtems4.11-gcc.spec
M   1.23  contrib/crossrpms/rtems4.11/bfin/rtems-4.11-bfin-rtems4.11-gcc.spec
M   1.22  contrib/crossrpms/rtems4.11/h8300/rtems-4.11-h8300-rtems4.11-gcc.spec
M   1.22  contrib/crossrpms/rtems4.11/i386/rtems-4.11-i386-rtems4.11-gcc.spec
M   1.22  contrib/crossrpms/rtems4.11/lm32/rtems-4.11-lm32-rtems4.11-gcc.spec
M   1.22  contrib/crossrpms/rtems4.11/m32c/rtems-4.11-m32c-rtems4.11-gcc.spec
M   1.21  contrib/crossrpms/rtems4.11/m32r/rtems-4.11-m32r-rtems4.11-gcc.spec
M   1.22  contrib/crossrpms/rtems4.11/m68k/rtems-4.11-m68k-rtems4.11-gcc.spec
M   1.22  contrib/crossrpms/rtems4.11/mips/rtems-4.11-mips-rtems4.11-gcc.spec
M   1.22  contrib/crossrpms/rtems4.11/powerpc/rtems-4.11-powerpc-rtems4.11-gcc.spec
M   1.22  contrib/crossrpms/rtems4.11/sh/rtems-4.11-sh-rtems4.11-gcc.spec
M   1.24  contrib/crossrpms/rtems4.11/sparc/rtems-4.11-sparc-rtems4.11-gcc.spec
M    1.6  contrib/crossrpms/rtems4.11/sparc64/rtems-4.11-sparc64-rtems4.11-gcc.spec

diff -u rtems/contrib/crossrpms/rtems4.11/arm/rtems-4.11-arm-rtems4.11-gcc.spec:1.20 rtems/contrib/crossrpms/rtems4.11/arm/rtems-4.11-arm-rtems4.11-gcc.spec:1.21
--- rtems/contrib/crossrpms/rtems4.11/arm/rtems-4.11-arm-rtems4.11-gcc.spec:1.20	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/arm/rtems-4.11-arm-rtems4.11-gcc.spec	Thu Jun 17 11:35:27 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-arm-rtems4.11-binutils
 Requires:	rtems-4.11-arm-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-arm-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-arm-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -265,7 +265,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -340,7 +340,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -610,7 +610,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-arm-rtems4.11-binutils
-# Requires:       rtems-4.11-arm-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-arm-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -628,7 +628,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-arm-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-arm-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-arm-rtems4.11-gcc-libgcc
@@ -802,7 +802,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -823,7 +823,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 

diff -u rtems/contrib/crossrpms/rtems4.11/avr/rtems-4.11-avr-rtems4.11-gcc.spec:1.21 rtems/contrib/crossrpms/rtems4.11/avr/rtems-4.11-avr-rtems4.11-gcc.spec:1.22
--- rtems/contrib/crossrpms/rtems4.11/avr/rtems-4.11-avr-rtems4.11-gcc.spec:1.21	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/avr/rtems-4.11-avr-rtems4.11-gcc.spec	Thu Jun 17 11:35:28 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-avr-rtems4.11-binutils
 Requires:	rtems-4.11-avr-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-avr-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-avr-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -260,7 +260,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -331,7 +331,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -600,7 +600,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-avr-rtems4.11-binutils
-# Requires:       rtems-4.11-avr-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-avr-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -618,7 +618,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-avr-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-avr-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-avr-rtems4.11-gcc-libgcc
@@ -731,7 +731,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -752,7 +752,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 

diff -u rtems/contrib/crossrpms/rtems4.11/bfin/rtems-4.11-bfin-rtems4.11-gcc.spec:1.22 rtems/contrib/crossrpms/rtems4.11/bfin/rtems-4.11-bfin-rtems4.11-gcc.spec:1.23
--- rtems/contrib/crossrpms/rtems4.11/bfin/rtems-4.11-bfin-rtems4.11-gcc.spec:1.22	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/bfin/rtems-4.11-bfin-rtems4.11-gcc.spec	Thu Jun 17 11:35:28 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-bfin-rtems4.11-binutils
 Requires:	rtems-4.11-bfin-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-bfin-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-bfin-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -265,7 +265,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -340,7 +340,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -610,7 +610,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-bfin-rtems4.11-binutils
-# Requires:       rtems-4.11-bfin-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-bfin-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -628,7 +628,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-bfin-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-bfin-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-bfin-rtems4.11-gcc-libgcc
@@ -802,7 +802,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -823,7 +823,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 

diff -u rtems/contrib/crossrpms/rtems4.11/h8300/rtems-4.11-h8300-rtems4.11-gcc.spec:1.21 rtems/contrib/crossrpms/rtems4.11/h8300/rtems-4.11-h8300-rtems4.11-gcc.spec:1.22
--- rtems/contrib/crossrpms/rtems4.11/h8300/rtems-4.11-h8300-rtems4.11-gcc.spec:1.21	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/h8300/rtems-4.11-h8300-rtems4.11-gcc.spec	Thu Jun 17 11:35:28 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-h8300-rtems4.11-binutils
 Requires:	rtems-4.11-h8300-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-h8300-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-h8300-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -265,7 +265,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -340,7 +340,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -610,7 +610,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-h8300-rtems4.11-binutils
-# Requires:       rtems-4.11-h8300-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-h8300-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -628,7 +628,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-h8300-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-h8300-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-h8300-rtems4.11-gcc-libgcc
@@ -802,7 +802,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -823,7 +823,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 

diff -u rtems/contrib/crossrpms/rtems4.11/i386/rtems-4.11-i386-rtems4.11-gcc.spec:1.21 rtems/contrib/crossrpms/rtems4.11/i386/rtems-4.11-i386-rtems4.11-gcc.spec:1.22
--- rtems/contrib/crossrpms/rtems4.11/i386/rtems-4.11-i386-rtems4.11-gcc.spec:1.21	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/i386/rtems-4.11-i386-rtems4.11-gcc.spec	Thu Jun 17 11:35:28 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-i386-rtems4.11-binutils
 Requires:	rtems-4.11-i386-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-i386-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-i386-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -265,7 +265,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -340,7 +340,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -610,7 +610,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-i386-rtems4.11-binutils
-# Requires:       rtems-4.11-i386-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-i386-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -628,7 +628,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-i386-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-i386-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-i386-rtems4.11-gcc-libgcc
@@ -802,7 +802,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -823,7 +823,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 

diff -u rtems/contrib/crossrpms/rtems4.11/lm32/rtems-4.11-lm32-rtems4.11-gcc.spec:1.21 rtems/contrib/crossrpms/rtems4.11/lm32/rtems-4.11-lm32-rtems4.11-gcc.spec:1.22
--- rtems/contrib/crossrpms/rtems4.11/lm32/rtems-4.11-lm32-rtems4.11-gcc.spec:1.21	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/lm32/rtems-4.11-lm32-rtems4.11-gcc.spec	Thu Jun 17 11:35:29 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-lm32-rtems4.11-binutils
 Requires:	rtems-4.11-lm32-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-lm32-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-lm32-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -265,7 +265,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -340,7 +340,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -610,7 +610,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-lm32-rtems4.11-binutils
-# Requires:       rtems-4.11-lm32-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-lm32-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -628,7 +628,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-lm32-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-lm32-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-lm32-rtems4.11-gcc-libgcc
@@ -802,7 +802,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -823,7 +823,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 

diff -u rtems/contrib/crossrpms/rtems4.11/m32c/rtems-4.11-m32c-rtems4.11-gcc.spec:1.21 rtems/contrib/crossrpms/rtems4.11/m32c/rtems-4.11-m32c-rtems4.11-gcc.spec:1.22
--- rtems/contrib/crossrpms/rtems4.11/m32c/rtems-4.11-m32c-rtems4.11-gcc.spec:1.21	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/m32c/rtems-4.11-m32c-rtems4.11-gcc.spec	Thu Jun 17 11:35:29 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-m32c-rtems4.11-binutils
 Requires:	rtems-4.11-m32c-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-m32c-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-m32c-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -260,7 +260,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -331,7 +331,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -600,7 +600,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-m32c-rtems4.11-binutils
-# Requires:       rtems-4.11-m32c-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-m32c-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -618,7 +618,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-m32c-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-m32c-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-m32c-rtems4.11-gcc-libgcc
@@ -732,7 +732,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -753,7 +753,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 

diff -u rtems/contrib/crossrpms/rtems4.11/m32r/rtems-4.11-m32r-rtems4.11-gcc.spec:1.20 rtems/contrib/crossrpms/rtems4.11/m32r/rtems-4.11-m32r-rtems4.11-gcc.spec:1.21
--- rtems/contrib/crossrpms/rtems4.11/m32r/rtems-4.11-m32r-rtems4.11-gcc.spec:1.20	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/m32r/rtems-4.11-m32r-rtems4.11-gcc.spec	Thu Jun 17 11:35:29 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-m32r-rtems4.11-binutils
 Requires:	rtems-4.11-m32r-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-m32r-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-m32r-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -260,7 +260,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -331,7 +331,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -600,7 +600,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-m32r-rtems4.11-binutils
-# Requires:       rtems-4.11-m32r-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-m32r-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -618,7 +618,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-m32r-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-m32r-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-m32r-rtems4.11-gcc-libgcc
@@ -732,7 +732,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -753,7 +753,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 

diff -u rtems/contrib/crossrpms/rtems4.11/m68k/rtems-4.11-m68k-rtems4.11-gcc.spec:1.21 rtems/contrib/crossrpms/rtems4.11/m68k/rtems-4.11-m68k-rtems4.11-gcc.spec:1.22
--- rtems/contrib/crossrpms/rtems4.11/m68k/rtems-4.11-m68k-rtems4.11-gcc.spec:1.21	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/m68k/rtems-4.11-m68k-rtems4.11-gcc.spec	Thu Jun 17 11:35:29 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-m68k-rtems4.11-binutils
 Requires:	rtems-4.11-m68k-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-m68k-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-m68k-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -265,7 +265,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -340,7 +340,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -610,7 +610,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-m68k-rtems4.11-binutils
-# Requires:       rtems-4.11-m68k-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-m68k-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -628,7 +628,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-m68k-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-m68k-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-m68k-rtems4.11-gcc-libgcc
@@ -802,7 +802,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -823,7 +823,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 

diff -u rtems/contrib/crossrpms/rtems4.11/mips/rtems-4.11-mips-rtems4.11-gcc.spec:1.21 rtems/contrib/crossrpms/rtems4.11/mips/rtems-4.11-mips-rtems4.11-gcc.spec:1.22
--- rtems/contrib/crossrpms/rtems4.11/mips/rtems-4.11-mips-rtems4.11-gcc.spec:1.21	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/mips/rtems-4.11-mips-rtems4.11-gcc.spec	Thu Jun 17 11:35:29 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-mips-rtems4.11-binutils
 Requires:	rtems-4.11-mips-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-mips-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-mips-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -265,7 +265,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -340,7 +340,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -610,7 +610,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-mips-rtems4.11-binutils
-# Requires:       rtems-4.11-mips-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-mips-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -628,7 +628,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-mips-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-mips-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-mips-rtems4.11-gcc-libgcc
@@ -802,7 +802,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -823,7 +823,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 

diff -u rtems/contrib/crossrpms/rtems4.11/powerpc/rtems-4.11-powerpc-rtems4.11-gcc.spec:1.21 rtems/contrib/crossrpms/rtems4.11/powerpc/rtems-4.11-powerpc-rtems4.11-gcc.spec:1.22
--- rtems/contrib/crossrpms/rtems4.11/powerpc/rtems-4.11-powerpc-rtems4.11-gcc.spec:1.21	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/powerpc/rtems-4.11-powerpc-rtems4.11-gcc.spec	Thu Jun 17 11:35:29 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-powerpc-rtems4.11-binutils
 Requires:	rtems-4.11-powerpc-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-powerpc-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-powerpc-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -265,7 +265,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -340,7 +340,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -610,7 +610,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-powerpc-rtems4.11-binutils
-# Requires:       rtems-4.11-powerpc-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-powerpc-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -628,7 +628,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-powerpc-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-powerpc-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-powerpc-rtems4.11-gcc-libgcc
@@ -802,7 +802,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -823,7 +823,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 

diff -u rtems/contrib/crossrpms/rtems4.11/sh/rtems-4.11-sh-rtems4.11-gcc.spec:1.21 rtems/contrib/crossrpms/rtems4.11/sh/rtems-4.11-sh-rtems4.11-gcc.spec:1.22
--- rtems/contrib/crossrpms/rtems4.11/sh/rtems-4.11-sh-rtems4.11-gcc.spec:1.21	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/sh/rtems-4.11-sh-rtems4.11-gcc.spec	Thu Jun 17 11:35:29 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-sh-rtems4.11-binutils
 Requires:	rtems-4.11-sh-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-sh-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-sh-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -265,7 +265,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -340,7 +340,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -610,7 +610,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-sh-rtems4.11-binutils
-# Requires:       rtems-4.11-sh-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-sh-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -628,7 +628,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-sh-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-sh-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-sh-rtems4.11-gcc-libgcc
@@ -802,7 +802,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -823,7 +823,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 

diff -u rtems/contrib/crossrpms/rtems4.11/sparc/rtems-4.11-sparc-rtems4.11-gcc.spec:1.23 rtems/contrib/crossrpms/rtems4.11/sparc/rtems-4.11-sparc-rtems4.11-gcc.spec:1.24
--- rtems/contrib/crossrpms/rtems4.11/sparc/rtems-4.11-sparc-rtems4.11-gcc.spec:1.23	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/sparc/rtems-4.11-sparc-rtems4.11-gcc.spec	Thu Jun 17 11:35:29 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-sparc-rtems4.11-binutils
 Requires:	rtems-4.11-sparc-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-sparc-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-sparc-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -265,7 +265,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -340,7 +340,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -610,7 +610,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-sparc-rtems4.11-binutils
-# Requires:       rtems-4.11-sparc-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-sparc-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -628,7 +628,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-sparc-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-sparc-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-sparc-rtems4.11-gcc-libgcc
@@ -802,7 +802,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -823,7 +823,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 

diff -u rtems/contrib/crossrpms/rtems4.11/sparc64/rtems-4.11-sparc64-rtems4.11-gcc.spec:1.5 rtems/contrib/crossrpms/rtems4.11/sparc64/rtems-4.11-sparc64-rtems4.11-gcc.spec:1.6
--- rtems/contrib/crossrpms/rtems4.11/sparc64/rtems-4.11-sparc64-rtems4.11-gcc.spec:1.5	Wed Jun  9 02:29:42 2010
+++ rtems/contrib/crossrpms/rtems4.11/sparc64/rtems-4.11-sparc64-rtems4.11-gcc.spec	Thu Jun 17 11:35:29 2010
@@ -58,7 +58,7 @@
 
 Group:	      	Development/Tools
 Version:        %{gcc_rpmvers}
-Release:      	13%{?dist}
+Release:      	14%{?dist}
 License:      	GPL
 URL:		http://gcc.gnu.org
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -240,7 +240,7 @@
 Requires:	rtems-4.11-gcc-common
 Requires:	rtems-4.11-sparc64-rtems4.11-binutils
 Requires:	rtems-4.11-sparc64-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
-Requires:	rtems-4.11-sparc64-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:	rtems-4.11-sparc64-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 
 %if "%{gcc_version}" >= "4.5.0"
 BuildRequires:  zlib-devel
@@ -265,7 +265,7 @@
 
 %if "%{newlib_version}" == "1.18.0"
 Source50:	ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
-Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100423.diff
+Patch50:	ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.11-20100617.diff
 %endif
 %{?_without_sources:NoSource:	50}
 
@@ -340,7 +340,7 @@
   ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
 %endif
 
-echo "RTEMS gcc-%{gcc_version}-13%{?dist}/newlib-%{newlib_version}-13%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
+echo "RTEMS gcc-%{gcc_version}-14%{?dist}/newlib-%{newlib_version}-14%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
 
 
   # Fix timestamps
@@ -610,7 +610,7 @@
 # Group:          Development/Tools
 # Version:        %{gcc_rpmvers}
 # Requires:       rtems-4.11-sparc64-rtems4.11-binutils
-# Requires:       rtems-4.11-sparc64-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+# Requires:       rtems-4.11-sparc64-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 # License:	GPL
 
 # %if %build_infos
@@ -628,7 +628,7 @@
 Group:          Development/Tools
 Version:        %{gcc_rpmvers}
 %{?_with_noarch_subpackages:BuildArch: noarch}
-Requires:       rtems-4.11-sparc64-rtems4.11-newlib = %{newlib_version}-13%{?dist}
+Requires:       rtems-4.11-sparc64-rtems4.11-newlib = %{newlib_version}-14%{?dist}
 License:	GPL
 
 %description -n rtems-4.11-sparc64-rtems4.11-gcc-libgcc
@@ -802,7 +802,7 @@
 Group: 		Development/Tools
 License:	Distributable
 Version:	%{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 
 Requires:	rtems-4.11-newlib-common
@@ -823,7 +823,7 @@
 Summary:	Base package for RTEMS newlib C Library
 Group:          Development/Tools
 Version:        %{newlib_version}
-Release:        13%{?dist}
+Release:        14%{?dist}
 %{?_with_noarch_subpackages:BuildArch: noarch}
 License:	Distributable
 


 *ralf*:
New.

A    1.1  contrib/crossrpms/patches/newlib-1.18.0-rtems4.11-20100617.diff

diff -u /dev/null rtems/contrib/crossrpms/patches/newlib-1.18.0-rtems4.11-20100617.diff:1.1
--- /dev/null	Thu Jun 17 12:13:14 2010
+++ rtems/contrib/crossrpms/patches/newlib-1.18.0-rtems4.11-20100617.diff	Thu Jun 17 11:36:00 2010
@@ -0,0 +1,1252 @@
+diff -Naur newlib-1.18.0.orig/newlib/ChangeLog.rtems newlib-1.18.0/newlib/ChangeLog.rtems
+--- newlib-1.18.0.orig/newlib/ChangeLog.rtems	1970-01-01 01:00:00.000000000 +0100
++++ newlib-1.18.0/newlib/ChangeLog.rtems	2010-06-17 16:44:57.000000000 +0200
+@@ -0,0 +1,206 @@
++2010-06-17	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/sys/rtems/machine/_types.h: Special case for sparc64.
++
++2010-04-23	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/sys/rtems/machine/_types.h: Add _mode_t.
++	* libc/include/sys/types.h: Derive mode_t from  _mode_t.
++
++2010-04-02	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/include/sched.h, libc/include/sys/sched.h:
++	Adopt newlib-cvs's versions.
++
++2010-03-25	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/include/strings.h: New (split-out from string.h).
++	* libc/include/string.h: Remove bcmp, bcopy, bzero, ffs, index, rindex,
++	strcasecmp, strncasecmp (Moved to strings.h).
++	Remove strcmpi, stricmp, strncmpi, strnicmp.
++	* libc/misc/ffs.c: Use <strings.h> instead of <string.h>.
++	* libc/string/bcmp.c: Use <strings.h> instead of <string.h>.
++	* libc/string/bzero.c: Use <strings.h> instead of <string.h>.
++	* libc/string/rindex.c: Use <strings.h> instead of <string.h>.
++	* libc/string/strcasecmp.c: Use <strings.h> instead of <string.h>.
++	* libc/string/strcasecmp.c: Use <strings.h> instead of <string.h>.
++
++2010-03-23	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/sys/rtems/machine/_types.h: Add i386 to 64bit off_t targets.
++
++2010-03-10	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/posix/telldir.c: Adopt newlib-cvs's telldir.c
++
++2010-02-10	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/sys/rtems/machine/_types.h: Use __int64_t for _off_t, fpos_t for 
++	selected targets.
++
++2010-02-05	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/posix/telldir.c: Remove bogus nested prototype of lseek().
++
++2010-01-11  Sebastian Huber <sebastian.huber at embedded-brains.de>
++
++	* libc/posix/telldir.c (_cleanupdir): Fixed usage of freed memory.
++
++2009-12-18	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/search/db_local.h:
++	Use __uint32_t instead of u_int (prototype mismatches).
++	* libc/search/extern.h (__buf_init): 
++	Use __uint32_t instead of int (16 bit target portability).
++	* libc/search/hash_buf.c: Use ptrdiff_t instead of __uint32_t,
++	use __uint32_t instead of int (16 bit target portability).
++	* libc/search/hash.h: Use __uint32_it instead of int
++	(16 bit target portability).
++	* libm/common/modfl.c: Add cast to (double*) to avoid GCC warning.
++	* libm/common/sf_llrint.c, libm/common/sf_round.c: Add explicit 
++	casts to __uint32_t to avoid overflows on implicit casts.
++
++2009-12-18	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	Merger with newlib-1.18.0.
++
++2009-10-29	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/sys/rtems/machine/_types.h: Rework.
++	* libc/sys/rtems/machine/stdint.h: Remove.
++	* libc/include/inttypes.h: 
++	Rework logic to determine PRI*PTR.
++	Prefer long64 over longlong64.
++	* libc/include/machine/_default_types.h: 
++	Sync logic for __int32 with stdint.h (Prefer long over int).
++	* libc/include/stdint.h:
++	Remove __SPU__ hack.
++	Prefer int for int16_t (sync with _default_types.h).
++	Rework intptr_t determination.
++
++2009-10-28	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/sys/rtems/machine/_types.h: New.
++	Add custom time for _ssize_t.
++	* libc/stdlib/assert.c: Sync with newlib-CVS.
++	* configure.host: Add -DHAVE_ASSERT_FUNC to newlib_cflags.
++
++2009-10-27	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/include/sys/pthread.h: 
++	Add pthread_atfork (Mandated by IEEE Std 1003.1-2008).
++	Add pthread_rwlock_unlock (Formerly missing)
++
++2009-10-26	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/include/sys/signal.h: Sync with newlib-CVS.
++
++2009-10-09	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/include/sys/signal.h: Use pid_t as 1st arg to kill()
++	(mandated by POSIX).
++
++2009-09-22	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/sys/rtems/sys/queue.h: Update copyright (from FreeBSD).
++	Remove CIRCLEQ_*.
++	* libc/search/hcreate.c: Don't include sys/queue.h.
++
++2009-09-18  Christopher Faylor  <me+cygwin at cgf.cx>
++
++	* libc/include/sys/unistd.h: Declare getpagesize as returning
++	POSIX-mandated int.
++
++2009-09-16	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/sys/rtems/crt0.c: Use while(1) in _exit stub to silence GCC "noreturn"
++	warning.
++
++2009-09-15	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/include/stdlib.h: Add posix_memalign.
++
++2009-09-11	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* configure.host (m32c): Remove -D_ABORT_PROVIDED.
++
++2009-09-10	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* configure.host: Add -D_NO_POPEN.
++	* libc/sys/rtems/crt0.c: Don't provide waitpid unless used.
++
++2009-09-09	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* configure.host: Add -D_NO_WORDEXP.
++
++2009-09-06	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/sys/rtems/crt0.c: Add issetugid.
++
++2009-09-02	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/sys/rtems/crt0.c: Rework. Introduce macro RTEMS_STUB.
++
++2009-07-27	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/sys/rtems/crt0.c: Add _isatty_r.
++
++2009-07-06	Joel Sherrill <joel.sherrill at oarcorp.com>
++
++	* libc/include/sys/features.h: Define _UNIX98_THREAD_MUTEX_ATTRIBUTES.
++
++2009-05-05	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* configure.host: Remove -DMISSING_SYSCALL_NAMES.
++
++2009-03-11	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/stdlib/assert.c: Don't build __assert_func.
++	* libc/sys/rtems/crt0.c: Add __assert_func.
++
++2009-03-09	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/machine/powerpc/times.c: Remove.
++	* libc/machine/powerpc/Makefile.am: Remove times.c.
++	* libc/machine/powerpc/Makefile.in: Regenerate.
++
++2009-02-24	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/unix/ttyname.c: Sync with newlib-cvs.
++	* configure.host: Add -DHAVE_BLKSIZE to newlib_cflags.
++
++2009-02-22	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/sys/rtems/machine/stdint.h: Add __lm32__.
++	* libc/machine/lm32/configure.in: Set AC_CONFIG_SRC to setjmp.S.
++	* libc/machine/lm32/configure: Regenerate.
++
++2009-02-20	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/unix/Makefile.in: Regenerate.
++
++2009-02-20  Craig Howland <howland at LGSInnovations.com> on behalf of
++	Sebastian Huber <sebastian.huber at embedded-brains.de>
++
++	* libc/unix/ttyname.c:  Remove ttyname_r() (to a new file to avoid
++	coupling ttyname_r() and ttyname() due to the latter's large buffer).
++	* libc/unix/ttyname_r.c:  New file to hold ttyname_r(), previously in
++	ttyname.c.
++	* libc/unix/ttyname.h:  New file (common size definition for the 2
++	ttyname*c files that are now split).
++	* libc/unix/Makefile.am (ELIX_2_SOURCES):  Add ttyname_r.c.
++
++2009-02-16	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/sys/rtems/sys/param.h:
++	Update copyright notice from FreeBSD.
++	Remove HZ.
++	Add #include <sys/priority.h>
++	Remove priority handling (moved to sys/priority.h).
++	Remove CLBYTES (Unused, abandoned in BSD).
++
++2009-02-06	Ralf Corsépius <ralf.corsepius at rtems.org>
++
++	* libc/include/sched.h:
++	Remove (collides with RTEMS's schedul.h).
++
+diff -Naur newlib-1.18.0.orig/newlib/libc/include/inttypes.h newlib-1.18.0/newlib/libc/include/inttypes.h
+--- newlib-1.18.0.orig/newlib/libc/include/inttypes.h	2009-01-19 23:02:06.000000000 +0100
++++ newlib-1.18.0/newlib/libc/include/inttypes.h	2010-06-17 13:18:32.000000000 +0200
+@@ -242,6 +242,20 @@
+ #define SCNxMAX		__SCNMAX(x)
+ 
+ /* ptr types */
++#if INTPTR_MAX == INT64_MAX
++#define __PRIPTR(x) __PRI64(x)
++#define __SCNPTR(x) __SCN64(x)
++#elif INTPTR_MAX == INT32_MAX
++#define __PRIPTR(x) __PRI32(x)
++#define __SCNPTR(x) __SCN32(x)
++#elif INTPTR_MAX == INT16_MAX
++#define __PRIPTR(x) __PRI16(x)
++#define __SCNPTR(x) __SCN16(x)
++#else
++#error cannot determine PRI*PTR
++#endif
++
++#if 0
+ #if __have_long64
+ #define __PRIPTR(x) __STRINGIFY(l##x)
+ #define __SCNPTR(x) __STRINGIFY(l##x)
+@@ -252,6 +266,7 @@
+ #define __PRIPTR(x) __STRINGIFY(x)
+ #define __SCNPTR(x) __STRINGIFY(x)
+ #endif
++#endif
+ 
+ #define PRIdPTR		__PRIPTR(d)
+ #define PRIiPTR		__PRIPTR(i)
+diff -Naur newlib-1.18.0.orig/newlib/libc/include/machine/_default_types.h newlib-1.18.0/newlib/libc/include/machine/_default_types.h
+--- newlib-1.18.0.orig/newlib/libc/include/machine/_default_types.h	2008-06-12 00:14:54.000000000 +0200
++++ newlib-1.18.0/newlib/libc/include/machine/_default_types.h	2010-06-17 13:18:32.000000000 +0200
+@@ -54,14 +54,14 @@
+ #endif
+ #endif
+ 
+-#if __EXP(INT_MAX) == 0x7fffffffL
+-typedef signed int __int32_t;
+-typedef unsigned int __uint32_t;
+-#define ___int32_t_defined 1
+-#elif __EXP(LONG_MAX) == 0x7fffffffL
++#if __EXP(LONG_MAX) == 0x7fffffffL
+ typedef signed long __int32_t;
+ typedef unsigned long __uint32_t;
+ #define ___int32_t_defined 1
++#elif __EXP(INT_MAX) == 0x7fffffffL
++typedef signed int __int32_t;
++typedef unsigned int __uint32_t;
++#define ___int32_t_defined 1
+ #elif __EXP(SHRT_MAX) == 0x7fffffffL
+ typedef signed short __int32_t;
+ typedef unsigned short __uint32_t;
+diff -Naur newlib-1.18.0.orig/newlib/libc/include/sched.h newlib-1.18.0/newlib/libc/include/sched.h
+--- newlib-1.18.0.orig/newlib/libc/include/sched.h	2007-09-21 23:02:15.000000000 +0200
++++ newlib-1.18.0/newlib/libc/include/sched.h	2010-06-17 13:18:32.000000000 +0200
+@@ -1,11 +1,94 @@
++/*
++ *  Written by Joel Sherrill <joel at OARcorp.com>.
++ *
++ *  COPYRIGHT (c) 1989-2010.
++ *  On-Line Applications Research Corporation (OAR).
++ *
++ *  Permission to use, copy, modify, and distribute this software for any
++ *  purpose without fee is hereby granted, provided that this entire notice
++ *  is included in all copies of any software which is or includes a copy
++ *  or modification of this software.
++ *
++ *  THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
++ *  WARRANTY.  IN PARTICULAR,  THE AUTHOR MAKES NO REPRESENTATION
++ *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
++ *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
++ *
++ *  $Id$
++ */
++
+ #ifndef _SCHED_H_
+ #define _SCHED_H_
+ 
++#include <sys/types.h>
++#include <sys/sched.h>
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ 
+-#include <sys/sched.h>
++#if defined(_POSIX_PRIORITY_SCHEDULING)
++/*
++ *  XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1803
++ */
++int sched_setparam(
++  pid_t                     __pid,
++  const struct sched_param *__param
++);
++
++/*
++ *  XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1800
++ */
++int sched_getparam(
++  pid_t                     __pid,
++  struct sched_param       *__param
++);
++
++/*
++ *  XBD 13 - Set Scheduling Policy and Scheduling Parameters,
++ *         P1003.1b-2008, p. 1805
++ */
++int sched_setscheduler(
++  pid_t                     __pid,
++  int                       __policy,
++  const struct sched_param *__param
++);
++
++/*
++ *  XBD 13 - Get Scheduling Policy, P1003.1b-2008, p. 1801
++ */
++int sched_getscheduler(
++  pid_t                     __pid
++);
++
++/*
++ *  XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1799
++ */
++int sched_get_priority_max(
++  int __policy
++);
++
++int sched_get_priority_min(
++  int  __policy
++);
++
++/*
++ *  XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1802
++ */
++int sched_rr_get_interval(
++  pid_t             __pid,
++  struct timespec  *__interval
++);
++#endif /* _POSIX_PRIORITY_SCHEDULING */
++
++#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING)
++
++/*
++ *  XBD 13 - Yield Processor, P1003.1b-2008, p. 1807
++ */
++int sched_yield( void );
++
++#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */
+ 
+ #ifdef __cplusplus
+ }
+diff -Naur newlib-1.18.0.orig/newlib/libc/include/stdint.h newlib-1.18.0/newlib/libc/include/stdint.h
+--- newlib-1.18.0.orig/newlib/libc/include/stdint.h	2009-04-24 23:55:07.000000000 +0200
++++ newlib-1.18.0/newlib/libc/include/stdint.h	2010-06-17 13:18:32.000000000 +0200
+@@ -33,7 +33,7 @@
+ /* Check if "long" is 64bit or 32bit wide */
+ #if __STDINT_EXP(LONG_MAX) > 0x7fffffff
+ #define __have_long64 1
+-#elif __STDINT_EXP(LONG_MAX) == 0x7fffffff && !defined(__SPU__)
++#elif __STDINT_EXP(LONG_MAX) == 0x7fffffff
+ #define __have_long32 1
+ #endif
+ 
+@@ -49,14 +49,14 @@
+ #define __int_least8_t_defined 1
+ #endif
+ 
+-#if __STDINT_EXP(SHRT_MAX) == 0x7fff
+-typedef signed short int16_t;
+-typedef unsigned short uint16_t;
+-#define __int16_t_defined 1
+-#elif __STDINT_EXP(INT_MAX) == 0x7fff
++#if __STDINT_EXP(INT_MAX) == 0x7fff
+ typedef signed int int16_t;
+ typedef unsigned int uint16_t;
+ #define __int16_t_defined 1
++#elif __STDINT_EXP(SHRT_MAX) == 0x7fff
++typedef signed short int16_t;
++typedef unsigned short uint16_t;
++#define __int16_t_defined 1
+ #elif __STDINT_EXP(SCHAR_MAX) == 0x7fff
+ typedef signed char int16_t;
+ typedef unsigned char uint16_t;
+@@ -239,6 +239,29 @@
+  * GCC doesn't provide an appropriate macro for [u]intptr_t
+  * For now, use __PTRDIFF_TYPE__
+  */
++#if defined(__SIZEOF_POINTER__)
++#if __SIZEOF_POINTER__ == 8
++  typedef int64_t intptr_t;
++  typedef uint64_t uintptr_t;
++#define INTPTR_MAX INT64_MAX
++#define INTPTR_MIN INT64_MIN
++#define UINTPTR_MAX UINT64_MAX
++#elif __SIZEOF_POINTER__ == 4
++  typedef int32_t intptr_t;
++  typedef uint32_t uintptr_t;
++#define INTPTR_MAX INT32_MAX
++#define INTPTR_MIN INT32_MIN
++#define UINTPTR_MAX UINT32_MAX
++#elif __SIZEOF_POINTER__ == 2
++  typedef int16_t intptr_t;
++  typedef uint16_t uintptr_t;
++#define INTPTR_MAX INT16_MAX
++#define INTPTR_MIN INT16_MIN
++#define UINTPTR_MAX UINT16_MAX
++#else
++#error cannot determine intptr_t
++#endif
++#else
+ #if defined(__PTRDIFF_TYPE__)
+ typedef signed __PTRDIFF_TYPE__ intptr_t;
+ typedef unsigned __PTRDIFF_TYPE__ uintptr_t;
+@@ -260,6 +283,7 @@
+ #define INTPTR_MIN (-__STDINT_EXP(LONG_MAX) - 1)
+ #define UINTPTR_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
+ #endif
++#endif
+ 
+ /* Limits of Specified-Width Integer Types */
+ 
+diff -Naur newlib-1.18.0.orig/newlib/libc/include/string.h newlib-1.18.0/newlib/libc/include/string.h
+--- newlib-1.18.0.orig/newlib/libc/include/string.h	2008-06-18 17:27:27.000000000 +0200
++++ newlib-1.18.0/newlib/libc/include/string.h	2010-06-17 13:18:32.000000000 +0200
+@@ -49,18 +49,11 @@
+ #ifndef __STRICT_ANSI__
+ char 	*_EXFUN(strtok_r,(char *, const char *, char **));
+ 
+-int	 _EXFUN(bcmp,(const void *, const void *, size_t));
+-void	 _EXFUN(bcopy,(const void *, void *, size_t));
+-void	 _EXFUN(bzero,(void *, size_t));
+-int	 _EXFUN(ffs,(int));
+-char 	*_EXFUN(index,(const char *, int));
+ _PTR	 _EXFUN(memccpy,(_PTR, const _PTR, int, size_t));
+ _PTR	 _EXFUN(mempcpy,(_PTR, const _PTR, size_t));
+ _PTR	 _EXFUN(memmem, (const _PTR, size_t, const _PTR, size_t));
+-char 	*_EXFUN(rindex,(const char *, int));
+ char 	*_EXFUN(stpcpy,(char *, const char *));
+ char 	*_EXFUN(stpncpy,(char *, const char *, size_t));
+-int	 _EXFUN(strcasecmp,(const char *, const char *));
+ char	*_EXFUN(strcasestr,(const char *, const char *));
+ char 	*_EXFUN(strdup,(const char *));
+ char 	*_EXFUN(_strdup_r,(struct _reent *, const char *));
+@@ -69,7 +62,6 @@
+ char 	*_EXFUN(strerror_r,(int, char *, size_t));
+ size_t	 _EXFUN(strlcat,(char *, const char *, size_t));
+ size_t	 _EXFUN(strlcpy,(char *, const char *, size_t));
+-int	 _EXFUN(strncasecmp,(const char *, const char *, size_t));
+ size_t	 _EXFUN(strnlen,(const char *, size_t));
+ char 	*_EXFUN(strsep,(char **, const char *));
+ char	*_EXFUN(strlwr,(char *));
+@@ -81,20 +73,6 @@
+ int     _EXFUN(strtosigno, (const char *__name));
+ #endif
+ 
+-/* These function names are used on Windows and perhaps other systems.  */
+-#ifndef strcmpi
+-#define strcmpi strcasecmp
+-#endif
+-#ifndef stricmp
+-#define stricmp strcasecmp
+-#endif
+-#ifndef strncmpi
+-#define strncmpi strncasecmp
+-#endif
+-#ifndef strnicmp
+-#define strnicmp strncasecmp
+-#endif
+-
+ #endif /* ! __STRICT_ANSI__ */
+ 
+ #include <sys/string.h>
+diff -Naur newlib-1.18.0.orig/newlib/libc/include/strings.h newlib-1.18.0/newlib/libc/include/strings.h
+--- newlib-1.18.0.orig/newlib/libc/include/strings.h	1970-01-01 01:00:00.000000000 +0100
++++ newlib-1.18.0/newlib/libc/include/strings.h	2010-06-17 13:18:32.000000000 +0200
+@@ -0,0 +1,44 @@
++/*
++ * strings.h
++ *
++ * Definitions for string operations.
++ */
++
++#ifndef _STRINGS_H_
++#define _STRINGS_H_
++
++#include "_ansi.h"
++#include <sys/reent.h>
++
++#include <sys/types.h> /* for size_t */
++#include <locale.h> /* for locale_t */
++
++_BEGIN_STD_C
++
++#ifndef __STRICT_ANSI__
++/* 
++ * Marked LEGACY in Open Group Base Specifications Issue 6/IEEE Std 1003.1-2004
++ * Removed from Open Group Base Specifications Issue 7/IEEE Std 1003.1-2008
++ */
++int	 _EXFUN(bcmp,(const void *, const void *, size_t));
++void	 _EXFUN(bcopy,(const void *, void *, size_t));
++void	 _EXFUN(bzero,(void *, size_t));
++char 	*_EXFUN(index,(const char *, int));
++char 	*_EXFUN(rindex,(const char *, int));
++#endif /* ! __STRICT_ANSI__ */
++
++int	 _EXFUN(ffs,(int));
++int	 _EXFUN(strcasecmp,(const char *, const char *));
++#if 0
++/* Not implemented */
++int	 _EXFUN(strcasecmp_l,(const char *, const char *, locale_t));
++#endif
++int	 _EXFUN(strncasecmp,(const char *, const char *, size_t));
++#if 0
++/* Not implemented */
++int	 _EXFUN(strncasecmp_l,(const char *, const char *, size_t, locale_t));
++#endif
++
++_END_STD_C
++
++#endif /* _STRINGS_H_ */
+diff -Naur newlib-1.18.0.orig/newlib/libc/include/sys/sched.h newlib-1.18.0/newlib/libc/include/sys/sched.h
+--- newlib-1.18.0.orig/newlib/libc/include/sys/sched.h	2002-06-20 21:51:24.000000000 +0200
++++ newlib-1.18.0/newlib/libc/include/sys/sched.h	2010-06-17 13:18:32.000000000 +0200
+@@ -1,7 +1,7 @@
+ /*
+  *  Written by Joel Sherrill <joel at OARcorp.com>.
+  *
+- *  COPYRIGHT (c) 1989-2000.
++ *  COPYRIGHT (c) 1989-2010.
+  *  On-Line Applications Research Corporation (OAR).
+  *
+  *  Permission to use, copy, modify, and distribute this software for any
+@@ -14,51 +14,53 @@
+  *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
+  *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
+  *
+- *  $Id$
++ *  $Id$
+  */
+ 
+ 
+-#ifndef __POSIX_SYS_SCHEDULING_h
+-#define __POSIX_SYS_SCHEDULING_h
++#ifndef _SYS_SCHED_H_
++#define _SYS_SCHED_H_
+ 
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ 
+-#include <sys/unistd.h>
+-
+-#include <sys/types.h>
+-#include <sys/time.h>
+-
+-/* Scheduling Policies, P1003.1b-1993, p. 250
+-   NOTE:  SCHED_SPORADIC added by P1003.4b/D8, p. 34.  */
+-
++/* Scheduling Policies */
++/* Open Group Specifications Issue 6 */
++#if defined(__CYGWIN__)
++#define SCHED_OTHER    3
++#else
+ #define SCHED_OTHER    0
++#endif
++
+ #define SCHED_FIFO     1
+ #define SCHED_RR       2
+ 
+ #if defined(_POSIX_SPORADIC_SERVER)
+-#define SCHED_SPORADIC 3 
++#define SCHED_SPORADIC 4
+ #endif
+ 
+-/* Scheduling Parameters, P1003.1b-1993, p. 249
+-   NOTE:  Fields whose name begins with "ss_" added by P1003.4b/D8, p. 33.  */
++/* Scheduling Parameters */
++/* Open Group Specifications Issue 6 */
+ 
+ struct sched_param {
+   int sched_priority;           /* Process execution scheduling priority */
+ 
+-#if defined(_POSIX_SPORADIC_SERVER)
+-  int ss_low_priority;          /* Low scheduling priority for sporadic */
++#if defined(_POSIX_SPORADIC_SERVER) || defined(_POSIX_THREAD_SPORADIC_SERVER)
++  int sched_ss_low_priority;    /* Low scheduling priority for sporadic */
+                                 /*   server */
+-  struct timespec ss_replenish_period; 
++  struct timespec sched_ss_repl_period;
+                                 /* Replenishment period for sporadic server */
+-  struct timespec ss_initial_budget;   /* Initial budget for sporadic server */
++  struct timespec sched_ss_init_budget;
++                               /* Initial budget for sporadic server */
++  int sched_ss_max_repl;       /* Maximum pending replenishments for */
++                               /* sporadic server */
+ #endif
+ };
+ 
+ #ifdef __cplusplus
+ }
+-#endif 
++#endif
+ 
+ #endif
+ /* end of include file */
+diff -Naur newlib-1.18.0.orig/newlib/libc/include/sys/types.h newlib-1.18.0/newlib/libc/include/sys/types.h
+--- newlib-1.18.0.orig/newlib/libc/include/sys/types.h	2009-09-28 18:42:21.000000000 +0200
++++ newlib-1.18.0/newlib/libc/include/sys/types.h	2010-06-17 13:18:32.000000000 +0200
+@@ -176,7 +176,11 @@
+ #endif
+ typedef _ssize_t ssize_t;
+ 
+-#ifndef __CYGWIN__
++#if defined(__rtems__)
++typedef _mode_t mode_t;
++#endif
++
++#if !defined(__CYGWIN__) && !defined(__rtems__)
+ #ifdef __MS_types__
+ typedef	char *	addr_t;
+ typedef int mode_t;
+diff -Naur newlib-1.18.0.orig/newlib/libc/machine/powerpc/Makefile.am newlib-1.18.0/newlib/libc/machine/powerpc/Makefile.am
+--- newlib-1.18.0.orig/newlib/libc/machine/powerpc/Makefile.am	2007-05-24 19:33:35.000000000 +0200
++++ newlib-1.18.0/newlib/libc/machine/powerpc/Makefile.am	2010-06-17 13:18:32.000000000 +0200
+@@ -10,7 +10,7 @@
+ 
+ AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib
+ 
+-lib_a_SOURCES = setjmp.S times.c
++lib_a_SOURCES = setjmp.S
+ lib_a_CCASFLAGS=$(AM_CCASFLAGS)
+ lib_a_CFLAGS=$(AM_CFLAGS)
+ lib_a_LIBADD = @extra_objs@
+diff -Naur newlib-1.18.0.orig/newlib/libc/machine/powerpc/Makefile.in newlib-1.18.0/newlib/libc/machine/powerpc/Makefile.in
+--- newlib-1.18.0.orig/newlib/libc/machine/powerpc/Makefile.in	2009-10-21 00:44:03.000000000 +0200
++++ newlib-1.18.0/newlib/libc/machine/powerpc/Makefile.in	2010-06-17 13:18:32.000000000 +0200
+@@ -51,7 +51,7 @@
+ LIBRARIES = $(noinst_LIBRARIES)
+ ARFLAGS = cru
+ lib_a_AR = $(AR) $(ARFLAGS)
+-am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-times.$(OBJEXT)
++am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT)
+ lib_a_OBJECTS = $(am_lib_a_OBJECTS)
+ DEFAULT_INCLUDES = -I. at am__isrc@
+ depcomp =
+@@ -173,7 +173,7 @@
+ AM_CCASFLAGS = $(INCLUDES)
+ noinst_LIBRARIES = lib.a
+ AM_CFLAGS = -I $(srcdir)/../../stdio -I $(srcdir)/../../stdlib
+-lib_a_SOURCES = setjmp.S times.c
++lib_a_SOURCES = setjmp.S
+ lib_a_CCASFLAGS = $(AM_CCASFLAGS)
+ lib_a_CFLAGS = $(AM_CFLAGS)
+ lib_a_LIBADD = @extra_objs@
+@@ -184,7 +184,7 @@
+ all: all-am
+ 
+ .SUFFIXES:
+-.SUFFIXES: .S .c .o .obj
++.SUFFIXES: .S .o .obj
+ am--refresh:
+ 	@:
+ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+@@ -245,18 +245,6 @@
+ lib_a-setjmp.obj: setjmp.S
+ 	$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-setjmp.obj `if test -f 'setjmp.S'; then $(CYGPATH_W) 'setjmp.S'; else $(CYGPATH_W) '$(srcdir)/setjmp.S'; fi`
+ 
+-.c.o:
+-	$(COMPILE) -c $<
+-
+-.c.obj:
+-	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+-
+-lib_a-times.o: times.c
+-	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-times.o `test -f 'times.c' || echo '$(srcdir)/'`times.c
+-
+-lib_a-times.obj: times.c
+-	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-times.obj `if test -f 'times.c'; then $(CYGPATH_W) 'times.c'; else $(CYGPATH_W) '$(srcdir)/times.c'; fi`
+-
+ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ 	unique=`for i in $$list; do \
+diff -Naur newlib-1.18.0.orig/newlib/libc/machine/powerpc/times.c newlib-1.18.0/newlib/libc/machine/powerpc/times.c
+--- newlib-1.18.0.orig/newlib/libc/machine/powerpc/times.c	2002-07-22 22:26:51.000000000 +0200
++++ newlib-1.18.0/newlib/libc/machine/powerpc/times.c	1970-01-01 01:00:00.000000000 +0100
+@@ -1,36 +0,0 @@
+-/* Time support routines for PowerPC.
+- *
+- * Written by Aldy Hernandez.
+- */
+-
+-#include <_ansi.h>
+-#include <reent.h>
+-#include <sys/time.h>
+-#include <sys/times.h>
+-#include <sys/resource.h>
+-
+-clock_t
+-times (struct tms *tp)
+-{
+-  struct rusage usage;
+-  union {
+-    struct rusage r;
+-    /* Newlib's rusage has only 2 fields.  We need to make room for
+-       when we call the system's rusage.  This should be enough.  */
+-    int filler[32];
+-  } host_ru;
+-
+-  getrusage (RUSAGE_SELF, (void *)&host_ru);
+-
+-  if (tp)
+-    {
+-      tp->tms_utime = host_ru.r.ru_utime.tv_sec * 1000
+-	+ host_ru.r.ru_utime.tv_usec;
+-      tp->tms_stime = host_ru.r.ru_stime.tv_sec * 1000
+-	+ host_ru.r.ru_stime.tv_usec;
+-      tp->tms_cutime = 0;	/* user time, children */
+-      tp->tms_cstime = 0;	/* system time, children */
+-    }
+-
+-  return tp->tms_utime;
+-}
+diff -Naur newlib-1.18.0.orig/newlib/libc/misc/ffs.c newlib-1.18.0/newlib/libc/misc/ffs.c
+--- newlib-1.18.0.orig/newlib/libc/misc/ffs.c	2003-06-06 21:57:51.000000000 +0200
++++ newlib-1.18.0/newlib/libc/misc/ffs.c	2010-06-17 13:18:32.000000000 +0200
+@@ -24,7 +24,7 @@
+ 
+ No supporting OS subroutines are required.  */
+ 
+-#include <_ansi.h>
++#include <strings.h>
+ 
+ int
+ _DEFUN(ffs, (word),
+diff -Naur newlib-1.18.0.orig/newlib/libc/posix/telldir.c newlib-1.18.0/newlib/libc/posix/telldir.c
+--- newlib-1.18.0.orig/newlib/libc/posix/telldir.c	2008-11-27 22:01:40.000000000 +0100
++++ newlib-1.18.0/newlib/libc/posix/telldir.c	2010-06-17 13:18:32.000000000 +0200
+@@ -67,7 +67,7 @@
+ #define	NDIRHASH	32	/* Num of hash lists, must be a power of 2 */
+ #define	LOCHASH(i)	((i)&(NDIRHASH-1))
+ 
+-static long	dd_loccnt;	/* Index of entry for sequential readdir's */
++static long	dd_loccnt = 1;	/* Index of entry for sequential readdir's */
+ static struct	ddloc *dd_hash[NDIRHASH];   /* Hash list heads for ddlocs */
+ __LOCK_INIT(static, dd_hash_lock);
+ 
+@@ -119,40 +119,46 @@
+ 	register struct ddloc *lp;
+ 	register struct ddloc **prevlp;
+ 	struct dirent *dp;
+-	extern long lseek();
+ 
+ #ifdef HAVE_DD_LOCK
+ 	__lock_acquire(dd_hash_lock);
+ #endif
+-	prevlp = &dd_hash[LOCHASH(loc)];
+-	lp = *prevlp;
+-	while (lp != NULL) {
+-		if (lp->loc_index == loc)
+-			break;
+-		prevlp = &lp->loc_next;
+-		lp = lp->loc_next;
+-	}
+-	if (lp == NULL) {
++	if (loc != 0) {
++		prevlp = &dd_hash[LOCHASH(loc)];
++		lp = *prevlp;
++		while (lp != NULL) {
++			if (lp->loc_index == loc)
++				break;
++			prevlp = &lp->loc_next;
++			lp = lp->loc_next;
++		}
++		if (lp == NULL) {
+ #ifdef HAVE_DD_LOCK
+-		__lock_release(dd_hash_lock);
++			__lock_release(dd_hash_lock);
+ #endif
+-		return;
+-	}
+-	if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek)
+-		goto found;
+-	(void) lseek(dirp->dd_fd, lp->loc_seek, 0);
+-	dirp->dd_seek = lp->loc_seek;
+-	dirp->dd_loc = 0;
+-	while (dirp->dd_loc < lp->loc_loc) {
+-		dp = readdir(dirp);
+-		if (dp == NULL)
+-			break;
+-	}
++			return;
++		}
++		if (lp->loc_loc == dirp->dd_loc && lp->loc_seek == dirp->dd_seek)
++			goto found;
++		(void) lseek(dirp->dd_fd, lp->loc_seek, 0);
++		dirp->dd_seek = lp->loc_seek;
++		dirp->dd_loc = 0;
++		while (dirp->dd_loc < lp->loc_loc) {
++			dp = readdir(dirp);
++			if (dp == NULL)
++				break;
++		}
+ found:
+ #ifdef SINGLEUSE
+-	*prevlp = lp->loc_next;
+-	free((caddr_t)lp);
++		*prevlp = lp->loc_next;
++		free((caddr_t)lp);
+ #endif
++	} else {
++		// loc 0 means rewinding
++		(void) lseek(dirp->dd_fd, 0, 0);
++		dirp->dd_seek = 0;
++		dirp->dd_loc = 0;
++	}
+ #ifdef HAVE_DD_LOCK
+ 	__lock_release(dd_hash_lock);
+ #endif
+@@ -169,26 +175,26 @@
+ 	__lock_acquire(dd_hash_lock);
+ #endif
+ 	for (i = 0; i < NDIRHASH; ++i) {
++		struct ddloc head;
+ 		register struct ddloc *lp;
+ 		register struct ddloc *prevlp;
++
+ 		lp = dd_hash[i];
+-		while (lp != NULL && lp->loc_dirp == dirp) {
+-			dd_hash[i] = lp->loc_next;
+-			prevlp = lp;
+-			free((caddr_t)lp);
+-			lp = prevlp->loc_next;
+-		}
+-		prevlp = lp;
++		head.loc_next = lp;
++		prevlp = &head;
+ 		while (lp != NULL) {
+-			lp = lp->loc_next;
+-			if (lp != NULL && lp->loc_dirp == dirp) {
+-				prevlp->loc_next = lp->loc_next;
++			struct ddloc *nextlp;
++
++			nextlp = lp->loc_next;
++			if (lp->loc_dirp == dirp) {
++				prevlp->loc_next = nextlp;
+ 				free((caddr_t)lp);
+-				lp = prevlp;
+ 			}
+ 			else
+ 				prevlp = lp;
++			lp = nextlp;
+ 		}
++		dd_hash[i] = head.loc_next;
+ 	}
+ #ifdef HAVE_DD_LOCK
+ 	__lock_release(dd_hash_lock);
+diff -Naur newlib-1.18.0.orig/newlib/libc/search/db_local.h newlib-1.18.0/newlib/libc/search/db_local.h
+--- newlib-1.18.0.orig/newlib/libc/search/db_local.h	2002-06-25 01:05:08.000000000 +0200
++++ newlib-1.18.0/newlib/libc/search/db_local.h	2010-06-17 13:18:32.000000000 +0200
+@@ -102,11 +102,11 @@
+ typedef struct __db {
+ 	DBTYPE type;			/* Underlying db type. */
+ 	int (*close)(struct __db *);
+-	int (*del)(const struct __db *, const DBT *, u_int);
+-	int (*get)(const struct __db *, const DBT *, DBT *, u_int);
+-	int (*put)(const struct __db *, DBT *, const DBT *, u_int);
+-	int (*seq)(const struct __db *, DBT *, DBT *, u_int);
+-	int (*sync)(const struct __db *, u_int);
++	int (*del)(const struct __db *, const DBT *, __uint32_t);
++	int (*get)(const struct __db *, const DBT *, DBT *, __uint32_t);
++	int (*put)(const struct __db *, DBT *, const DBT *, __uint32_t);
++	int (*seq)(const struct __db *, DBT *, DBT *, __uint32_t);
++	int (*sync)(const struct __db *, __uint32_t);
+ 	void *internal;			/* Access method private. */
+ 	int (*fd)(const struct __db *);
+ } DB;
+diff -Naur newlib-1.18.0.orig/newlib/libc/search/extern.h newlib-1.18.0/newlib/libc/search/extern.h
+--- newlib-1.18.0.orig/newlib/libc/search/extern.h	2002-06-20 21:51:31.000000000 +0200
++++ newlib-1.18.0/newlib/libc/search/extern.h	2010-06-17 13:18:32.000000000 +0200
+@@ -43,7 +43,7 @@
+ int	 __big_split(HTAB *, BUFHEAD *, BUFHEAD *, BUFHEAD *,
+ 		int, __uint32_t, SPLIT_RETURN *);
+ int	 __buf_free(HTAB *, int, int);
+-void	 __buf_init(HTAB *, int);
++void	 __buf_init(HTAB *, __uint32_t);
+ __uint32_t	 __call_hash(HTAB *, char *, int);
+ int	 __delpair(HTAB *, BUFHEAD *, int);
+ int	 __expand_table(HTAB *);
+diff -Naur newlib-1.18.0.orig/newlib/libc/search/hash_buf.c newlib-1.18.0/newlib/libc/search/hash_buf.c
+--- newlib-1.18.0.orig/newlib/libc/search/hash_buf.c	2004-05-26 19:57:10.000000000 +0200
++++ newlib-1.18.0/newlib/libc/search/hash_buf.c	2010-06-17 13:18:32.000000000 +0200
+@@ -118,7 +118,7 @@
+ 	int newpage;	/* If prev_bp set, indicates a new overflow page. */
+ {
+ 	BUFHEAD *bp;
+-	__uint32_t is_disk_mask;
++	ptrdiff_t is_disk_mask;
+ 	int is_disk, segment_ndx;
+ 	SEGMENT segp;
+ 
+@@ -298,7 +298,7 @@
+ extern void
+ __buf_init(hashp, nbytes)
+ 	HTAB *hashp;
+-	int nbytes;
++	__uint32_t nbytes;
+ {
+ 	BUFHEAD *bfp;
+ 	int npages;
+diff -Naur newlib-1.18.0.orig/newlib/libc/search/hash.h newlib-1.18.0/newlib/libc/search/hash.h
+--- newlib-1.18.0.orig/newlib/libc/search/hash.h	2008-07-02 20:38:45.000000000 +0200
++++ newlib-1.18.0/newlib/libc/search/hash.h	2010-06-17 13:18:32.000000000 +0200
+@@ -82,7 +82,7 @@
+ 
+ /* Hash Table Information */
+ typedef struct hashhdr {		/* Disk resident portion */
+-	int		magic;		/* Magic NO for hash tables */
++	__uint32_t	magic;		/* Magic NO for hash tables */
+ 	int		version;	/* Version ID */
+ 	__uint32_t	lorder;		/* Byte Order */
+ 	int		bsize;		/* Bucket/Page Size */
+@@ -97,7 +97,7 @@
+ 	int		high_mask;	/* Mask to modulo into entire table */
+ 	int		low_mask;	/* Mask to modulo into lower half of 
+ 					 * table */
+-	int		ffactor;	/* Fill factor */
++	__uint32_t	ffactor;	/* Fill factor */
+ 	int		nkeys;		/* Number of keys in hash table */
+ 	int		hdrpages;	/* Size of table header */
+ 	int		h_charkey;	/* value of hash(CHARKEY) */
+diff -Naur newlib-1.18.0.orig/newlib/libc/string/bcmp.c newlib-1.18.0/newlib/libc/string/bcmp.c
+--- newlib-1.18.0.orig/newlib/libc/string/bcmp.c	2005-10-28 23:21:07.000000000 +0200
++++ newlib-1.18.0/newlib/libc/string/bcmp.c	2010-06-17 13:18:32.000000000 +0200
+@@ -6,11 +6,11 @@
+ 	bcmp
+ 
+ ANSI_SYNOPSIS
+-	#include <string.h>
++	#include <strings.h>
+ 	int bcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>);
+ 
+ TRAD_SYNOPSIS
+-	#include <string.h>
++	#include <strings.h>
+ 	int bcmp(<[s1]>, <[s2]>, <[n]>)
+ 	const void *<[s1]>;
+ 	const void *<[s2]>;
+@@ -35,7 +35,7 @@
+ 	bcmp ansi pure
+ */
+ 
+-#include <string.h>
++#include <strings.h>
+ 
+ int
+ _DEFUN (bcmp, (m1, m2, n),
+diff -Naur newlib-1.18.0.orig/newlib/libc/string/bcopy.c newlib-1.18.0/newlib/libc/string/bcopy.c
+--- newlib-1.18.0.orig/newlib/libc/string/bcopy.c	2002-05-23 20:46:04.000000000 +0200
++++ newlib-1.18.0/newlib/libc/string/bcopy.c	2010-06-17 13:18:32.000000000 +0200
+@@ -3,7 +3,7 @@
+ 	<<bcopy>>---copy memory regions
+ 
+ ANSI_SYNOPSIS
+-	#include <string.h>
++	#include <strings.h>
+ 	void bcopy(const void *<[in]>, void *<[out]>, size_t <[n]>);
+ 
+ TRAD_SYNOPSIS
+@@ -26,7 +26,7 @@
+ 	bcopy - pure
+ */
+ 
+-#include <string.h>
++#include <strings.h>
+ 
+ void
+ _DEFUN (bcopy, (b1, b2, length),
+diff -Naur newlib-1.18.0.orig/newlib/libc/string/bzero.c newlib-1.18.0/newlib/libc/string/bzero.c
+--- newlib-1.18.0.orig/newlib/libc/string/bzero.c	2002-05-23 20:46:04.000000000 +0200
++++ newlib-1.18.0/newlib/libc/string/bzero.c	2010-06-17 13:18:32.000000000 +0200
+@@ -6,11 +6,11 @@
+ 	bzero
+ 
+ ANSI_SYNOPSIS
+-	#include <string.h>
++	#include <strings.h>
+ 	void bzero(void *<[b]>, size_t <[length]>);
+ 
+ TRAD_SYNOPSIS
+-	#include <string.h>
++	#include <strings.h>
+ 	void bzero(<[b]>, <[length]>)
+ 	void *<[b]>;
+ 	size_t <[length]>;
+@@ -30,7 +30,7 @@
+ <<bzero>> requires no supporting OS subroutines.
+ */
+ 
+-#include <string.h>
++#include <strings.h>
+ 
+ _VOID
+ _DEFUN (bzero, (b, length),
+diff -Naur newlib-1.18.0.orig/newlib/libc/string/index.c newlib-1.18.0/newlib/libc/string/index.c
+--- newlib-1.18.0.orig/newlib/libc/string/index.c	2000-02-17 20:39:48.000000000 +0100
++++ newlib-1.18.0/newlib/libc/string/index.c	2010-06-17 13:18:32.000000000 +0200
+@@ -10,7 +10,7 @@
+ 	char * index(const char *<[string]>, int <[c]>);
+ 
+ TRAD_SYNOPSIS
+-	#include <string.h>
++	#include <strings.h>
+ 	char * index(<[string]>, <[c]>);
+ 	char *<[string]>;
+ 	int *<[c]>;
+@@ -33,7 +33,7 @@
+ 	index - pure
+ */
+ 
+-#include <string.h>
++#include <strings.h>
+ 
+ char *
+ _DEFUN (index, (s, c),
+diff -Naur newlib-1.18.0.orig/newlib/libc/string/rindex.c newlib-1.18.0/newlib/libc/string/rindex.c
+--- newlib-1.18.0.orig/newlib/libc/string/rindex.c	2000-02-17 20:39:48.000000000 +0100
++++ newlib-1.18.0/newlib/libc/string/rindex.c	2010-06-17 13:18:32.000000000 +0200
+@@ -10,7 +10,7 @@
+ 	char * rindex(const char *<[string]>, int <[c]>);
+ 
+ TRAD_SYNOPSIS
+-	#include <string.h>
++	#include <strings.h>
+ 	char * rindex(<[string]>, <[c]>);
+ 	char *<[string]>;
+ 	int *<[c]>;
+@@ -33,7 +33,7 @@
+ 	rindex - pure
+ */
+ 
+-#include <string.h>
++#include <strings.h>
+ 
+ char *
+ _DEFUN (rindex, (s, c),
+diff -Naur newlib-1.18.0.orig/newlib/libc/string/strcasecmp.c newlib-1.18.0/newlib/libc/string/strcasecmp.c
+--- newlib-1.18.0.orig/newlib/libc/string/strcasecmp.c	2009-04-23 20:11:22.000000000 +0200
++++ newlib-1.18.0/newlib/libc/string/strcasecmp.c	2010-06-17 13:18:32.000000000 +0200
+@@ -38,7 +38,7 @@
+ 	strcasecmp
+ */
+ 
+-#include <string.h>
++#include <strings.h>
+ #include <ctype.h>
+ 
+ int
+diff -Naur newlib-1.18.0.orig/newlib/libc/string/strncasecmp.c newlib-1.18.0/newlib/libc/string/strncasecmp.c
+--- newlib-1.18.0.orig/newlib/libc/string/strncasecmp.c	2009-04-23 20:11:22.000000000 +0200
++++ newlib-1.18.0/newlib/libc/string/strncasecmp.c	2010-06-17 13:18:32.000000000 +0200
+@@ -6,11 +6,11 @@
+ 	strncasecmp
+ 
+ ANSI_SYNOPSIS
+-	#include <string.h>
++	#include <strings.h>
+ 	int strncasecmp(const char *<[a]>, const char * <[b]>, size_t <[length]>);
+ 
+ TRAD_SYNOPSIS
+-	#include <string.h>
++	#include <strings.h>
+ 	int strncasecmp(<[a]>, <[b]>, <[length]>)
+ 	char *<[a]>;
+ 	char *<[b]>;
+@@ -40,7 +40,7 @@
+ 	strncasecmp
+ */
+ 
+-#include <string.h>
++#include <strings.h>
+ #include <ctype.h>
+ 
+ int 
+diff -Naur newlib-1.18.0.orig/newlib/libc/sys/rtems/machine/_types.h newlib-1.18.0/newlib/libc/sys/rtems/machine/_types.h
+--- newlib-1.18.0.orig/newlib/libc/sys/rtems/machine/_types.h	2009-12-17 17:10:41.000000000 +0100
++++ newlib-1.18.0/newlib/libc/sys/rtems/machine/_types.h	2010-06-17 16:42:42.000000000 +0200
+@@ -20,6 +20,9 @@
+ typedef long signed int _ssize_t;
+ #endif
+ #define __ssize_t_defined 1
++#elif defined(__sparc__) && defined(__LP64__)
++typedef long signed int _ssize_t;
++#define __ssize_t_defined 1
+ #elif defined(__AVR__) || defined(__lm32__) || defined(__m32c__) || defined(__mips__) || defined(__PPC__) || defined(__sparc__) || defined(__sh__)
+ typedef signed int _ssize_t;
+ #define __ssize_t_defined 1
+@@ -31,4 +34,25 @@
+ 
+ typedef __int32_t blksize_t;
+ typedef __int32_t blkcnt_t;
++
++/* EXPERIMENTAL: Use 64bit types */
++#if defined(__arm__) || defined(__i386__) || defined(__m68k__) || defined(__mips__) || defined(__PPC__) || defined(__sparc__)
++/* Use 64bit types */
++typedef __int64_t _off_t;
++#define __off_t_defined 1
++
++typedef __int64_t _fpos_t;
++#define __fpos_t_defined 1
++#else
++/* Use 32bit types */
++typedef __int32_t _off_t;
++#define __off_t_defined 1
++
++typedef __int32_t _fpos_t;
++#define __fpos_t_defined 1
++#endif
++
++typedef __uint32_t _mode_t;
++#define __mode_t_defined 1
++
+ #endif
+diff -Naur newlib-1.18.0.orig/newlib/libm/common/modfl.c newlib-1.18.0/newlib/libm/common/modfl.c
+--- newlib-1.18.0.orig/newlib/libm/common/modfl.c	2009-04-18 00:15:43.000000000 +0200
++++ newlib-1.18.0/newlib/libm/common/modfl.c	2010-06-17 13:18:32.000000000 +0200
+@@ -36,7 +36,7 @@
+ long double
+ modfl (long double x, long double *iptr)
+ {
+-  return modf(x, iptr);
++  return modf(x, (double*) iptr);
+ }
+ #endif
+ 
+diff -Naur newlib-1.18.0.orig/newlib/libm/common/sf_llrint.c newlib-1.18.0/newlib/libm/common/sf_llrint.c
+--- newlib-1.18.0.orig/newlib/libm/common/sf_llrint.c	2009-04-03 19:39:24.000000000 +0200
++++ newlib-1.18.0/newlib/libm/common/sf_llrint.c	2010-06-17 13:18:32.000000000 +0200
+@@ -71,7 +71,7 @@
+           GET_FLOAT_WORD (i0, t);
+           /* Detect the all-zeros representation of plus and
+              minus zero, which fails the calculation below. */
+-          if ((i0 & ~(1 << 31)) == 0)
++          if ((i0 & ~((__uint32_t)1 << 31)) == 0)
+               return 0;
+           j0 = ((i0 >> 23) & 0xff) - 0x7f;
+           i0 &= 0x7fffff;
+diff -Naur newlib-1.18.0.orig/newlib/libm/common/sf_round.c newlib-1.18.0/newlib/libm/common/sf_round.c
+--- newlib-1.18.0.orig/newlib/libm/common/sf_round.c	2005-02-24 20:02:35.000000000 +0100
++++ newlib-1.18.0/newlib/libm/common/sf_round.c	2010-06-17 13:18:32.000000000 +0200
+@@ -38,7 +38,7 @@
+           w &= 0x80000000;
+           if (exponent_less_127 == -1)
+             /* Result is +1.0 or -1.0. */
+-            w |= (127 << 23);
++            w |= ((__uint32_t)127 << 23);
+         }
+       else
+         {
+diff -Naur newlib-1.18.0.orig/newlib/Makefile.am newlib-1.18.0/newlib/Makefile.am
+--- newlib-1.18.0.orig/newlib/Makefile.am	2009-08-18 23:48:05.000000000 +0200
++++ newlib-1.18.0/newlib/Makefile.am	2010-06-17 13:18:32.000000000 +0200
+@@ -81,7 +81,7 @@
+ 	libc.a
+ endif
+ 
+-noinst_DATA = stmp-targ-include
++BUILT_SOURCES = stmp-targ-include
+ 
+ toollib_DATA = $(CRT0) $(CRT1)
+ 
+diff -Naur newlib-1.18.0.orig/newlib/Makefile.in newlib-1.18.0/newlib/Makefile.in
+--- newlib-1.18.0.orig/newlib/Makefile.in	2009-10-21 00:43:45.000000000 +0200
++++ newlib-1.18.0/newlib/Makefile.in	2010-06-17 13:18:32.000000000 +0200
+@@ -122,7 +122,7 @@
+ 	install-pdf-recursive install-ps-recursive install-recursive \
+ 	installcheck-recursive installdirs-recursive pdf-recursive \
+ 	ps-recursive uninstall-recursive
+-DATA = $(noinst_DATA) $(toollib_DATA)
++DATA = $(toollib_DATA)
+ RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+   distclean-recursive maintainer-clean-recursive
+ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+@@ -351,7 +351,7 @@
+ @USE_LIBTOOL_FALSE at 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
+@@ -411,7 +411,7 @@
+ 
+ # dejagnu support
+ RUNTESTFLAGS = 
+-all: newlib.h
++all: $(BUILT_SOURCES) newlib.h
+ 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+ 
+ .SUFFIXES:
+@@ -725,14 +725,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
+@@ -758,6 +760,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 \
+@@ -833,8 +836,9 @@
+ uninstall-am: uninstall-toollibDATA uninstall-toollibLIBRARIES \
+ 	uninstall-toollibLTLIBRARIES
+ 
+-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check-am \
+-	ctags-recursive install-am install-strip tags-recursive
++.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \
++	check-am ctags-recursive install install-am install-strip \
++	tags-recursive
+ 
+ .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ 	all all-am am--refresh check check-DEJAGNU check-am clean \



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100617/d8832aee/attachment-0001.html>


More information about the vc mailing list