diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/gdb/Makefile.in gdb-6.0/gdb/Makefile.in
--- /usr1/rtems/work-tools/original/gdb-6.0/gdb/Makefile.in	Mon Aug 18 13:10:52 2003
+++ gdb-6.0/gdb/Makefile.in	Tue Feb 17 12:44:05 2004
@@ -2078,6 +2078,8 @@
 	$(regcache_h)
 ppcbug-rom.o: ppcbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
 	$(serial_h) $(regcache_h)
+ppc2dink32-rom.o: ppc2dink32-rom.c monitor.h $(bfd_h) $(wait_h) $(defs_h) \
+	$(gdbcmd_h) $(inferior_h) target.h serial.h terminal.h
 ppc-linux-nat.o: ppc-linux-nat.c $(defs_h) $(gdb_string_h) $(frame_h) \
 	$(inferior_h) $(gdbcore_h) $(regcache_h) $(gdb_wait_h) $(gregset_h) \
 	$(ppc_tdep_h)
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/gdb/config/powerpc/ppc-eabi.mt gdb-6.0/gdb/config/powerpc/ppc-eabi.mt
--- /usr1/rtems/work-tools/original/gdb-6.0/gdb/config/powerpc/ppc-eabi.mt	Wed May 29 20:21:53 2002
+++ gdb-6.0/gdb/config/powerpc/ppc-eabi.mt	Tue Feb 17 12:43:37 2004
@@ -1,3 +1,3 @@
 # Target: PowerPC running eabi
-TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-sysv-tdep.o solib.o solib-svr4.o
+TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-sysv-tdep.o solib.o solib-svr4.o ppc2dink32-rom.o
 TM_FILE= tm-ppc-eabi.h
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/gdb/config/powerpc/ppc-sim.mt gdb-6.0/gdb/config/powerpc/ppc-sim.mt
--- /usr1/rtems/work-tools/original/gdb-6.0/gdb/config/powerpc/ppc-sim.mt	Wed May 29 20:21:53 2002
+++ gdb-6.0/gdb/config/powerpc/ppc-sim.mt	Tue Feb 17 12:43:37 2004
@@ -1,5 +1,5 @@
 # Target: PowerPC running eabi and including the simulator
-TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-sysv-tdep.o solib.o solib-svr4.o
+TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-sysv-tdep.o solib.o solib-svr4.o ppc2dink32-rom.o
 TM_FILE= tm-ppc-eabi.h
 
 SIM_OBS = remote-sim.o
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/gdb/config/sparc/sparc-em.mt gdb-6.0/gdb/config/sparc/sparc-em.mt
--- /usr1/rtems/work-tools/original/gdb-6.0/gdb/config/sparc/sparc-em.mt	Thu Apr 15 20:34:25 1999
+++ gdb-6.0/gdb/config/sparc/sparc-em.mt	Tue Feb 17 12:43:37 2004
@@ -1,3 +1,7 @@
 # Target: SPARC embedded
 TDEPFILES= sparc-tdep.o
 TM_FILE= tm-spc-em.h
+
+SIM_OBS = remote-sim.o
+SIM = ../sim/erc32/libsim.a
+
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/gdb/config/sparc/sun4sol2.mh gdb-6.0/gdb/config/sparc/sun4sol2.mh
--- /usr1/rtems/work-tools/original/gdb-6.0/gdb/config/sparc/sun4sol2.mh	Thu Jan 17 22:51:08 2002
+++ gdb-6.0/gdb/config/sparc/sun4sol2.mh	Tue Feb 17 12:43:37 2004
@@ -1,7 +1,7 @@
 # Host: Sun 4 or Sparcstation, running Solaris 2
 
 XM_FILE= xm-sun4sol2.h
-XM_CLIBS= -lsocket -lnsl
+XM_CLIBS= -lsocket -lnsl -ldl
 
 NAT_FILE= nm-sun4sol2.h
 NATDEPFILES= corelow.o core-sol2.o solib.o solib-svr4.o solib-legacy.o \
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/gdb/configure.tgt gdb-6.0/gdb/configure.tgt
--- /usr1/rtems/work-tools/original/gdb-6.0/gdb/configure.tgt	Mon Aug 25 17:57:50 2003
+++ gdb-6.0/gdb/configure.tgt	Tue Feb 17 12:43:17 2004
@@ -53,6 +53,7 @@
 arm*-*-netbsd*)		gdb_target=nbsd
 			gdb_multi_arch=yes ;;
 arm-*-nto*)		gdb_target=nto ;;
++arm*-*-rtems* | thumb*-*-rtems* | strongarm*-*-rtems* | \
 arm*-*-* | thumb*-*-* | strongarm*-*-*)
 			gdb_target=embed
                         configdirs="$configdirs rdi-share"
@@ -69,7 +70,7 @@
 
 d10v-*-*)		gdb_target=d10v ;;
 
-h8300-*-*)		gdb_target=h8300 ;;
+h8300-*-rtems* | h8300-*-*)	gdb_target=h8300 ;;
 # OBSOLETE h8500-*-*)		gdb_target=h8500 ;;
 
 
@@ -106,6 +107,7 @@
 		configdirs="${configdirs} nlm" ;;
 i[34567]86-*-cygwin*)	gdb_target=cygwin  ;;
 i[34567]86-*-vxworks*)	gdb_target=vxworks ;;
+i[34567]86-*-rtems*)	gdb_target=embed ;;
 i[34567]86-*-*)		gdb_target=embed ;;
 
 ia64-*-aix*)		gdb_target=aix ;;
@@ -130,6 +132,7 @@
 m68*-*-aout*)		gdb_target=monitor ;;
 m68*-*-coff*)		gdb_target=monitor ;;
 m68*-*-elf*)		gdb_target=monitor ;;
+m68*-*-rtems*)		gdb_target=monitor ;;
 m68*-*-linux*)		gdb_target=linux
 			gdb_multi_arch=1
 			build_gdbserver=yes
@@ -155,7 +158,9 @@
 mips*-*-pe)		gdb_target=wince ;;
 mips64*el-*-ecoff*)	gdb_target=embedl64 ;;
 mips64*-*-ecoff*)	gdb_target=embed64 ;;
+mips64*-*-rtems*)	gdb_target=embed64 ;;
 mips64*vr*-*-elf*)	gdb_target=mips64 ;;
+mips*tx39*-rtems*)	gdb_target=tx39 ;;
 mips*tx39*-elf*)	gdb_target=tx39 ;;
 mips64*el-*-elf*)	gdb_target=embedl64 ;;
 mips64*-*-elf*)		gdb_target=embed64 ;;
@@ -164,6 +169,8 @@
 mips*-*-ecoff*)		gdb_target=embed ;;
 mips*el-*-elf*)		gdb_target=embedl ;;
 mips*-*-elf*)		gdb_target=embed ;;
+mips*el-*-rtems*)	gdb_target=embedl ;;
+mips*-*-rtems*)		gdb_target=embed ;;
 mips*-little-*)		gdb_target=mips ;;
 mips*-*-lnews*)		gdb_target=embedl ;;
 mips*-sgi-irix5*)	gdb_target=irix5 ;;
@@ -195,7 +202,8 @@
 			;;
 powerpc64-*-linux*)	gdb_target=linux ;;
 powerpc-*-vxworks*)	gdb_target=vxworks ;;
-powerpc*-*-*)		if test -f ../sim/ppc/Makefile; then
+powerpc*-*-* | powerpc*-*-*)
+			if test -f ../sim/ppc/Makefile; then
 			  gdb_target=ppc-sim
 			else
 			  gdb_target=ppc-eabi
@@ -215,6 +223,7 @@
 sh*-*-pe)		gdb_target=wince ;;
 sh-*-coff*)		gdb_target=embed ;;
 sh-*-elf*)		gdb_target=embed ;;
+sh-*-rtems*)		gdb_target=embed ;;
 sh-*-linux*)		gdb_target=linux
 			build_gdbserver=yes
 			;;
@@ -228,6 +237,7 @@
 sparc-*-linux*)		gdb_target=linux ;;
 sparc-*-lynxos*)	gdb_target=sparclynx ;;
 sparc-*-netbsd*)	gdb_target=nbsd ;;
+sparc-*-rtems*)		gdb_target=sparc-em ;;
 sparc-*-solaris2*)	gdb_target=sun4sol2 ;;
 sparc-*-sunos4*)	gdb_target=sun4os4 ;;
 sparc-*-sunos5*)	gdb_target=sun4sol2 ;;
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/gdb/ppc2dink32-rom.c gdb-6.0/gdb/ppc2dink32-rom.c
--- /usr1/rtems/work-tools/original/gdb-6.0/gdb/ppc2dink32-rom.c	Wed Dec 31 18:00:00 1969
+++ gdb-6.0/gdb/ppc2dink32-rom.c	Tue Feb 17 12:43:37 2004
@@ -0,0 +1,201 @@
+/* Remote debugging interface between the DINK32 (PowerPC) ROM monitor 
+   as found on the Radstone PPC2 VMEbus boards and GDB, the GNU debugger.
+   Copyright 1997 Free Software Foundation, Inc.
+
+This file is part of GDB.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "gdbcore.h"
+#include "target.h"
+#include "monitor.h"
+#include "serial.h"
+#include "symfile.h" /* For generic_load() */
+#include "inferior.h" /* For write_pc() */
+#include "regcache.h"
+
+static void ppc2dink32_open PARAMS ((char *args, int from_tty));
+
+static void
+ppc2dink32_supply_register (regname, regnamelen, val, vallen)
+     char *regname;
+     int regnamelen;
+     char *val;
+     int vallen;
+{
+  int regno = 0, base = 0;
+
+  if (regnamelen < 2 || regnamelen > 4)
+    return;
+
+  switch (regname[0])
+    {
+    case 'R':
+      if (regname[1] < '0' || regname[1] > '9')
+	return;
+      if (regnamelen == 2)
+	regno = regname[1] - '0';
+      else if (regnamelen == 3 && regname[2] >= '0' && regname[2] <= '9')
+	regno = (regname[1] - '0') * 10 + (regname[2] - '0');
+      else
+	return;
+      break;
+    case 'F':
+      if (regname[1] != 'R' || regname[2] < '0' || regname[2] > '9')
+	return;
+      if (regnamelen == 3)
+	regno = 32 + regname[2] - '0';
+      else if (regnamelen == 4 && regname[3] >= '0' && regname[3] <= '9')
+	regno = 32 + (regname[2] - '0') * 10 + (regname[3] - '0');
+      else
+	return;
+      break;
+    case 'I':
+      if (regnamelen != 2 || regname[1] != 'P')
+	return;
+      regno = 64;
+      break;
+    case 'M':
+      if (regnamelen != 3 || regname[1] != 'S' || regname[2] != 'R')
+	return;
+      regno = 65;
+      break;
+    case 'C':
+      if (regnamelen != 2 || regname[1] != 'R')
+	return;
+      regno = 66;
+      break;
+    case 'S':
+      if (regnamelen != 4 || regname[1] != 'P' || regname[2] != 'R')
+	return;
+      else if (regname[3] == '8')
+	regno = 67;
+      else if (regname[3] == '9')
+	regno = 68;
+      else if (regname[3] == '1')
+	regno = 69;
+      else if (regname[3] == '0')
+	regno = 70;
+      else
+	return;
+      break;
+    default:
+      return;
+    }
+
+  monitor_supply_register (regno, val);
+}
+
+static void
+ppc2dink32_load (monops, filename, from_tty)
+     struct monitor_ops *monops;
+     char *filename;
+     int from_tty;
+{
+  generic_load (filename, from_tty);
+
+  /* Finally, make the PC point at the start address */
+  if (exec_bfd)
+    write_pc (bfd_get_start_address (exec_bfd));
+
+  inferior_ptid = null_ptid;		/* No process now */
+}
+
+
+/* This array of registers needs to match the indexes used by GDB. The
+   whole reason this exists is because the various ROM monitors use
+   different names than GDB does, and don't support all the registers
+   either.  */
+
+static char *ppc2dink32_regnames[] =
+{
+  "r0",   "r1",   "r2",   "r3",   "r4",   "r5",   "r6",   "r7",
+  "r8",   "r9",   "r10",  "r11",  "r12",  "r13",  "r14",  "r15",
+  "r16",  "r17",  "r18",  "r19",  "r20",  "r21",  "r22",  "r23",
+  "r24",  "r25",  "r26",  "r27",  "r28",  "r29",  "r30",  "r31",
+
+  "f0",   "f1",   "f2",   "f3",   "f4",   "f5",   "f6",   "f7",
+  "f8",   "f9",   "f10",  "f11",  "f12",  "f13",  "f14",  "f15",
+  "f16",  "f17",  "f18",  "f19",  "f20",  "f21",  "f22",  "f23",
+  "f24",  "f25",  "f26",  "f27",  "f28",  "f29",  "f30",  "f31",
+
+  "srr0", "msr",  "cr",   "lr",   "ctr",  "xer",  "xer"
+};
+
+static struct target_ops ppc2dink32_ops;
+
+static char *ppc2dink32_inits[] = {"\r", NULL};
+
+static struct monitor_ops ppc2dink32_cmds;
+
+static void
+ppc2dink32_open (args, from_tty)
+     char *args;
+     int from_tty;
+{
+  monitor_open (args, &ppc2dink32_cmds, from_tty);
+}
+
+void
+_initialize_ppc2dink32_rom ()
+{
+  ppc2dink32_cmds.flags = MO_HEX_PREFIX | MO_GETMEM_NEEDS_RANGE | MO_FILL_USES_ADDR | MO_HANDLE_NL | MO_32_REGS_PAIRED | MO_SETREG_INTERACTIVE | MO_SETMEM_INTERACTIVE | MO_CLR_BREAK_1_BASED | MO_SREC_ACK | MO_SREC_ACK_ROTATE;
+  ppc2dink32_cmds.init = ppc2dink32_inits;
+  ppc2dink32_cmds.cont = "go +\r";
+  ppc2dink32_cmds.step = "tr +\r";
+  ppc2dink32_cmds.set_break = "bp 0x%x\r";
+  ppc2dink32_cmds.clr_break = "bp %d\r";
+#if 0 /* Would need to follow strict alignment rules.. */
+  ppc2dink32_cmds.fill = "mf %x %x %x\r";
+#endif
+  ppc2dink32_cmds.setmem.cmdb = "mm -b %x\r";
+  ppc2dink32_cmds.setmem.cmdw = "mm -h %x\r";
+  ppc2dink32_cmds.setmem.cmdl = "mm %x\r";
+  ppc2dink32_cmds.setmem.term = " ?  ";
+  ppc2dink32_cmds.getmem.cmdb = "md -b %x-%x\r";
+  ppc2dink32_cmds.getmem.cmdw = "md -h %x-%x\r";
+  ppc2dink32_cmds.getmem.cmdl = "md -w %x-%x\r";
+  ppc2dink32_cmds.getmem.resp_delim = "";
+  ppc2dink32_cmds.setreg.cmd = "rm %s\r";
+  ppc2dink32_cmds.setreg.term = " ?  ";
+  ppc2dink32_cmds.getreg.cmd = "rd %s\r";
+  ppc2dink32_cmds.getreg.resp_delim = ": ";
+  ppc2dink32_cmds.dump_registers = "rd r0-r31\r";
+  ppc2dink32_cmds.register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)";
+  ppc2dink32_cmds.supply_register = ppc2dink32_supply_register;
+  /* S-record download, via "keyboard port".  */
+  ppc2dink32_cmds.load = "dl -k\r";
+  ppc2dink32_cmds.loadresp = "Set Input Port : set to Keyboard Port\r";
+#if 0 /* slow load routine not needed if S-records work... */
+  ppc2dink32_cmds.load_routine = ppc2dink32_load;
+#endif
+  ppc2dink32_cmds.prompt = "DINK32 >>";
+  ppc2dink32_cmds.line_term = "\r";
+  ppc2dink32_cmds.target = &ppc2dink32_ops;
+  ppc2dink32_cmds.stopbits = SERIAL_1_STOPBITS;
+  ppc2dink32_cmds.regnames = ppc2dink32_regnames;
+  ppc2dink32_cmds.magic = MONITOR_OPS_MAGIC;
+
+  init_monitor_ops (&ppc2dink32_ops);
+
+  ppc2dink32_ops.to_shortname = "ppc2dink32";
+  ppc2dink32_ops.to_longname = "Radstone PPC2 DINK32 monitor";
+  ppc2dink32_ops.to_doc = "Debug using the Radstone PPC2 DINK32 monitor.\n\
+Specify the serial device it is connected to (e.g. /dev/ttya).";
+  ppc2dink32_ops.to_open = ppc2dink32_open;
+
+  add_target (&ppc2dink32_ops);
+}
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/gdb/rdi-share/hsys.c gdb-6.0/gdb/rdi-share/hsys.c
--- /usr1/rtems/work-tools/original/gdb-6.0/gdb/rdi-share/hsys.c	Fri Feb 25 10:37:32 2000
+++ gdb-6.0/gdb/rdi-share/hsys.c	Tue Feb 17 12:43:37 2004
@@ -810,6 +810,7 @@
     }
 
   case CL_TmpNam:
+#if 0
     {
       char *name;
       unsigned int tnamelen, TargetID;
@@ -855,6 +856,11 @@
       Adp_ChannelWrite(CI_CLIB, packet);/* Send message. */
       return 0;
     }
+#else
+    DebugPrintF(("CL_TmpNam declared dangerous and unsupported!!\n"));
+    return 0;
+
+#endif
 
   case CL_Unrecognised:
     DebugPrintF(("CL_Unrecognised!!\n"));
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/j.diff gdb-6.0/j.diff
--- /usr1/rtems/work-tools/original/gdb-6.0/j.diff	Wed Dec 31 18:00:00 1969
+++ gdb-6.0/j.diff	Tue Feb 17 12:43:25 2004
@@ -0,0 +1,1392 @@
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/gdb/Makefile.in gdb-5.3/gdb/Makefile.in
+--- /usr1/rtems/work-tools/original/gdb-5.3/gdb/Makefile.in	Mon Nov 25 16:05:38 2002
++++ gdb-5.3/gdb/Makefile.in	Tue Feb 17 11:51:27 2004
+@@ -1971,6 +1971,8 @@
+ 	$(regcache_h) $(value_h) $(ppc_tdep_h) $(gdb_string_h)
+ ppcbug-rom.o: ppcbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
+ 	$(serial_h) $(regcache_h)
++ppc2dink32-rom.o: ppc2dink32-rom.c monitor.h $(bfd_h) $(wait_h) $(defs_h) \
++	$(gdbcmd_h) $(inferior_h) target.h serial.h terminal.h
+ ppcnbsd-nat.o: ppcnbsd-nat.c $(defs_h) $(inferior_h) $(ppc_tdep_h) \
+ 	$(ppcnbsd_tdep_h)
+ ppcnbsd-tdep.o: ppcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/gdb/config/powerpc/ppc-eabi.mt gdb-5.3/gdb/config/powerpc/ppc-eabi.mt
+--- /usr1/rtems/work-tools/original/gdb-5.3/gdb/config/powerpc/ppc-eabi.mt	Wed May 29 20:21:53 2002
++++ gdb-5.3/gdb/config/powerpc/ppc-eabi.mt	Tue Feb 17 11:50:10 2004
+@@ -1,3 +1,3 @@
+ # Target: PowerPC running eabi
+-TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-sysv-tdep.o solib.o solib-svr4.o
++TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-sysv-tdep.o solib.o solib-svr4.o ppc2dink32-rom.o
+ TM_FILE= tm-ppc-eabi.h
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/gdb/config/powerpc/ppc-sim.mt gdb-5.3/gdb/config/powerpc/ppc-sim.mt
+--- /usr1/rtems/work-tools/original/gdb-5.3/gdb/config/powerpc/ppc-sim.mt	Wed May 29 20:21:53 2002
++++ gdb-5.3/gdb/config/powerpc/ppc-sim.mt	Tue Feb 17 11:50:36 2004
+@@ -1,5 +1,5 @@
+ # Target: PowerPC running eabi and including the simulator
+-TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-sysv-tdep.o solib.o solib-svr4.o
++TDEPFILES= rs6000-tdep.o monitor.o dsrec.o ppcbug-rom.o dink32-rom.o ppc-bdm.o ocd.o remote-sds.o ppc-sysv-tdep.o solib.o solib-svr4.o ppc2dink32-rom.o
+ TM_FILE= tm-ppc-eabi.h
+ 
+ SIM_OBS = remote-sim.o
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/gdb/config/sparc/sparc-em.mt gdb-5.3/gdb/config/sparc/sparc-em.mt
+--- /usr1/rtems/work-tools/original/gdb-5.3/gdb/config/sparc/sparc-em.mt	Thu Apr 15 20:34:25 1999
++++ gdb-5.3/gdb/config/sparc/sparc-em.mt	Tue Feb 17 11:49:11 2004
+@@ -1,3 +1,7 @@
+ # Target: SPARC embedded
+ TDEPFILES= sparc-tdep.o
+ TM_FILE= tm-spc-em.h
++
++SIM_OBS = remote-sim.o
++SIM = ../sim/erc32/libsim.a
++
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/gdb/config/sparc/sun4sol2.mh gdb-5.3/gdb/config/sparc/sun4sol2.mh
+--- /usr1/rtems/work-tools/original/gdb-5.3/gdb/config/sparc/sun4sol2.mh	Thu Jan 17 22:51:08 2002
++++ gdb-5.3/gdb/config/sparc/sun4sol2.mh	Tue Feb 17 11:49:11 2004
+@@ -1,7 +1,7 @@
+ # Host: Sun 4 or Sparcstation, running Solaris 2
+ 
+ XM_FILE= xm-sun4sol2.h
+-XM_CLIBS= -lsocket -lnsl
++XM_CLIBS= -lsocket -lnsl -ldl
+ 
+ NAT_FILE= nm-sun4sol2.h
+ NATDEPFILES= corelow.o core-sol2.o solib.o solib-svr4.o solib-legacy.o \
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/gdb/ppc2dink32-rom.c gdb-5.3/gdb/ppc2dink32-rom.c
+--- /usr1/rtems/work-tools/original/gdb-5.3/gdb/ppc2dink32-rom.c	Wed Dec 31 18:00:00 1969
++++ gdb-5.3/gdb/ppc2dink32-rom.c	Tue Feb 17 11:49:11 2004
+@@ -0,0 +1,201 @@
++/* Remote debugging interface between the DINK32 (PowerPC) ROM monitor 
++   as found on the Radstone PPC2 VMEbus boards and GDB, the GNU debugger.
++   Copyright 1997 Free Software Foundation, Inc.
++
++This file is part of GDB.
++
++This program is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2 of the License, or
++(at your option) any later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; if not, write to the Free Software
++Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++
++#include "defs.h"
++#include "gdbcore.h"
++#include "target.h"
++#include "monitor.h"
++#include "serial.h"
++#include "symfile.h" /* For generic_load() */
++#include "inferior.h" /* For write_pc() */
++#include "regcache.h"
++
++static void ppc2dink32_open PARAMS ((char *args, int from_tty));
++
++static void
++ppc2dink32_supply_register (regname, regnamelen, val, vallen)
++     char *regname;
++     int regnamelen;
++     char *val;
++     int vallen;
++{
++  int regno = 0, base = 0;
++
++  if (regnamelen < 2 || regnamelen > 4)
++    return;
++
++  switch (regname[0])
++    {
++    case 'R':
++      if (regname[1] < '0' || regname[1] > '9')
++	return;
++      if (regnamelen == 2)
++	regno = regname[1] - '0';
++      else if (regnamelen == 3 && regname[2] >= '0' && regname[2] <= '9')
++	regno = (regname[1] - '0') * 10 + (regname[2] - '0');
++      else
++	return;
++      break;
++    case 'F':
++      if (regname[1] != 'R' || regname[2] < '0' || regname[2] > '9')
++	return;
++      if (regnamelen == 3)
++	regno = 32 + regname[2] - '0';
++      else if (regnamelen == 4 && regname[3] >= '0' && regname[3] <= '9')
++	regno = 32 + (regname[2] - '0') * 10 + (regname[3] - '0');
++      else
++	return;
++      break;
++    case 'I':
++      if (regnamelen != 2 || regname[1] != 'P')
++	return;
++      regno = 64;
++      break;
++    case 'M':
++      if (regnamelen != 3 || regname[1] != 'S' || regname[2] != 'R')
++	return;
++      regno = 65;
++      break;
++    case 'C':
++      if (regnamelen != 2 || regname[1] != 'R')
++	return;
++      regno = 66;
++      break;
++    case 'S':
++      if (regnamelen != 4 || regname[1] != 'P' || regname[2] != 'R')
++	return;
++      else if (regname[3] == '8')
++	regno = 67;
++      else if (regname[3] == '9')
++	regno = 68;
++      else if (regname[3] == '1')
++	regno = 69;
++      else if (regname[3] == '0')
++	regno = 70;
++      else
++	return;
++      break;
++    default:
++      return;
++    }
++
++  monitor_supply_register (regno, val);
++}
++
++static void
++ppc2dink32_load (monops, filename, from_tty)
++     struct monitor_ops *monops;
++     char *filename;
++     int from_tty;
++{
++  generic_load (filename, from_tty);
++
++  /* Finally, make the PC point at the start address */
++  if (exec_bfd)
++    write_pc (bfd_get_start_address (exec_bfd));
++
++  inferior_ptid = null_ptid;		/* No process now */
++}
++
++
++/* This array of registers needs to match the indexes used by GDB. The
++   whole reason this exists is because the various ROM monitors use
++   different names than GDB does, and don't support all the registers
++   either.  */
++
++static char *ppc2dink32_regnames[] =
++{
++  "r0",   "r1",   "r2",   "r3",   "r4",   "r5",   "r6",   "r7",
++  "r8",   "r9",   "r10",  "r11",  "r12",  "r13",  "r14",  "r15",
++  "r16",  "r17",  "r18",  "r19",  "r20",  "r21",  "r22",  "r23",
++  "r24",  "r25",  "r26",  "r27",  "r28",  "r29",  "r30",  "r31",
++
++  "f0",   "f1",   "f2",   "f3",   "f4",   "f5",   "f6",   "f7",
++  "f8",   "f9",   "f10",  "f11",  "f12",  "f13",  "f14",  "f15",
++  "f16",  "f17",  "f18",  "f19",  "f20",  "f21",  "f22",  "f23",
++  "f24",  "f25",  "f26",  "f27",  "f28",  "f29",  "f30",  "f31",
++
++  "srr0", "msr",  "cr",   "lr",   "ctr",  "xer",  "xer"
++};
++
++static struct target_ops ppc2dink32_ops;
++
++static char *ppc2dink32_inits[] = {"\r", NULL};
++
++static struct monitor_ops ppc2dink32_cmds;
++
++static void
++ppc2dink32_open (args, from_tty)
++     char *args;
++     int from_tty;
++{
++  monitor_open (args, &ppc2dink32_cmds, from_tty);
++}
++
++void
++_initialize_ppc2dink32_rom ()
++{
++  ppc2dink32_cmds.flags = MO_HEX_PREFIX | MO_GETMEM_NEEDS_RANGE | MO_FILL_USES_ADDR | MO_HANDLE_NL | MO_32_REGS_PAIRED | MO_SETREG_INTERACTIVE | MO_SETMEM_INTERACTIVE | MO_CLR_BREAK_1_BASED | MO_SREC_ACK | MO_SREC_ACK_ROTATE;
++  ppc2dink32_cmds.init = ppc2dink32_inits;
++  ppc2dink32_cmds.cont = "go +\r";
++  ppc2dink32_cmds.step = "tr +\r";
++  ppc2dink32_cmds.set_break = "bp 0x%x\r";
++  ppc2dink32_cmds.clr_break = "bp %d\r";
++#if 0 /* Would need to follow strict alignment rules.. */
++  ppc2dink32_cmds.fill = "mf %x %x %x\r";
++#endif
++  ppc2dink32_cmds.setmem.cmdb = "mm -b %x\r";
++  ppc2dink32_cmds.setmem.cmdw = "mm -h %x\r";
++  ppc2dink32_cmds.setmem.cmdl = "mm %x\r";
++  ppc2dink32_cmds.setmem.term = " ?  ";
++  ppc2dink32_cmds.getmem.cmdb = "md -b %x-%x\r";
++  ppc2dink32_cmds.getmem.cmdw = "md -h %x-%x\r";
++  ppc2dink32_cmds.getmem.cmdl = "md -w %x-%x\r";
++  ppc2dink32_cmds.getmem.resp_delim = "";
++  ppc2dink32_cmds.setreg.cmd = "rm %s\r";
++  ppc2dink32_cmds.setreg.term = " ?  ";
++  ppc2dink32_cmds.getreg.cmd = "rd %s\r";
++  ppc2dink32_cmds.getreg.resp_delim = ": ";
++  ppc2dink32_cmds.dump_registers = "rd r0-r31\r";
++  ppc2dink32_cmds.register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)";
++  ppc2dink32_cmds.supply_register = ppc2dink32_supply_register;
++  /* S-record download, via "keyboard port".  */
++  ppc2dink32_cmds.load = "dl -k\r";
++  ppc2dink32_cmds.loadresp = "Set Input Port : set to Keyboard Port\r";
++#if 0 /* slow load routine not needed if S-records work... */
++  ppc2dink32_cmds.load_routine = ppc2dink32_load;
++#endif
++  ppc2dink32_cmds.prompt = "DINK32 >>";
++  ppc2dink32_cmds.line_term = "\r";
++  ppc2dink32_cmds.target = &ppc2dink32_ops;
++  ppc2dink32_cmds.stopbits = SERIAL_1_STOPBITS;
++  ppc2dink32_cmds.regnames = ppc2dink32_regnames;
++  ppc2dink32_cmds.magic = MONITOR_OPS_MAGIC;
++
++  init_monitor_ops (&ppc2dink32_ops);
++
++  ppc2dink32_ops.to_shortname = "ppc2dink32";
++  ppc2dink32_ops.to_longname = "Radstone PPC2 DINK32 monitor";
++  ppc2dink32_ops.to_doc = "Debug using the Radstone PPC2 DINK32 monitor.\n\
++Specify the serial device it is connected to (e.g. /dev/ttya).";
++  ppc2dink32_ops.to_open = ppc2dink32_open;
++
++  add_target (&ppc2dink32_ops);
++}
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/gdb/rdi-share/hsys.c gdb-5.3/gdb/rdi-share/hsys.c
+--- /usr1/rtems/work-tools/original/gdb-5.3/gdb/rdi-share/hsys.c	Fri Feb 25 10:37:32 2000
++++ gdb-5.3/gdb/rdi-share/hsys.c	Tue Feb 17 11:49:11 2004
+@@ -810,6 +810,7 @@
+     }
+ 
+   case CL_TmpNam:
++#if 0
+     {
+       char *name;
+       unsigned int tnamelen, TargetID;
+@@ -855,6 +856,11 @@
+       Adp_ChannelWrite(CI_CLIB, packet);/* Send message. */
+       return 0;
+     }
++#else
++    DebugPrintF(("CL_TmpNam declared dangerous and unsupported!!\n"));
++    return 0;
++
++#endif
+ 
+   case CL_Unrecognised:
+     DebugPrintF(("CL_Unrecognised!!\n"));
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/sim/configure gdb-5.3/sim/configure
+--- /usr1/rtems/work-tools/original/gdb-5.3/sim/configure	Tue Jul 16 09:30:13 2002
++++ gdb-5.3/sim/configure	Tue Feb 17 11:49:11 2004
+@@ -30,7 +30,6 @@
+ program_transform_name=s,x,x,
+ silent=
+ site=
+-sitefile=
+ srcdir=
+ target=NONE
+ verbose=
+@@ -145,7 +144,6 @@
+   --help                  print this message
+   --no-create             do not create output files
+   --quiet, --silent       do not print \`checking...' messages
+-  --site-file=FILE        use FILE as the site file
+   --version               print the version of autoconf that created configure
+ Directory and file names:
+   --prefix=PREFIX         install architecture-independent files in PREFIX
+@@ -316,11 +314,6 @@
+   -site=* | --site=* | --sit=*)
+     site="$ac_optarg" ;;
+ 
+-  -site-file | --site-file | --site-fil | --site-fi | --site-f)
+-    ac_prev=sitefile ;;
+-  -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+-    sitefile="$ac_optarg" ;;
+-
+   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+     ac_prev=srcdir ;;
+   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+@@ -486,16 +479,12 @@
+ srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+ 
+ # Prefer explicitly selected file to automatically selected ones.
+-if test -z "$sitefile"; then
+-  if test -z "$CONFIG_SITE"; then
+-    if test "x$prefix" != xNONE; then
+-      CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+-    else
+-      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+-    fi
++if test -z "$CONFIG_SITE"; then
++  if test "x$prefix" != xNONE; then
++    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
++  else
++    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+   fi
+-else
+-  CONFIG_SITE="$sitefile"
+ fi
+ for ac_site_file in $CONFIG_SITE; do
+   if test -r "$ac_site_file"; then
+@@ -538,7 +527,7 @@
+ # Extract the first word of "gcc", so it can be a program name with args.
+ set dummy gcc; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:542: checking for $ac_word" >&5
++echo "configure:531: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -568,7 +557,7 @@
+   # Extract the first word of "cc", so it can be a program name with args.
+ set dummy cc; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:572: checking for $ac_word" >&5
++echo "configure:561: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -619,7 +608,7 @@
+       # Extract the first word of "cl", so it can be a program name with args.
+ set dummy cl; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:623: checking for $ac_word" >&5
++echo "configure:612: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -651,7 +640,7 @@
+ fi
+ 
+ echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+-echo "configure:655: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
++echo "configure:644: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+ 
+ ac_ext=c
+ # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+@@ -662,12 +651,12 @@
+ 
+ cat > conftest.$ac_ext << EOF
+ 
+-#line 666 "configure"
++#line 655 "configure"
+ #include "confdefs.h"
+ 
+ main(){return(0);}
+ EOF
+-if { (eval echo configure:671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+   ac_cv_prog_cc_works=yes
+   # If we can't run a trivial program, we are probably using a cross compiler.
+   if (./conftest; exit) 2>/dev/null; then
+@@ -693,12 +682,12 @@
+   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+-echo "configure:697: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
++echo "configure:686: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+ echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+ cross_compiling=$ac_cv_prog_cc_cross
+ 
+ echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+-echo "configure:702: checking whether we are using GNU C" >&5
++echo "configure:691: checking whether we are using GNU C" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -707,7 +696,7 @@
+   yes;
+ #endif
+ EOF
+-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+   ac_cv_prog_gcc=yes
+ else
+   ac_cv_prog_gcc=no
+@@ -726,7 +715,7 @@
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+-echo "configure:730: checking whether ${CC-cc} accepts -g" >&5
++echo "configure:719: checking whether ${CC-cc} accepts -g" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -788,7 +777,7 @@
+ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+ # ./install, which can be erroneously created by make from ./install.sh.
+ echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+-echo "configure:792: checking for a BSD compatible install" >&5
++echo "configure:781: checking for a BSD compatible install" >&5
+ if test -z "$INSTALL"; then
+ if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+@@ -847,7 +836,7 @@
+ fi
+ 
+ echo $ac_n "checking host system type""... $ac_c" 1>&6
+-echo "configure:851: checking host system type" >&5
++echo "configure:840: checking host system type" >&5
+ 
+ host_alias=$host
+ case "$host_alias" in
+@@ -868,7 +857,7 @@
+ echo "$ac_t""$host" 1>&6
+ 
+ echo $ac_n "checking build system type""... $ac_c" 1>&6
+-echo "configure:872: checking build system type" >&5
++echo "configure:861: checking build system type" >&5
+ 
+ build_alias=$build
+ case "$build_alias" in
+@@ -894,7 +883,7 @@
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}ar; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:898: checking for $ac_word" >&5
++echo "configure:887: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -926,7 +915,7 @@
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:930: checking for $ac_word" >&5
++echo "configure:919: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -958,7 +947,7 @@
+   # Extract the first word of "ranlib", so it can be a program name with args.
+ set dummy ranlib; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:962: checking for $ac_word" >&5
++echo "configure:951: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1038,7 +1027,7 @@
+ fi
+ 
+ echo $ac_n "checking host system type""... $ac_c" 1>&6
+-echo "configure:1042: checking host system type" >&5
++echo "configure:1031: checking host system type" >&5
+ 
+ host_alias=$host
+ case "$host_alias" in
+@@ -1059,7 +1048,7 @@
+ echo "$ac_t""$host" 1>&6
+ 
+ echo $ac_n "checking target system type""... $ac_c" 1>&6
+-echo "configure:1063: checking target system type" >&5
++echo "configure:1052: checking target system type" >&5
+ 
+ target_alias=$target
+ case "$target_alias" in
+@@ -1077,7 +1066,7 @@
+ echo "$ac_t""$target" 1>&6
+ 
+ echo $ac_n "checking build system type""... $ac_c" 1>&6
+-echo "configure:1081: checking build system type" >&5
++echo "configure:1070: checking build system type" >&5
+ 
+ build_alias=$build
+ case "$build_alias" in
+@@ -1121,7 +1110,7 @@
+ # Extract the first word of "gcc", so it can be a program name with args.
+ set dummy gcc; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1125: checking for $ac_word" >&5
++echo "configure:1114: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1151,7 +1140,7 @@
+   # Extract the first word of "cc", so it can be a program name with args.
+ set dummy cc; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1155: checking for $ac_word" >&5
++echo "configure:1144: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1202,7 +1191,7 @@
+       # Extract the first word of "cl", so it can be a program name with args.
+ set dummy cl; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1206: checking for $ac_word" >&5
++echo "configure:1195: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1234,7 +1223,7 @@
+ fi
+ 
+ echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+-echo "configure:1238: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
++echo "configure:1227: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+ 
+ ac_ext=c
+ # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+@@ -1245,12 +1234,12 @@
+ 
+ cat > conftest.$ac_ext << EOF
+ 
+-#line 1249 "configure"
++#line 1238 "configure"
+ #include "confdefs.h"
+ 
+ main(){return(0);}
+ EOF
+-if { (eval echo configure:1254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
++if { (eval echo configure:1243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+   ac_cv_prog_cc_works=yes
+   # If we can't run a trivial program, we are probably using a cross compiler.
+   if (./conftest; exit) 2>/dev/null; then
+@@ -1276,12 +1265,12 @@
+   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+-echo "configure:1280: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
++echo "configure:1269: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+ echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+ cross_compiling=$ac_cv_prog_cc_cross
+ 
+ echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+-echo "configure:1285: checking whether we are using GNU C" >&5
++echo "configure:1274: checking whether we are using GNU C" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1290,7 +1279,7 @@
+   yes;
+ #endif
+ EOF
+-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+   ac_cv_prog_gcc=yes
+ else
+   ac_cv_prog_gcc=no
+@@ -1309,7 +1298,7 @@
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+-echo "configure:1313: checking whether ${CC-cc} accepts -g" >&5
++echo "configure:1302: checking whether ${CC-cc} accepts -g" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1347,7 +1336,7 @@
+ # Extract the first word of "ranlib", so it can be a program name with args.
+ set dummy ranlib; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+-echo "configure:1351: checking for $ac_word" >&5
++echo "configure:1340: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+@@ -1449,7 +1438,8 @@
+ 	;;
+   sh*-*-*)		sim_target=sh ;;
+   powerpc*-*-eabi* | powerpc*-*-solaris* | powerpc*-*-sysv4* | \
+-  powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* )
++  powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* | \
++  powerpc*-*-rtems*)
+ 	# The PowerPC simulator uses the GCC extension long long as well as
+ 	# ANSI prototypes, so don't enable it for random host compilers
+ 	# unless asked to.
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/sim/configure.in gdb-5.3/sim/configure.in
+--- /usr1/rtems/work-tools/original/gdb-5.3/sim/configure.in	Tue Jul 16 09:30:13 2002
++++ gdb-5.3/sim/configure.in	Tue Feb 17 11:49:11 2004
+@@ -88,7 +88,8 @@
+ 	;;
+   sh*-*-*)		sim_target=sh ;;
+   powerpc*-*-eabi* | powerpc*-*-solaris* | powerpc*-*-sysv4* | \
+-  powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* )
++  powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* | \
++  powerpc*-*-rtems*)
+ 	# The PowerPC simulator uses the GCC extension long long as well as
+ 	# ANSI prototypes, so don't enable it for random host compilers
+ 	# unless asked to.
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/sim/erc32/Makefile.in gdb-5.3/sim/erc32/Makefile.in
+--- /usr1/rtems/work-tools/original/gdb-5.3/sim/erc32/Makefile.in	Tue Mar  7 09:32:49 2000
++++ gdb-5.3/sim/erc32/Makefile.in	Tue Feb 17 11:49:11 2004
+@@ -24,7 +24,7 @@
+ SIM_OBJS = exec.o erc32.o func.o help.o float.o interf.o
+ SIM_EXTRA_LIBS = ../../readline/libreadline.a  $(TERMCAP_LIB) -lm
+ SIM_EXTRA_LIBDEPS = ../../readline/libreadline.a
+-SIM_EXTRA_ALL = sis
++SIM_EXTRA_ALL = sis$(EXEEXT)
+ SIM_EXTRA_INSTALL = install-sis
+ SIM_EXTRA_CLEAN = clean-sis
+ 
+@@ -35,11 +35,13 @@
+ 
+ ## COMMON_POST_CONFIG_FRAG
+ 
++EXEEXT = @EXEEXT@
++
+ # `sis' doesn't need interf.o.
+ SIS_OFILES = exec.o erc32.o func.o help.o float.o
+ 
+-sis: sis.o $(SIS_OFILES) $(COMMON_OBJS) $(LIBDEPS)
+-	$(CC) $(ALL_CFLAGS) -o sis \
++sis$(EXEEXT): sis.o $(SIS_OFILES) $(COMMON_OBJS) $(LIBDEPS)
++	$(CC) $(ALL_CFLAGS) -o sis$(EXEEXT) \
+ 	  sis.o $(SIS_OFILES) $(COMMON_OBJS) $(EXTRA_LIBS)
+ 
+ # FIXME: This computes the build host's endianness, doesn't it?
+@@ -56,7 +58,7 @@
+ 	$(INSTALL_PROGRAM) sis$(EXEEXT) $(bindir)/$$n$(EXEEXT)
+ 
+ clean-sis:
+-	rm -f sis end end.h
++	rm -f sis$(EXEEXT) end end.h
+ 
+ configure:
+ 	@echo "Rebuilding configure..."
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/sim/erc32/configure.in gdb-5.3/sim/erc32/configure.in
+--- /usr1/rtems/work-tools/original/gdb-5.3/sim/erc32/configure.in	Mon Apr 26 13:31:58 1999
++++ gdb-5.3/sim/erc32/configure.in	Tue Feb 17 11:49:11 2004
+@@ -21,4 +21,7 @@
+ fi
+ AC_SUBST(TERMCAP)
+ 
++dnl Check for exe extension
++AC_EXEEXT
++
+ SIM_AC_OUTPUT
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/sim/ppc/ChangeLog gdb-5.3/sim/ppc/ChangeLog
+--- /usr1/rtems/work-tools/original/gdb-5.3/sim/ppc/ChangeLog	Fri Sep 27 16:02:10 2002
++++ gdb-5.3/sim/ppc/ChangeLog	Tue Feb 17 11:53:36 2004
+@@ -1,3 +1,11 @@
++Wed Apr 29 13:54:04 CDT 1998  Joel Sherrill <joel@OARcorp.com>
++
++	* hw_sem.c: New file. Interfaces to UNIX shared memory.
++	* hw_shm.c: New file. Interfaces to UNIX semaphores.
++	* debug.c (trace_description): Added sem and shm entries.
++	* debug.h (trace_options): Added sem and shm entries.
++	* configure.in, configure (sim-hardware): Added sem and shm entries.
++
+ 2002-09-27  Andrew Cagney  <ac131313@redhat.com>
+ 
+ 	* hw_disk.c (hw_disk_init_address): Set device type to "block",
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/sim/ppc/configure.in gdb-5.3/sim/ppc/configure.in
+--- /usr1/rtems/work-tools/original/gdb-5.3/sim/ppc/configure.in	Sun Dec 16 15:00:08 2001
++++ gdb-5.3/sim/ppc/configure.in	Tue Feb 17 11:49:11 2004
+@@ -200,10 +200,105 @@
+   echo "Setting float flags = $sim_float" 6>&1
+ fi],[sim_float=""])dnl
+ 
++AC_CACHE_CHECK([if union semun defined],
++  ac_cv_HAS_UNION_SEMUN,
++  [AC_TRY_COMPILE([
++#include <sys/types.h>
++#include <sys/ipc.h>
++#include <sys/sem.h>],
++[union semun arg ;],
++[ac_cv_has_union_semun="yes"],
++[ac_cv_has_union_semun="no"])
++AC_MSG_RESULT($ac_cv_has_union_semun)
++])
++
++
++if test "$ac_cv_has_union_semun" = "yes"; then
++  AC_CACHE_CHECK(whether System V semaphores are supported,
++  ac_cv_sysv_sem,
++  [
++  AC_TRY_RUN(
++  [
++  #include <sys/types.h>
++  #include <sys/ipc.h>
++  #include <sys/sem.h>
++  int main () {
++    union semun arg ;
++
++    int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
++    if (id == -1)
++      exit(1);
++    arg.val = 0; /* avoid implicit type cast to union */
++    if (semctl(id, 0, IPC_RMID, arg) == -1)
++      exit(1);
++    exit(0);
++  }
++  ],
++  ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
++  ])
++else  # semun is not defined
++  AC_CACHE_CHECK(whether System V semaphores are supported,
++  ac_cv_sysv_sem,
++  [
++  AC_TRY_RUN(
++  [
++  #include <sys/types.h>
++  #include <sys/ipc.h>
++  #include <sys/sem.h>
++  union semun {
++    int val;
++    struct semid_ds *buf;
++    ushort *array;
++  };
++  int main () {
++    union semun arg ;
++
++    int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
++    if (id == -1)
++      exit(1);
++    arg.val = 0; /* avoid implicit type cast to union */
++    if (semctl(id, 0, IPC_RMID, arg) == -1)
++      exit(1);
++    exit(0);
++  }
++  ],
++  ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
++  ])
++fi
++
++AC_CACHE_CHECK(whether System V shared memory is supported,
++ac_cv_sysv_shm,
++[
++AC_TRY_RUN([
++#include <sys/types.h>
++#include <sys/ipc.h>
++#include <sys/shm.h>
++int main () {
++  int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
++  if (id == -1)
++    exit(1);
++  if (shmctl(id, IPC_RMID, 0) == -1)
++    exit(1);
++  exit(0);
++}
++],
++ac_cv_sysv_shm="yes", ac_cv_sysv_shm="no", :)
++])
++
++if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
++  sim_sysv_ipc_hw=",sem,shm";
++else
++  sim_sysv_ipc_hw="";
++fi
++
++if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
++  sim_hwflags="-DHAS_UNION_SEMUN";
++fi
++
+ 
+ AC_ARG_ENABLE(sim-hardware,
+ [  --enable-sim-hardware=list		Specify the hardware to be included in the build.],
+-[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
++[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
+ case "${enableval}" in
+   yes)	;;
+   no)	AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
+@@ -215,14 +310,13 @@
+ sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
+ if test x"$silent" != x"yes" && test x"$hardware" != x""; then
+   echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
+-fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
++fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
+ sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
+ sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
+ if test x"$silent" != x"yes"; then
+   echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
+ fi])dnl
+ 
+-
+ AC_ARG_ENABLE(sim-hostbitsize,
+ [  --enable-sim-hostbitsize=32|64	Specify host bitsize (32 or 64).],
+ [case "${enableval}" in
+@@ -704,6 +798,7 @@
+ AC_EXEEXT
+ 
+ AC_SUBST(CC_FOR_BUILD)
++AC_SUBST(sim_hwflags)
+ AC_SUBST(CFLAGS)
+ AC_SUBST(HDEFINES)
+ AR=${AR-ar}
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/sim/ppc/debug.c gdb-5.3/sim/ppc/debug.c
+--- /usr1/rtems/work-tools/original/gdb-5.3/sim/ppc/debug.c	Thu Apr 15 20:35:08 1999
++++ gdb-5.3/sim/ppc/debug.c	Tue Feb 17 11:49:11 2004
+@@ -70,6 +70,8 @@
+   { trace_pass_device, "pass-device" },
+   { trace_phb_device, "phb-device" },
+   { trace_register_device, "register-device", "Device initializing registers" },
++  { trace_sem_device, "sem-device" },
++  { trace_shm_device, "shm-device" },
+   { trace_stack_device, "stack-device" },
+   { trace_vm_device, "vm-device" },
+   /* packages */
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/sim/ppc/debug.h gdb-5.3/sim/ppc/debug.h
+--- /usr1/rtems/work-tools/original/gdb-5.3/sim/ppc/debug.h	Thu Apr 15 20:35:08 1999
++++ gdb-5.3/sim/ppc/debug.h	Tue Feb 17 11:49:11 2004
+@@ -51,6 +51,8 @@
+   trace_pal_device,
+   trace_pass_device,
+   trace_phb_device,
++  trace_sem_device,
++  trace_shm_device,
+   trace_stack_device,
+   trace_register_device,
+   trace_vm_device,
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/sim/ppc/hw_sem.c gdb-5.3/sim/ppc/hw_sem.c
+--- /usr1/rtems/work-tools/original/gdb-5.3/sim/ppc/hw_sem.c	Wed Dec 31 18:00:00 1969
++++ gdb-5.3/sim/ppc/hw_sem.c	Tue Feb 17 11:49:11 2004
+@@ -0,0 +1,320 @@
++/*  This file is part of the program psim.
++
++    Copyright (C) 1997, Joel Sherrill <joel@OARcorp.com>
++
++    This program is free software; you can redistribute it and/or modify
++    it under the terms of the GNU General Public License as published by
++    the Free Software Foundation; either version 2 of the License, or
++    (at your option) any later version.
++
++    This program is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++    GNU General Public License for more details.
++ 
++    You should have received a copy of the GNU General Public License
++    along with this program; if not, write to the Free Software
++    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ 
++    */
++
++
++#ifndef _HW_SEM_C_
++#define _HW_SEM_C_
++
++#include "device_table.h"
++
++#ifdef HAVE_STRING_H
++#include <string.h>
++#else
++#ifdef HAVE_STRINGS_H
++#include <strings.h>
++#endif
++#endif
++
++#include <sys/ipc.h>
++#include <sys/sem.h>
++
++#include <errno.h> /* XXX temporary */
++
++/* DEVICE
++
++
++   sem - provide access to a unix semaphore
++
++
++   DESCRIPTION
++
++
++   This device implements an interface to a unix semaphore.
++
++
++   PROPERTIES
++
++
++   reg = <address> <size> (required)
++
++   Determine where the memory lives in the parents address space.
++
++   key = <integer> (required)
++
++   This is the key of the unix semaphore.
++
++   EXAMPLES
++
++
++   Enable tracing of the sem:
++
++   |  bash$ psim -t sem \
++
++
++   Configure a UNIX semaphore using key 0x12345678 mapped into psim
++   address space at 0xfff00000:
++
++   |  -o '/sem@0xfff00000/reg 0xfff00000 0x80000' \
++   |  -o '/sem@0xfff00000/key 0x12345678' \
++
++   sim/ppc/run -o '/#address-cells 1' \
++         -o '/sem@0xc0000000/reg 0xc0000000 0x80000' \
++         -o '/sem@0xc0000000/key 0x12345678' ../psim-hello/hello
++
++   REGISTERS
++
++   offset 0 - lock count
++   offset 4 - lock operation   (reads count)
++   offset 8 - unlock operation (reads count)
++
++   BUGS
++
++   Only one of these can exist in a system.  I do not know how to map a
++   unique set of properties to each instance.
++
++   */
++
++typedef struct _hw_sem_device {
++  unsigned_word  physical_address;
++  key_t          key;
++  int            id;
++  int            count;
++} hw_sem_device;
++
++static void
++hw_sem_init_data(device *me)
++{
++  hw_sem_device *sem = (hw_sem_device*)device_data(me);
++  int value;
++  int status;
++#if !HAS_UNION_SEMUN
++        union semun {
++          int val;
++          struct semid_ds *buf;
++          unsigned short int *array;
++#if defined(__linux__)
++          struct seminfo *__buf;
++#endif
++        } ;
++#endif
++  union semun help;
++
++  /* initialize the properties of the sem */
++
++  if (device_find_property(me, "key") == NULL)
++    error("sem_init_data() required key property is missing\n");
++
++  if (device_find_property(me, "value") == NULL)
++    error("sem_init_data() required value property is missing\n");
++
++  sem->key = (key_t) device_find_integer_property(me, "key");
++  DTRACE(sem, ("semaphore key (%d)\n", sem->key) );
++
++  value = (int) device_find_integer_property(me, "value");
++  DTRACE(sem, ("semaphore value (%d)\n", value) );
++
++  /* Now to initialize the shared memory area */
++
++  if ( value != -1 ) {
++
++    sem->id = semget(sem->key, 1, IPC_CREAT | 0660);
++    if (sem->id == -1)
++      error("hw_sem_init_data() semget failed\n");
++
++    help.val = value;
++    status = semctl( sem->id, 0, SETVAL, help );
++    if (status == -1)
++      error("hw_sem_init_data() semctl -- set value failed\n");
++
++  } else {
++    sem->id = semget(sem->key, 1, 0660);
++    if (sem->id == -1)
++      error("hw_sem_init_data() semget failed\n");
++  }
++
++  sem->physical_address = 0xc0010000;  /* XXX hack */
++
++  sem->count = semctl( sem->id, 0, GETVAL, help );
++  if (sem->count == -1)
++    error("hw_sem_init_data() semctl -- get value failed\n");
++  DTRACE(sem, ("semaphore OS value (%d)\n", sem->count) );
++
++  if (sizeof(int) != 4)
++    error("hw_sem_init_data() typing problem\n");
++
++  /* we assume that the feedback process initializes the semaphore */
++}
++
++static void
++hw_sem_attach_address_callback(device *me,
++				attach_type attach,
++				int space,
++				unsigned_word addr,
++				unsigned nr_bytes,
++				access_type access,
++				device *client) /*callback/default*/
++{
++  hw_sem_device *sem = (hw_sem_device*)device_data(me);
++
++  if (space != 0)
++    error("sem_attach_address_callback() invalid address space\n");
++
++  if (nr_bytes == 12)
++    error("sem_attach_address_callback() invalid size\n");
++
++  sem->physical_address = addr;
++  DTRACE(sem, ("semaphore physical_address=0x%x\n", addr));
++
++}
++
++static unsigned
++hw_sem_io_read_buffer(device *me,
++			 void *dest,
++			 int space,
++			 unsigned_word addr,
++			 unsigned nr_bytes,
++			 cpu *processor,
++			 unsigned_word cia)
++{
++  hw_sem_device *sem = (hw_sem_device*)device_data(me);
++  struct sembuf sb;
++  int status;
++  unsigned32 u32;
++#if !HAS_UNION_SEMUN
++        union semun {
++          int val;
++          struct semid_ds *buf;
++          unsigned short int *array;
++#if defined(__linux__)
++          struct seminfo *__buf;
++#endif
++        } ;
++#endif
++  union semun help;
++
++  /* do we need to worry about out of range addresses? */
++
++  DTRACE(sem, ("semaphore read addr=0x%x length=%d\n", addr, nr_bytes));
++
++  if (!(addr >= sem->physical_address && addr <= sem->physical_address + 11))
++    error("hw_sem_io_read_buffer() invalid address - out of range\n");
++
++  if ((addr % 4) != 0)
++    error("hw_sem_io_read_buffer() invalid address - alignment\n");
++
++  if (nr_bytes != 4)
++    error("hw_sem_io_read_buffer() invalid length\n");
++
++  switch ( (addr - sem->physical_address) / 4 ) {
++
++    case 0:
++      break; 
++
++    case 1:  /* LOCK */
++      /*
++       *  Check for this process nesting the lock
++       */
++
++      sb.sem_num = 0;
++      sb.sem_op  = -1;
++      sb.sem_flg = 0;
++
++      status = semop(sem->id, &sb, 1);
++      if (status == -1) {
++        perror( "hw_sem.c: lock" );
++        fprintf( stderr, "Actual error number = %d\n", errno );
++        error("hw_sem_io_read_buffer() sem lock\n");
++      }
++
++      DTRACE(sem, ("semaphore lock %d\n", sem->count));
++      break; 
++
++    case 2: /* UNLOCK */
++/*
++      u32 = semctl( sem->id, 0, GETVAL, NULL );
++      if ( u32 != 1 ) {
++         fprintf( stderr, "unlock --- count = %d\n", u32 );
++      }
++*/
++      /*
++       *  Check for this process nesting the lock
++       */
++
++      sb.sem_num = 0;
++      sb.sem_op  = 1;
++      sb.sem_flg = 0;
++
++      status = semop(sem->id, &sb, 1);
++      if (status == -1) {
++        perror( "hw_sem.c: unlock" );
++        fprintf( stderr, "Actual error number = %d\n", errno );
++        error("hw_sem_io_read_buffer() sem unlock\n");
++      }
++      DTRACE(sem, ("semaphore unlock %d\n", sem->count));
++      break; 
++
++    default:
++      error("hw_sem_io_read_buffer() invalid address - unknown error\n");
++      break; 
++  }
++
++  /* XXX endian assumption here -- assume target is big endian */
++  
++  u32 = H2T_4(semctl( sem->id, 0, GETVAL, help ));
++
++  DTRACE(sem, ("semaphore OS value (%d)\n", u32) );
++  if (u32 == 0xffffffff) {
++    perror( "hw_sem.c: getval" );
++    error("hw_sem_io_read_buffer() semctl -- get value failed\n");
++  }
++
++  memcpy(dest, &u32, nr_bytes);
++  return nr_bytes;
++
++}
++
++
++static device_callbacks const hw_sem_callbacks = {
++  { generic_device_init_address, hw_sem_init_data },
++  { hw_sem_attach_address_callback, }, /* address */
++  { hw_sem_io_read_buffer, NULL }, /* IO */
++  { NULL, }, /* DMA */
++  { NULL, }, /* interrupt */
++  { NULL, }, /* unit */
++  NULL,
++};
++
++static void *
++hw_sem_create(const char *name,
++		 const device_unit *unit_address,
++		 const char *args)
++{
++  hw_sem_device *sem = ZALLOC(hw_sem_device);
++  return sem;
++}
++
++
++
++const device_descriptor hw_sem_device_descriptor[] = {
++  { "sem", hw_sem_create, &hw_sem_callbacks },
++  { NULL },
++};
++
++#endif /* _HW_SEM_C_ */
+diff -uNr /usr1/rtems/work-tools/original/gdb-5.3/sim/ppc/hw_shm.c gdb-5.3/sim/ppc/hw_shm.c
+--- /usr1/rtems/work-tools/original/gdb-5.3/sim/ppc/hw_shm.c	Wed Dec 31 18:00:00 1969
++++ gdb-5.3/sim/ppc/hw_shm.c	Tue Feb 17 11:49:11 2004
+@@ -0,0 +1,228 @@
++/*  This file is part of the program psim.
++
++    Copyright (C) 1997, Joel Sherrill <joel@OARcorp.com>
++
++    This program is free software; you can redistribute it and/or modify
++    it under the terms of the GNU General Public License as published by
++    the Free Software Foundation; either version 2 of the License, or
++    (at your option) any later version.
++
++    This program is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++    GNU General Public License for more details.
++ 
++    You should have received a copy of the GNU General Public License
++    along with this program; if not, write to the Free Software
++    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ 
++    */
++
++
++#ifndef _HW_SHM_C_
++#define _HW_SHM_C_
++
++#include "device_table.h"
++
++#ifdef HAVE_STRING_H
++#include <string.h>
++#else
++#ifdef HAVE_STRINGS_H
++#include <strings.h>
++#endif
++#endif
++
++#include <sys/ipc.h>
++#include <sys/shm.h>
++
++
++/* DEVICE
++
++
++   shm - map unix shared memory into psim address space
++
++
++   DESCRIPTION
++
++
++   This device implements an area of memory which is mapped into UNIX
++   shared memory.
++
++
++   PROPERTIES
++
++
++   reg = <address> <size> (required)
++
++   Determine where the memory lives in the parents address space.
++   The SHM area is assumed to be of the same length.
++
++   key = <integer> (required)
++
++   This is the key of the unix shared memory area.
++
++   EXAMPLES
++
++
++   Enable tracing of the shm:
++
++   |  bash$ psim -t shm \
++
++
++   Configure a 64 kilobytes of UNIX shared memory with the key 0x12345678
++   mapped into psim address space at 0xfff00000.
++
++   |  -o '/shm@0xfff00000/reg 0xfff00000 0x80000' \
++   |  -o '/shm@0xfff00000/key 0x12345678' \
++
++   sim/ppc/run -o '/#address-cells 1' \
++         -o '/shm@0xc0000000/reg 0xc0000000 0x80000' \
++         -o '/shm@0xc0000000/key 0x12345678' ../psim-hello/hello
++
++   BUGS
++
++   Only one of these can exist in a system.  I do not know how to map a
++   unique set of properties to each instance.
++
++   */
++
++typedef struct _hw_shm_device {
++  unsigned_word  physical_address;
++  char          *shm_address;
++  unsigned       sizeof_memory;
++  key_t          key;
++  int            id;
++} hw_shm_device;
++
++static void
++hw_shm_init_data(device *me)
++{
++  hw_shm_device *shm = (hw_shm_device*)device_data(me);
++
++  /* initialize the properties of the shm */
++
++  if (device_find_property(me, "key") == NULL)
++    error("shm_init_data() required key property is missing\n");
++
++  shm->key = (key_t) device_find_integer_property(me, "key");
++  /* printf( "key=0x%x\n", shm->key ); */
++
++  shm->physical_address = 0xc0000000;
++  shm->sizeof_memory = 0x10000;
++
++  /* Now to initialize the shared memory area */
++
++  shm->id = shmget(shm->key, shm->sizeof_memory, IPC_CREAT | 0660);
++  if (shm->id == -1)
++    error("hw_shm_init_data() shmget failed\n");
++
++  shm->shm_address = shmat(shm->id, (char *)0, SHM_RND);
++  if (shm->shm_address == (void *)-1)
++    error("hw_shm_init_data() shmat failed\n");
++}
++
++static void
++hw_shm_attach_address_callback(device *me,
++				attach_type attach,
++				int space,
++				unsigned_word addr,
++				unsigned nr_bytes,
++				access_type access,
++				device *client) /*callback/default*/
++{
++  hw_shm_device *shm = (hw_shm_device*)device_data(me);
++
++  if (space != 0)
++    error("shm_attach_address_callback() invalid address space\n");
++
++  if (nr_bytes == 0)
++    error("shm_attach_address_callback() invalid size\n");
++
++  shm->physical_address = addr;
++  shm->sizeof_memory = nr_bytes;
++
++  /* Now to initialize the shared memory area */
++
++printf( "attaching\n" );
++  shm->id = shmget(shm->key, shm->sizeof_memory, IPC_CREAT | 0660);
++  if (shm->id == -1)
++    error("shm_attach_address_callback() shmget failed\n");
++
++  shm->shm_address = shmat(shm->id, (char *)0, SHM_RND);
++  if (shm->shm_address == (void *)-1)
++    error("shm_attach_address_callback() shmat failed\n");
++}
++
++
++static unsigned
++hw_shm_io_read_buffer(device *me,
++			 void *dest,
++			 int space,
++			 unsigned_word addr,
++			 unsigned nr_bytes,
++			 cpu *processor,
++			 unsigned_word cia)
++{
++  hw_shm_device *shm = (hw_shm_device*)device_data(me);
++
++  /* do we need to worry about out of range addresses? */
++
++/*
++  printf( "read %p %x %x %x\n", shm->shm_address, shm->physical_address,
++                               addr, nr_bytes );
++*/
++  memcpy(dest, &shm->shm_address[addr - shm->physical_address], nr_bytes);
++  return nr_bytes;
++}
++
++
++static unsigned
++hw_shm_io_write_buffer(device *me,
++			  const void *source,
++			  int space,
++			  unsigned_word addr,
++			  unsigned nr_bytes,
++			  cpu *processor,
++			  unsigned_word cia)
++{
++  hw_shm_device *shm = (hw_shm_device*)device_data(me);
++
++  /* do we need to worry about out of range addresses? */
++
++/*
++  printf( "write %p %p %x %x %x\n",
++        shm->shm_address, &shm->shm_address[addr - shm->physical_address],
++        shm->physical_address, addr, nr_bytes );
++*/
++  memcpy(&shm->shm_address[addr - shm->physical_address], source, nr_bytes);
++  return nr_bytes;
++}
++
++static device_callbacks const hw_shm_callbacks = {
++  { generic_device_init_address, hw_shm_init_data },
++  { hw_shm_attach_address_callback, }, /* address */
++  { hw_shm_io_read_buffer,
++    hw_shm_io_write_buffer }, /* IO */
++  { NULL, }, /* DMA */
++  { NULL, }, /* interrupt */
++  { NULL, }, /* unit */
++  NULL,
++};
++
++static void *
++hw_shm_create(const char *name,
++		 const device_unit *unit_address,
++		 const char *args)
++{
++  hw_shm_device *shm = ZALLOC(hw_shm_device);
++  return shm;
++}
++
++
++
++const device_descriptor hw_shm_device_descriptor[] = {
++  { "shm", hw_shm_create, &hw_shm_callbacks },
++  { NULL },
++};
++
++#endif /* _HW_SHM_C_ */
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/sim/configure gdb-6.0/sim/configure
--- /usr1/rtems/work-tools/original/gdb-6.0/sim/configure	Sun Apr 13 11:44:57 2003
+++ gdb-6.0/sim/configure	Tue Feb 17 12:43:37 2004
@@ -30,7 +30,6 @@
 program_transform_name=s,x,x,
 silent=
 site=
-sitefile=
 srcdir=
 target=NONE
 verbose=
@@ -145,7 +144,6 @@
   --help                  print this message
   --no-create             do not create output files
   --quiet, --silent       do not print \`checking...' messages
-  --site-file=FILE        use FILE as the site file
   --version               print the version of autoconf that created configure
 Directory and file names:
   --prefix=PREFIX         install architecture-independent files in PREFIX
@@ -316,11 +314,6 @@
   -site=* | --site=* | --sit=*)
     site="$ac_optarg" ;;
 
-  -site-file | --site-file | --site-fil | --site-fi | --site-f)
-    ac_prev=sitefile ;;
-  -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
-    sitefile="$ac_optarg" ;;
-
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -486,16 +479,12 @@
 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
 
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
-  if test -z "$CONFIG_SITE"; then
-    if test "x$prefix" != xNONE; then
-      CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-    else
-      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-    fi
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
   fi
-else
-  CONFIG_SITE="$sitefile"
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
@@ -538,7 +527,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:542: checking for $ac_word" >&5
+echo "configure:531: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -568,7 +557,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:572: checking for $ac_word" >&5
+echo "configure:561: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -619,7 +608,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:623: checking for $ac_word" >&5
+echo "configure:612: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -651,7 +640,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:655: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:644: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -662,12 +651,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 666 "configure"
+#line 655 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -693,12 +682,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:697: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:686: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:702: checking whether we are using GNU C" >&5
+echo "configure:691: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -707,7 +696,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -726,7 +715,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:730: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:719: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -788,7 +777,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:792: checking for a BSD compatible install" >&5
+echo "configure:781: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -847,7 +836,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:851: checking host system type" >&5
+echo "configure:840: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -868,7 +857,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:872: checking build system type" >&5
+echo "configure:861: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -894,7 +883,7 @@
 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:898: checking for $ac_word" >&5
+echo "configure:887: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -926,7 +915,7 @@
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:930: checking for $ac_word" >&5
+echo "configure:919: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -958,7 +947,7 @@
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:962: checking for $ac_word" >&5
+echo "configure:951: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1038,7 +1027,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1042: checking host system type" >&5
+echo "configure:1031: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -1059,7 +1048,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1063: checking target system type" >&5
+echo "configure:1052: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -1077,7 +1066,7 @@
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1081: checking build system type" >&5
+echo "configure:1070: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -1121,7 +1110,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1125: checking for $ac_word" >&5
+echo "configure:1114: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1151,7 +1140,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1155: checking for $ac_word" >&5
+echo "configure:1144: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1202,7 +1191,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1206: checking for $ac_word" >&5
+echo "configure:1195: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1234,7 +1223,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1238: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1227: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1245,12 +1234,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1249 "configure"
+#line 1238 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1276,12 +1265,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1280: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1269: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1285: checking whether we are using GNU C" >&5
+echo "configure:1274: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1290,7 +1279,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1309,7 +1298,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1313: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1302: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1347,7 +1336,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1351: checking for $ac_word" >&5
+echo "configure:1340: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1452,7 +1441,8 @@
 	;;
   sh*-*-*)		sim_target=sh ;;
   powerpc*-*-eabi* | powerpc*-*-solaris* | powerpc*-*-sysv4* | \
-  powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* )
+  powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* | \
+  powerpc*-*-rtems*)
 	# The PowerPC simulator uses the GCC extension long long as well as
 	# ANSI prototypes, so don't enable it for random host compilers
 	# unless asked to.
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/sim/configure.in gdb-6.0/sim/configure.in
--- /usr1/rtems/work-tools/original/gdb-6.0/sim/configure.in	Sun Apr 13 11:44:57 2003
+++ gdb-6.0/sim/configure.in	Tue Feb 17 12:43:37 2004
@@ -91,7 +91,8 @@
 	;;
   sh*-*-*)		sim_target=sh ;;
   powerpc*-*-eabi* | powerpc*-*-solaris* | powerpc*-*-sysv4* | \
-  powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* )
+  powerpc*-*-elf* | powerpc*-*-linux* | powerpc*-*-netbsd* | \
+  powerpc*-*-rtems*)
 	# The PowerPC simulator uses the GCC extension long long as well as
 	# ANSI prototypes, so don't enable it for random host compilers
 	# unless asked to.
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/sim/erc32/Makefile.in gdb-6.0/sim/erc32/Makefile.in
--- /usr1/rtems/work-tools/original/gdb-6.0/sim/erc32/Makefile.in	Tue Mar  7 09:32:49 2000
+++ gdb-6.0/sim/erc32/Makefile.in	Tue Feb 17 12:43:37 2004
@@ -24,7 +24,7 @@
 SIM_OBJS = exec.o erc32.o func.o help.o float.o interf.o
 SIM_EXTRA_LIBS = ../../readline/libreadline.a  $(TERMCAP_LIB) -lm
 SIM_EXTRA_LIBDEPS = ../../readline/libreadline.a
-SIM_EXTRA_ALL = sis
+SIM_EXTRA_ALL = sis$(EXEEXT)
 SIM_EXTRA_INSTALL = install-sis
 SIM_EXTRA_CLEAN = clean-sis
 
@@ -35,11 +35,13 @@
 
 ## COMMON_POST_CONFIG_FRAG
 
+EXEEXT = @EXEEXT@
+
 # `sis' doesn't need interf.o.
 SIS_OFILES = exec.o erc32.o func.o help.o float.o
 
-sis: sis.o $(SIS_OFILES) $(COMMON_OBJS) $(LIBDEPS)
-	$(CC) $(ALL_CFLAGS) -o sis \
+sis$(EXEEXT): sis.o $(SIS_OFILES) $(COMMON_OBJS) $(LIBDEPS)
+	$(CC) $(ALL_CFLAGS) -o sis$(EXEEXT) \
 	  sis.o $(SIS_OFILES) $(COMMON_OBJS) $(EXTRA_LIBS)
 
 # FIXME: This computes the build host's endianness, doesn't it?
@@ -56,7 +58,7 @@
 	$(INSTALL_PROGRAM) sis$(EXEEXT) $(bindir)/$$n$(EXEEXT)
 
 clean-sis:
-	rm -f sis end end.h
+	rm -f sis$(EXEEXT) end end.h
 
 configure:
 	@echo "Rebuilding configure..."
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/sim/erc32/configure.in gdb-6.0/sim/erc32/configure.in
--- /usr1/rtems/work-tools/original/gdb-6.0/sim/erc32/configure.in	Mon Apr 26 13:31:58 1999
+++ gdb-6.0/sim/erc32/configure.in	Tue Feb 17 12:43:37 2004
@@ -21,4 +21,7 @@
 fi
 AC_SUBST(TERMCAP)
 
+dnl Check for exe extension
+AC_EXEEXT
+
 SIM_AC_OUTPUT
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/ChangeLog gdb-6.0/sim/ppc/ChangeLog
--- /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/ChangeLog	Sun Jun 22 11:48:09 2003
+++ gdb-6.0/sim/ppc/ChangeLog	Tue Feb 17 12:44:28 2004
@@ -1,3 +1,11 @@
+Wed Apr 29 13:54:04 CDT 1998  Joel Sherrill <joel@OARcorp.com>
+
+	* hw_sem.c: New file. Interfaces to UNIX shared memory.
+	* hw_shm.c: New file. Interfaces to UNIX semaphores.
+	* debug.c (trace_description): Added sem and shm entries.
+	* debug.h (trace_options): Added sem and shm entries.
+	* configure.in, configure (sim-hardware): Added sem and shm entries.
+
 2003-06-22  Andrew Cagney  <cagney@redhat.com>
 
 	Written by matthew green <mrg@redhat.com>, with fixes from Aldy
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/configure gdb-6.0/sim/ppc/configure
--- /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/configure	Sun Jun 22 11:48:10 2003
+++ gdb-6.0/sim/ppc/configure	Tue Feb 17 12:45:03 2004
@@ -225,7 +225,6 @@
 program_transform_name=s,x,x,
 silent=
 site=
-sitefile=
 srcdir=
 target=NONE
 verbose=
@@ -340,7 +339,6 @@
   --help                  print this message
   --no-create             do not create output files
   --quiet, --silent       do not print \`checking...' messages
-  --site-file=FILE        use FILE as the site file
   --version               print the version of autoconf that created configure
 Directory and file names:
   --prefix=PREFIX         install architecture-independent files in PREFIX
@@ -511,11 +509,6 @@
   -site=* | --site=* | --sit=*)
     site="$ac_optarg" ;;
 
-  -site-file | --site-file | --site-fil | --site-fi | --site-f)
-    ac_prev=sitefile ;;
-  -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
-    sitefile="$ac_optarg" ;;
-
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -681,16 +674,12 @@
 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
 
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
-  if test -z "$CONFIG_SITE"; then
-    if test "x$prefix" != xNONE; then
-      CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-    else
-      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-    fi
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
   fi
-else
-  CONFIG_SITE="$sitefile"
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
@@ -761,7 +750,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:765: checking for a BSD compatible install" >&5
+echo "configure:754: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -816,7 +805,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:820: checking for $ac_word" >&5
+echo "configure:809: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -846,7 +835,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:850: checking for $ac_word" >&5
+echo "configure:839: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -897,7 +886,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:901: checking for $ac_word" >&5
+echo "configure:890: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -929,7 +918,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:933: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:922: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -940,12 +929,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 944 "configure"
+#line 933 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -971,12 +960,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:975: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:964: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:980: checking whether we are using GNU C" >&5
+echo "configure:969: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -985,7 +974,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1004,7 +993,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1008: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:997: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1045,7 +1034,7 @@
 
 ALL_LINGUAS=
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1049: checking how to run the C preprocessor" >&5
+echo "configure:1038: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1060,13 +1049,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1064 "configure"
+#line 1053 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1059: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1077,13 +1066,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1081 "configure"
+#line 1070 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1087: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1076: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1094,13 +1083,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1098 "configure"
+#line 1087 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1093: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1125,7 +1114,7 @@
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1129: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1118: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1154,7 +1143,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1158: checking for $ac_word" >&5
+echo "configure:1147: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1182,7 +1171,7 @@
 fi
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1186: checking for POSIXized ISC" >&5
+echo "configure:1175: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -1203,12 +1192,12 @@
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1207: checking for ANSI C header files" >&5
+echo "configure:1196: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1212 "configure"
+#line 1201 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1216,7 +1205,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1233,7 +1222,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1237 "configure"
+#line 1226 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1251,7 +1240,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1255 "configure"
+#line 1244 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1272,7 +1261,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1276 "configure"
+#line 1265 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1283,7 +1272,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:1287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1307,12 +1296,12 @@
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1311: checking for working const" >&5
+echo "configure:1300: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1316 "configure"
+#line 1305 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1361,7 +1350,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1382,21 +1371,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1386: checking for inline" >&5
+echo "configure:1375: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 1393 "configure"
+#line 1382 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:1400: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -1422,12 +1411,12 @@
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1426: checking for off_t" >&5
+echo "configure:1415: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1431 "configure"
+#line 1420 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1455,12 +1444,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1459: checking for size_t" >&5
+echo "configure:1448: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1464 "configure"
+#line 1453 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1490,19 +1479,19 @@
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:1494: checking for working alloca.h" >&5
+echo "configure:1483: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1499 "configure"
+#line 1488 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:1506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -1523,12 +1512,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1527: checking for alloca" >&5
+echo "configure:1516: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1532 "configure"
+#line 1521 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -1556,7 +1545,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:1560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -1588,12 +1577,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1592: checking whether alloca needs Cray hooks" >&5
+echo "configure:1581: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1597 "configure"
+#line 1586 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -1618,12 +1607,12 @@
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1622: checking for $ac_func" >&5
+echo "configure:1611: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1627 "configure"
+#line 1616 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1646,7 +1635,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1673,7 +1662,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1677: checking stack direction for C alloca" >&5
+echo "configure:1666: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1681,7 +1670,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1685 "configure"
+#line 1674 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -1700,7 +1689,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:1704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -1721,21 +1710,21 @@
 
 fi
 
-for ac_hdr in unistd.h
+for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1729: checking for $ac_hdr" >&5
+echo "configure:1718: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1734 "configure"
+#line 1723 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1728: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1764,12 +1753,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1768: checking for $ac_func" >&5
+echo "configure:1757: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1773 "configure"
+#line 1762 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1792,7 +1781,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1817,7 +1806,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:1821: checking for working mmap" >&5
+echo "configure:1810: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1825,7 +1814,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 1829 "configure"
+#line 1818 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -1853,11 +1842,24 @@
 #include <fcntl.h>
 #include <sys/mman.h>
 
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
 /* This mess was copied from the GNU getpagesize.h.  */
 #ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-# endif
 
 /* Assume that all systems that can run configure have sys/param.h.  */
 # ifndef HAVE_SYS_PARAM_H
@@ -1965,7 +1967,7 @@
 }
 
 EOF
-if { (eval echo configure:1969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -1993,17 +1995,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1997: checking for $ac_hdr" >&5
+echo "configure:1999: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2002 "configure"
+#line 2004 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2033,12 +2035,12 @@
 __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2037: checking for $ac_func" >&5
+echo "configure:2039: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2042 "configure"
+#line 2044 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2061,7 +2063,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2090,12 +2092,12 @@
      for ac_func in stpcpy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2094: checking for $ac_func" >&5
+echo "configure:2096: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2099 "configure"
+#line 2101 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2118,7 +2120,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2152,19 +2154,19 @@
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2156: checking for LC_MESSAGES" >&5
+echo "configure:2158: checking for LC_MESSAGES" >&5
 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2161 "configure"
+#line 2163 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_val_LC_MESSAGES=yes
 else
@@ -2185,7 +2187,7 @@
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2189: checking whether NLS is requested" >&5
+echo "configure:2191: checking whether NLS is requested" >&5
         # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval="$enable_nls"
@@ -2205,7 +2207,7 @@
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2209: checking whether included gettext is requested" >&5
+echo "configure:2211: checking whether included gettext is requested" >&5
       # Check whether --with-included-gettext or --without-included-gettext was given.
 if test "${with_included_gettext+set}" = set; then
   withval="$with_included_gettext"
@@ -2224,17 +2226,17 @@
 
 	ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2228: checking for libintl.h" >&5
+echo "configure:2230: checking for libintl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2233 "configure"
+#line 2235 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2251,19 +2253,19 @@
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:2255: checking for gettext in libc" >&5
+echo "configure:2257: checking for gettext in libc" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2260 "configure"
+#line 2262 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libc=yes
 else
@@ -2279,7 +2281,7 @@
 
 	   if test "$gt_cv_func_gettext_libc" != "yes"; then
 	     echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:2283: checking for bindtextdomain in -lintl" >&5
+echo "configure:2285: checking for bindtextdomain in -lintl" >&5
 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2287,7 +2289,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2291 "configure"
+#line 2293 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2298,7 +2300,7 @@
 bindtextdomain()
 ; return 0; }
 EOF
-if { (eval echo configure:2302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2314,19 +2316,19 @@
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:2318: checking for gettext in libintl" >&5
+echo "configure:2320: checking for gettext in libintl" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2323 "configure"
+#line 2325 "configure"
 #include "confdefs.h"
 
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:2330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libintl=yes
 else
@@ -2354,7 +2356,7 @@
 	      # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2358: checking for $ac_word" >&5
+echo "configure:2360: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2388,12 +2390,12 @@
 		for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2392: checking for $ac_func" >&5
+echo "configure:2394: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2397 "configure"
+#line 2399 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2416,7 +2418,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2443,7 +2445,7 @@
 		# Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2447: checking for $ac_word" >&5
+echo "configure:2449: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2479,7 +2481,7 @@
 		# Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2483: checking for $ac_word" >&5
+echo "configure:2485: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2511,7 +2513,7 @@
 fi
 
 		cat > conftest.$ac_ext <<EOF
-#line 2515 "configure"
+#line 2517 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2519,7 +2521,7 @@
 			       return _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:2523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   CATOBJEXT=.gmo
 		   DATADIRNAME=share
@@ -2551,7 +2553,7 @@
         # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2555: checking for $ac_word" >&5
+echo "configure:2557: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2585,7 +2587,7 @@
         # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2589: checking for $ac_word" >&5
+echo "configure:2591: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2621,7 +2623,7 @@
         # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2625: checking for $ac_word" >&5
+echo "configure:2627: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2711,7 +2713,7 @@
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:2715: checking for catalogs to be installed" >&5
+echo "configure:2717: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for lang in ${LINGUAS=$ALL_LINGUAS}; do
          case "$ALL_LINGUAS" in
@@ -2739,17 +2741,17 @@
       if test "$CATOBJEXT" = ".cat"; then
 	 ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:2743: checking for linux/version.h" >&5
+echo "configure:2745: checking for linux/version.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2748 "configure"
+#line 2750 "configure"
 #include "confdefs.h"
 #include <linux/version.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3053,11 +3055,196 @@
 
 fi
 
+echo $ac_n "checking if union semun defined""... $ac_c" 1>&6
+echo "configure:3060: checking if union semun defined" >&5
+if eval "test \"`echo '$''{'ac_cv_HAS_UNION_SEMUN'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3065 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+int main() {
+union semun arg ;
+; return 0; }
+EOF
+if { (eval echo configure:3075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_has_union_semun="yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_has_union_semun="no"
+fi
+rm -f conftest*
+echo "$ac_t""$ac_cv_has_union_semun" 1>&6
+
+fi
+
+echo "$ac_t""$ac_cv_HAS_UNION_SEMUN" 1>&6
+
+
+if test "$ac_cv_has_union_semun" = "yes"; then
+  echo $ac_n "checking whether System V semaphores are supported""... $ac_c" 1>&6
+echo "configure:3094: checking whether System V semaphores are supported" >&5
+if eval "test \"`echo '$''{'ac_cv_sysv_sem'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3103 "configure"
+#include "confdefs.h"
+
+  #include <sys/types.h>
+  #include <sys/ipc.h>
+  #include <sys/sem.h>
+  int main () {
+    union semun arg ;
+
+    int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
+    if (id == -1)
+      exit(1);
+    arg.val = 0; /* avoid implicit type cast to union */
+    if (semctl(id, 0, IPC_RMID, arg) == -1)
+      exit(1);
+    exit(0);
+  }
+  
+EOF
+if { (eval echo configure:3122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_sysv_sem="yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_sysv_sem="no"
+fi
+rm -fr conftest*
+fi
+
+  
+fi
+
+echo "$ac_t""$ac_cv_sysv_sem" 1>&6
+else  # semun is not defined
+  echo $ac_n "checking whether System V semaphores are supported""... $ac_c" 1>&6
+echo "configure:3140: checking whether System V semaphores are supported" >&5
+if eval "test \"`echo '$''{'ac_cv_sysv_sem'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3149 "configure"
+#include "confdefs.h"
+
+  #include <sys/types.h>
+  #include <sys/ipc.h>
+  #include <sys/sem.h>
+  union semun {
+    int val;
+    struct semid_ds *buf;
+    ushort *array;
+  };
+  int main () {
+    union semun arg ;
+
+    int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
+    if (id == -1)
+      exit(1);
+    arg.val = 0; /* avoid implicit type cast to union */
+    if (semctl(id, 0, IPC_RMID, arg) == -1)
+      exit(1);
+    exit(0);
+  }
+  
+EOF
+if { (eval echo configure:3173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_sysv_sem="yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_sysv_sem="no"
+fi
+rm -fr conftest*
+fi
+
+  
+fi
+
+echo "$ac_t""$ac_cv_sysv_sem" 1>&6
+fi
+
+echo $ac_n "checking whether System V shared memory is supported""... $ac_c" 1>&6
+echo "configure:3192: checking whether System V shared memory is supported" >&5
+if eval "test \"`echo '$''{'ac_cv_sysv_shm'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+if test "$cross_compiling" = yes; then
+  :
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3201 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+int main () {
+  int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
+  if (id == -1)
+    exit(1);
+  if (shmctl(id, IPC_RMID, 0) == -1)
+    exit(1);
+  exit(0);
+}
+
+EOF
+if { (eval echo configure:3217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_sysv_shm="yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_sysv_shm="no"
+fi
+rm -fr conftest*
+fi
+
+
+fi
+
+echo "$ac_t""$ac_cv_sysv_shm" 1>&6
+
+if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
+  sim_sysv_ipc_hw=",sem,shm";
+else
+  sim_sysv_ipc_hw="";
+fi
+
+if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
+  sim_hwflags="-DHAS_UNION_SEMUN";
+fi
+
 
 # Check whether --enable-sim-hardware or --disable-sim-hardware was given.
 if test "${enable_sim_hardware+set}" = set; then
   enableval="$enable_sim_hardware"
-  hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
+  hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
 case "${enableval}" in
   yes)	;;
   no)	{ echo "configure: error: "List of hardware must be specified for --enable-sim-hardware"" 1>&2; exit 1; }; hardware="";;
@@ -3071,7 +3258,7 @@
   echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
 fi
 else
-  hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
+  hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
 if test x"$silent" != x"yes"; then
@@ -3079,7 +3266,6 @@
 fi
 fi
 
-
 # Check whether --enable-sim-hostbitsize or --disable-sim-hostbitsize was given.
 if test "${enable_sim_hostbitsize+set}" = set; then
   enableval="$enable_sim_hostbitsize"
@@ -3111,14 +3297,14 @@
   
 if test "x$cross_compiling" = "xno"; then
   echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3115: checking whether byte ordering is bigendian" >&5
+echo "configure:3301: checking whether byte ordering is bigendian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 3122 "configure"
+#line 3308 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3129,11 +3315,11 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3133: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3319: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 3137 "configure"
+#line 3323 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3144,7 +3330,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -3164,7 +3350,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3168 "configure"
+#line 3354 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -3177,7 +3363,7 @@
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:3181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
@@ -3631,7 +3817,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:3635: checking host system type" >&5
+echo "configure:3821: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -3652,7 +3838,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:3656: checking target system type" >&5
+echo "configure:3842: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -3670,7 +3856,7 @@
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:3674: checking build system type" >&5
+echo "configure:3860: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -3717,12 +3903,12 @@
 
 
 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:3721: checking for st_blksize in struct stat" >&5
+echo "configure:3907: checking for st_blksize in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3726 "configure"
+#line 3912 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -3730,7 +3916,7 @@
 struct stat s; s.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:3734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blksize=yes
 else
@@ -3751,12 +3937,12 @@
 fi
 
 echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:3755: checking for st_blocks in struct stat" >&5
+echo "configure:3941: checking for st_blocks in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3760 "configure"
+#line 3946 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -3764,7 +3950,7 @@
 struct stat s; s.st_blocks;
 ; return 0; }
 EOF
-if { (eval echo configure:3768: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blocks=yes
 else
@@ -3787,12 +3973,12 @@
 fi
 
 echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:3791: checking for st_rdev in struct stat" >&5
+echo "configure:3977: checking for st_rdev in struct stat" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3796 "configure"
+#line 3982 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -3800,7 +3986,7 @@
 struct stat s; s.st_rdev;
 ; return 0; }
 EOF
-if { (eval echo configure:3804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_rdev=yes
 else
@@ -3821,12 +4007,12 @@
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3825: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:4011: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3830 "configure"
+#line 4016 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3834,7 +4020,7 @@
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3855,12 +4041,12 @@
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3859: checking for tm_zone in struct tm" >&5
+echo "configure:4045: checking for tm_zone in struct tm" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3864 "configure"
+#line 4050 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -3868,7 +4054,7 @@
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:3872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -3888,12 +4074,12 @@
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3892: checking for tzname" >&5
+echo "configure:4078: checking for tzname" >&5
 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3897 "configure"
+#line 4083 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -3903,7 +4089,7 @@
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:3907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -3926,12 +4112,12 @@
 
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3930: checking for uid_t in sys/types.h" >&5
+echo "configure:4116: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3935 "configure"
+#line 4121 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3960,7 +4146,7 @@
 fi
 
 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:3964: checking type of array argument to getgroups" >&5
+echo "configure:4150: checking type of array argument to getgroups" >&5
 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3968,7 +4154,7 @@
   ac_cv_type_getgroups=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 3972 "configure"
+#line 4158 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Rendell for this test.  */
@@ -3993,7 +4179,7 @@
 }
 
 EOF
-if { (eval echo configure:3997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
     ac_cv_type_getgroups=gid_t
 else
@@ -4007,7 +4193,7 @@
 
 if test $ac_cv_type_getgroups = cross; then
         cat > conftest.$ac_ext <<EOF
-#line 4011 "configure"
+#line 4197 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 EOF
@@ -4031,12 +4217,12 @@
 
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:4035: checking for mode_t" >&5
+echo "configure:4221: checking for mode_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4040 "configure"
+#line 4226 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -4064,12 +4250,12 @@
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:4068: checking for off_t" >&5
+echo "configure:4254: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4073 "configure"
+#line 4259 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -4097,12 +4283,12 @@
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:4101: checking for pid_t" >&5
+echo "configure:4287: checking for pid_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4106 "configure"
+#line 4292 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -4130,12 +4316,12 @@
 fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:4134: checking return type of signal handlers" >&5
+echo "configure:4320: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4139 "configure"
+#line 4325 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -4152,7 +4338,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:4156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -4171,12 +4357,12 @@
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:4175: checking for size_t" >&5
+echo "configure:4361: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4180 "configure"
+#line 4366 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -4204,12 +4390,12 @@
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:4208: checking for uid_t in sys/types.h" >&5
+echo "configure:4394: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4213 "configure"
+#line 4399 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -4241,12 +4427,12 @@
 for ac_func in access cfgetispeed cfgetospeed cfsetispeed cfsetospeed chdir chmod chown dup dup2 fchmod fchown fcntl fstat fstatfs getdirentries getegid geteuid getgid getpid getppid getrusage gettimeofday getuid ioctl kill link lseek lstat mkdir pipe readlink rmdir setreuid setregid stat sigprocmask stat symlink tcgetattr tcsetattr tcsendbreak tcdrain tcflush tcflow tcgetpgrp tcsetpgrp time umask unlink
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4245: checking for $ac_func" >&5
+echo "configure:4431: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4250 "configure"
+#line 4436 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4269,7 +4455,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4298,17 +4484,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4302: checking for $ac_hdr" >&5
+echo "configure:4488: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4307 "configure"
+#line 4493 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4312: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4339,12 +4525,12 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:4343: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4529: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4348 "configure"
+#line 4534 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4352,7 +4538,7 @@
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -4377,7 +4563,7 @@
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:4381: checking for opendir in -ldir" >&5
+echo "configure:4567: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4385,7 +4571,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4389 "configure"
+#line 4575 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4396,7 +4582,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4418,7 +4604,7 @@
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4422: checking for opendir in -lx" >&5
+echo "configure:4608: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4426,7 +4612,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4430 "configure"
+#line 4616 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4437,7 +4623,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4462,12 +4648,12 @@
 
 sim_termio=""
 echo $ac_n "checking for struct termios""... $ac_c" 1>&6
-echo "configure:4466: checking for struct termios" >&5
+echo "configure:4652: checking for struct termios" >&5
 if eval "test \"`echo '$''{'ac_cv_termios_struct'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4471 "configure"
+#line 4657 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/termios.h>
@@ -4480,7 +4666,7 @@
  x.c_cc[NCCS] = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4670: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_termios_struct=yes
 else
@@ -4499,12 +4685,12 @@
 
 if test "$ac_cv_termios_struct" = "yes"; then
   echo $ac_n "checking for c_line field in struct termios""... $ac_c" 1>&6
-echo "configure:4503: checking for c_line field in struct termios" >&5
+echo "configure:4689: checking for c_line field in struct termios" >&5
   if eval "test \"`echo '$''{'ac_cv_termios_cline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4508 "configure"
+#line 4694 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/termios.h>
@@ -4512,7 +4698,7 @@
 static struct termios x; x.c_line = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4516: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4702: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_termios_cline=yes
 else
@@ -4535,12 +4721,12 @@
 
 if test "$ac_cv_termios_struct" != "yes"; then
   echo $ac_n "checking for struct termio""... $ac_c" 1>&6
-echo "configure:4539: checking for struct termio" >&5
+echo "configure:4725: checking for struct termio" >&5
   if eval "test \"`echo '$''{'ac_cv_termio_struct'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4544 "configure"
+#line 4730 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/termio.h>
@@ -4553,7 +4739,7 @@
  x.c_cc[NCC] = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_termio_struct=yes
 else
@@ -4575,12 +4761,12 @@
 
 if test "$ac_cv_termio_struct" = "yes"; then
   echo $ac_n "checking for c_line field in struct termio""... $ac_c" 1>&6
-echo "configure:4579: checking for c_line field in struct termio" >&5
+echo "configure:4765: checking for c_line field in struct termio" >&5
   if eval "test \"`echo '$''{'ac_cv_termio_cline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4584 "configure"
+#line 4770 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/termio.h>
@@ -4588,7 +4774,7 @@
 static struct termio x; x.c_line = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_termio_cline=yes
 else
@@ -4611,7 +4797,7 @@
 
 sim_devzero=""
 echo $ac_n "checking for /dev/zero""... $ac_c" 1>&6
-echo "configure:4615: checking for /dev/zero" >&5
+echo "configure:4801: checking for /dev/zero" >&5
 if eval "test \"`echo '$''{'ac_cv_devzero'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4619,7 +4805,7 @@
   ac_cv_devzero=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 4623 "configure"
+#line 4809 "configure"
 #include "confdefs.h"
 #include <fcntl.h>
 main () {
@@ -4638,7 +4824,7 @@
   return 0;
 }
 EOF
-if { (eval echo configure:4642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_devzero=yes
 else
@@ -4660,7 +4846,7 @@
 fi
 
 echo $ac_n "checking for common simulator directory""... $ac_c" 1>&6
-echo "configure:4664: checking for common simulator directory" >&5
+echo "configure:4850: checking for common simulator directory" >&5
 if test -f "${srcdir}/../common/callback.c"; then
   echo "$ac_t""yes" 1>&6
   sim_callback="callback.o targ-map.o"
@@ -4672,7 +4858,7 @@
 fi
 
 echo $ac_n "checking for common simulator directory fpu implementation""... $ac_c" 1>&6
-echo "configure:4676: checking for common simulator directory fpu implementation" >&5
+echo "configure:4862: checking for common simulator directory fpu implementation" >&5
 if test -f "${srcdir}/../common/sim-fpu.c"; then
   echo "$ac_t""yes" 1>&6
   sim_fpu_cflags="-DHAVE_COMMON_FPU -I${srcdir}/../common"
@@ -4684,12 +4870,12 @@
 fi
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:4688: checking for Cygwin environment" >&5
+echo "configure:4874: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4693 "configure"
+#line 4879 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -4700,7 +4886,7 @@
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:4704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -4717,19 +4903,19 @@
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:4721: checking for mingw32 environment" >&5
+echo "configure:4907: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4726 "configure"
+#line 4912 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:4733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -4748,7 +4934,7 @@
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:4752: checking for executable suffix" >&5
+echo "configure:4938: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4758,10 +4944,10 @@
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:4762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:4948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
-      *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+      *.c | *.o | *.obj) ;;
       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
       esac
     done
@@ -4782,12 +4968,13 @@
 
 
 
+
 AR=${AR-ar}
 
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4791: checking for $ac_word" >&5
+echo "configure:4978: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5059,6 +5246,7 @@
 s%@LIBOBJS@%$LIBOBJS%g
 s%@EXEEXT@%$EXEEXT%g
 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
+s%@sim_hwflags@%$sim_hwflags%g
 s%@HDEFINES@%$HDEFINES%g
 s%@AR@%$AR%g
 s%@sim_cflags@%$sim_cflags%g
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/configure.in gdb-6.0/sim/ppc/configure.in
--- /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/configure.in	Sun Jun 22 11:48:12 2003
+++ gdb-6.0/sim/ppc/configure.in	Tue Feb 17 12:43:37 2004
@@ -208,10 +208,105 @@
 esac
 ])dnl
 
+AC_CACHE_CHECK([if union semun defined],
+  ac_cv_HAS_UNION_SEMUN,
+  [AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>],
+[union semun arg ;],
+[ac_cv_has_union_semun="yes"],
+[ac_cv_has_union_semun="no"])
+AC_MSG_RESULT($ac_cv_has_union_semun)
+])
+
+
+if test "$ac_cv_has_union_semun" = "yes"; then
+  AC_CACHE_CHECK(whether System V semaphores are supported,
+  ac_cv_sysv_sem,
+  [
+  AC_TRY_RUN(
+  [
+  #include <sys/types.h>
+  #include <sys/ipc.h>
+  #include <sys/sem.h>
+  int main () {
+    union semun arg ;
+
+    int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
+    if (id == -1)
+      exit(1);
+    arg.val = 0; /* avoid implicit type cast to union */
+    if (semctl(id, 0, IPC_RMID, arg) == -1)
+      exit(1);
+    exit(0);
+  }
+  ],
+  ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
+  ])
+else  # semun is not defined
+  AC_CACHE_CHECK(whether System V semaphores are supported,
+  ac_cv_sysv_sem,
+  [
+  AC_TRY_RUN(
+  [
+  #include <sys/types.h>
+  #include <sys/ipc.h>
+  #include <sys/sem.h>
+  union semun {
+    int val;
+    struct semid_ds *buf;
+    ushort *array;
+  };
+  int main () {
+    union semun arg ;
+
+    int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
+    if (id == -1)
+      exit(1);
+    arg.val = 0; /* avoid implicit type cast to union */
+    if (semctl(id, 0, IPC_RMID, arg) == -1)
+      exit(1);
+    exit(0);
+  }
+  ],
+  ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
+  ])
+fi
+
+AC_CACHE_CHECK(whether System V shared memory is supported,
+ac_cv_sysv_shm,
+[
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+int main () {
+  int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
+  if (id == -1)
+    exit(1);
+  if (shmctl(id, IPC_RMID, 0) == -1)
+    exit(1);
+  exit(0);
+}
+],
+ac_cv_sysv_shm="yes", ac_cv_sysv_shm="no", :)
+])
+
+if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
+  sim_sysv_ipc_hw=",sem,shm";
+else
+  sim_sysv_ipc_hw="";
+fi
+
+if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
+  sim_hwflags="-DHAS_UNION_SEMUN";
+fi
+
 
 AC_ARG_ENABLE(sim-hardware,
 [  --enable-sim-hardware=list		Specify the hardware to be included in the build.],
-[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
+[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
 case "${enableval}" in
   yes)	;;
   no)	AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
@@ -223,14 +318,13 @@
 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
 if test x"$silent" != x"yes" && test x"$hardware" != x""; then
   echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
-fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
+fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
 sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
 sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
 if test x"$silent" != x"yes"; then
   echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
 fi])dnl
 
-
 AC_ARG_ENABLE(sim-hostbitsize,
 [  --enable-sim-hostbitsize=32|64	Specify host bitsize (32 or 64).],
 [case "${enableval}" in
@@ -712,6 +806,7 @@
 AC_EXEEXT
 
 AC_SUBST(CC_FOR_BUILD)
+AC_SUBST(sim_hwflags)
 AC_SUBST(CFLAGS)
 AC_SUBST(HDEFINES)
 AR=${AR-ar}
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/debug.c gdb-6.0/sim/ppc/debug.c
--- /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/debug.c	Thu Apr 15 20:35:08 1999
+++ gdb-6.0/sim/ppc/debug.c	Tue Feb 17 12:43:37 2004
@@ -70,6 +70,8 @@
   { trace_pass_device, "pass-device" },
   { trace_phb_device, "phb-device" },
   { trace_register_device, "register-device", "Device initializing registers" },
+  { trace_sem_device, "sem-device" },
+  { trace_shm_device, "shm-device" },
   { trace_stack_device, "stack-device" },
   { trace_vm_device, "vm-device" },
   /* packages */
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/debug.h gdb-6.0/sim/ppc/debug.h
--- /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/debug.h	Thu Apr 15 20:35:08 1999
+++ gdb-6.0/sim/ppc/debug.h	Tue Feb 17 12:43:37 2004
@@ -51,6 +51,8 @@
   trace_pal_device,
   trace_pass_device,
   trace_phb_device,
+  trace_sem_device,
+  trace_shm_device,
   trace_stack_device,
   trace_register_device,
   trace_vm_device,
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/hw_sem.c gdb-6.0/sim/ppc/hw_sem.c
--- /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/hw_sem.c	Wed Dec 31 18:00:00 1969
+++ gdb-6.0/sim/ppc/hw_sem.c	Tue Feb 17 12:43:37 2004
@@ -0,0 +1,320 @@
+/*  This file is part of the program psim.
+
+    Copyright (C) 1997, Joel Sherrill <joel@OARcorp.com>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ 
+    */
+
+
+#ifndef _HW_SEM_C_
+#define _HW_SEM_C_
+
+#include "device_table.h"
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+
+#include <sys/ipc.h>
+#include <sys/sem.h>
+
+#include <errno.h> /* XXX temporary */
+
+/* DEVICE
+
+
+   sem - provide access to a unix semaphore
+
+
+   DESCRIPTION
+
+
+   This device implements an interface to a unix semaphore.
+
+
+   PROPERTIES
+
+
+   reg = <address> <size> (required)
+
+   Determine where the memory lives in the parents address space.
+
+   key = <integer> (required)
+
+   This is the key of the unix semaphore.
+
+   EXAMPLES
+
+
+   Enable tracing of the sem:
+
+   |  bash$ psim -t sem \
+
+
+   Configure a UNIX semaphore using key 0x12345678 mapped into psim
+   address space at 0xfff00000:
+
+   |  -o '/sem@0xfff00000/reg 0xfff00000 0x80000' \
+   |  -o '/sem@0xfff00000/key 0x12345678' \
+
+   sim/ppc/run -o '/#address-cells 1' \
+         -o '/sem@0xc0000000/reg 0xc0000000 0x80000' \
+         -o '/sem@0xc0000000/key 0x12345678' ../psim-hello/hello
+
+   REGISTERS
+
+   offset 0 - lock count
+   offset 4 - lock operation   (reads count)
+   offset 8 - unlock operation (reads count)
+
+   BUGS
+
+   Only one of these can exist in a system.  I do not know how to map a
+   unique set of properties to each instance.
+
+   */
+
+typedef struct _hw_sem_device {
+  unsigned_word  physical_address;
+  key_t          key;
+  int            id;
+  int            count;
+} hw_sem_device;
+
+static void
+hw_sem_init_data(device *me)
+{
+  hw_sem_device *sem = (hw_sem_device*)device_data(me);
+  int value;
+  int status;
+#if !HAS_UNION_SEMUN
+        union semun {
+          int val;
+          struct semid_ds *buf;
+          unsigned short int *array;
+#if defined(__linux__)
+          struct seminfo *__buf;
+#endif
+        } ;
+#endif
+  union semun help;
+
+  /* initialize the properties of the sem */
+
+  if (device_find_property(me, "key") == NULL)
+    error("sem_init_data() required key property is missing\n");
+
+  if (device_find_property(me, "value") == NULL)
+    error("sem_init_data() required value property is missing\n");
+
+  sem->key = (key_t) device_find_integer_property(me, "key");
+  DTRACE(sem, ("semaphore key (%d)\n", sem->key) );
+
+  value = (int) device_find_integer_property(me, "value");
+  DTRACE(sem, ("semaphore value (%d)\n", value) );
+
+  /* Now to initialize the shared memory area */
+
+  if ( value != -1 ) {
+
+    sem->id = semget(sem->key, 1, IPC_CREAT | 0660);
+    if (sem->id == -1)
+      error("hw_sem_init_data() semget failed\n");
+
+    help.val = value;
+    status = semctl( sem->id, 0, SETVAL, help );
+    if (status == -1)
+      error("hw_sem_init_data() semctl -- set value failed\n");
+
+  } else {
+    sem->id = semget(sem->key, 1, 0660);
+    if (sem->id == -1)
+      error("hw_sem_init_data() semget failed\n");
+  }
+
+  sem->physical_address = 0xc0010000;  /* XXX hack */
+
+  sem->count = semctl( sem->id, 0, GETVAL, help );
+  if (sem->count == -1)
+    error("hw_sem_init_data() semctl -- get value failed\n");
+  DTRACE(sem, ("semaphore OS value (%d)\n", sem->count) );
+
+  if (sizeof(int) != 4)
+    error("hw_sem_init_data() typing problem\n");
+
+  /* we assume that the feedback process initializes the semaphore */
+}
+
+static void
+hw_sem_attach_address_callback(device *me,
+				attach_type attach,
+				int space,
+				unsigned_word addr,
+				unsigned nr_bytes,
+				access_type access,
+				device *client) /*callback/default*/
+{
+  hw_sem_device *sem = (hw_sem_device*)device_data(me);
+
+  if (space != 0)
+    error("sem_attach_address_callback() invalid address space\n");
+
+  if (nr_bytes == 12)
+    error("sem_attach_address_callback() invalid size\n");
+
+  sem->physical_address = addr;
+  DTRACE(sem, ("semaphore physical_address=0x%x\n", addr));
+
+}
+
+static unsigned
+hw_sem_io_read_buffer(device *me,
+			 void *dest,
+			 int space,
+			 unsigned_word addr,
+			 unsigned nr_bytes,
+			 cpu *processor,
+			 unsigned_word cia)
+{
+  hw_sem_device *sem = (hw_sem_device*)device_data(me);
+  struct sembuf sb;
+  int status;
+  unsigned32 u32;
+#if !HAS_UNION_SEMUN
+        union semun {
+          int val;
+          struct semid_ds *buf;
+          unsigned short int *array;
+#if defined(__linux__)
+          struct seminfo *__buf;
+#endif
+        } ;
+#endif
+  union semun help;
+
+  /* do we need to worry about out of range addresses? */
+
+  DTRACE(sem, ("semaphore read addr=0x%x length=%d\n", addr, nr_bytes));
+
+  if (!(addr >= sem->physical_address && addr <= sem->physical_address + 11))
+    error("hw_sem_io_read_buffer() invalid address - out of range\n");
+
+  if ((addr % 4) != 0)
+    error("hw_sem_io_read_buffer() invalid address - alignment\n");
+
+  if (nr_bytes != 4)
+    error("hw_sem_io_read_buffer() invalid length\n");
+
+  switch ( (addr - sem->physical_address) / 4 ) {
+
+    case 0:
+      break; 
+
+    case 1:  /* LOCK */
+      /*
+       *  Check for this process nesting the lock
+       */
+
+      sb.sem_num = 0;
+      sb.sem_op  = -1;
+      sb.sem_flg = 0;
+
+      status = semop(sem->id, &sb, 1);
+      if (status == -1) {
+        perror( "hw_sem.c: lock" );
+        fprintf( stderr, "Actual error number = %d\n", errno );
+        error("hw_sem_io_read_buffer() sem lock\n");
+      }
+
+      DTRACE(sem, ("semaphore lock %d\n", sem->count));
+      break; 
+
+    case 2: /* UNLOCK */
+/*
+      u32 = semctl( sem->id, 0, GETVAL, NULL );
+      if ( u32 != 1 ) {
+         fprintf( stderr, "unlock --- count = %d\n", u32 );
+      }
+*/
+      /*
+       *  Check for this process nesting the lock
+       */
+
+      sb.sem_num = 0;
+      sb.sem_op  = 1;
+      sb.sem_flg = 0;
+
+      status = semop(sem->id, &sb, 1);
+      if (status == -1) {
+        perror( "hw_sem.c: unlock" );
+        fprintf( stderr, "Actual error number = %d\n", errno );
+        error("hw_sem_io_read_buffer() sem unlock\n");
+      }
+      DTRACE(sem, ("semaphore unlock %d\n", sem->count));
+      break; 
+
+    default:
+      error("hw_sem_io_read_buffer() invalid address - unknown error\n");
+      break; 
+  }
+
+  /* XXX endian assumption here -- assume target is big endian */
+  
+  u32 = H2T_4(semctl( sem->id, 0, GETVAL, help ));
+
+  DTRACE(sem, ("semaphore OS value (%d)\n", u32) );
+  if (u32 == 0xffffffff) {
+    perror( "hw_sem.c: getval" );
+    error("hw_sem_io_read_buffer() semctl -- get value failed\n");
+  }
+
+  memcpy(dest, &u32, nr_bytes);
+  return nr_bytes;
+
+}
+
+
+static device_callbacks const hw_sem_callbacks = {
+  { generic_device_init_address, hw_sem_init_data },
+  { hw_sem_attach_address_callback, }, /* address */
+  { hw_sem_io_read_buffer, NULL }, /* IO */
+  { NULL, }, /* DMA */
+  { NULL, }, /* interrupt */
+  { NULL, }, /* unit */
+  NULL,
+};
+
+static void *
+hw_sem_create(const char *name,
+		 const device_unit *unit_address,
+		 const char *args)
+{
+  hw_sem_device *sem = ZALLOC(hw_sem_device);
+  return sem;
+}
+
+
+
+const device_descriptor hw_sem_device_descriptor[] = {
+  { "sem", hw_sem_create, &hw_sem_callbacks },
+  { NULL },
+};
+
+#endif /* _HW_SEM_C_ */
diff -uNr /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/hw_shm.c gdb-6.0/sim/ppc/hw_shm.c
--- /usr1/rtems/work-tools/original/gdb-6.0/sim/ppc/hw_shm.c	Wed Dec 31 18:00:00 1969
+++ gdb-6.0/sim/ppc/hw_shm.c	Tue Feb 17 12:43:37 2004
@@ -0,0 +1,228 @@
+/*  This file is part of the program psim.
+
+    Copyright (C) 1997, Joel Sherrill <joel@OARcorp.com>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ 
+    */
+
+
+#ifndef _HW_SHM_C_
+#define _HW_SHM_C_
+
+#include "device_table.h"
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+
+#include <sys/ipc.h>
+#include <sys/shm.h>
+
+
+/* DEVICE
+
+
+   shm - map unix shared memory into psim address space
+
+
+   DESCRIPTION
+
+
+   This device implements an area of memory which is mapped into UNIX
+   shared memory.
+
+
+   PROPERTIES
+
+
+   reg = <address> <size> (required)
+
+   Determine where the memory lives in the parents address space.
+   The SHM area is assumed to be of the same length.
+
+   key = <integer> (required)
+
+   This is the key of the unix shared memory area.
+
+   EXAMPLES
+
+
+   Enable tracing of the shm:
+
+   |  bash$ psim -t shm \
+
+
+   Configure a 64 kilobytes of UNIX shared memory with the key 0x12345678
+   mapped into psim address space at 0xfff00000.
+
+   |  -o '/shm@0xfff00000/reg 0xfff00000 0x80000' \
+   |  -o '/shm@0xfff00000/key 0x12345678' \
+
+   sim/ppc/run -o '/#address-cells 1' \
+         -o '/shm@0xc0000000/reg 0xc0000000 0x80000' \
+         -o '/shm@0xc0000000/key 0x12345678' ../psim-hello/hello
+
+   BUGS
+
+   Only one of these can exist in a system.  I do not know how to map a
+   unique set of properties to each instance.
+
+   */
+
+typedef struct _hw_shm_device {
+  unsigned_word  physical_address;
+  char          *shm_address;
+  unsigned       sizeof_memory;
+  key_t          key;
+  int            id;
+} hw_shm_device;
+
+static void
+hw_shm_init_data(device *me)
+{
+  hw_shm_device *shm = (hw_shm_device*)device_data(me);
+
+  /* initialize the properties of the shm */
+
+  if (device_find_property(me, "key") == NULL)
+    error("shm_init_data() required key property is missing\n");
+
+  shm->key = (key_t) device_find_integer_property(me, "key");
+  /* printf( "key=0x%x\n", shm->key ); */
+
+  shm->physical_address = 0xc0000000;
+  shm->sizeof_memory = 0x10000;
+
+  /* Now to initialize the shared memory area */
+
+  shm->id = shmget(shm->key, shm->sizeof_memory, IPC_CREAT | 0660);
+  if (shm->id == -1)
+    error("hw_shm_init_data() shmget failed\n");
+
+  shm->shm_address = shmat(shm->id, (char *)0, SHM_RND);
+  if (shm->shm_address == (void *)-1)
+    error("hw_shm_init_data() shmat failed\n");
+}
+
+static void
+hw_shm_attach_address_callback(device *me,
+				attach_type attach,
+				int space,
+				unsigned_word addr,
+				unsigned nr_bytes,
+				access_type access,
+				device *client) /*callback/default*/
+{
+  hw_shm_device *shm = (hw_shm_device*)device_data(me);
+
+  if (space != 0)
+    error("shm_attach_address_callback() invalid address space\n");
+
+  if (nr_bytes == 0)
+    error("shm_attach_address_callback() invalid size\n");
+
+  shm->physical_address = addr;
+  shm->sizeof_memory = nr_bytes;
+
+  /* Now to initialize the shared memory area */
+
+printf( "attaching\n" );
+  shm->id = shmget(shm->key, shm->sizeof_memory, IPC_CREAT | 0660);
+  if (shm->id == -1)
+    error("shm_attach_address_callback() shmget failed\n");
+
+  shm->shm_address = shmat(shm->id, (char *)0, SHM_RND);
+  if (shm->shm_address == (void *)-1)
+    error("shm_attach_address_callback() shmat failed\n");
+}
+
+
+static unsigned
+hw_shm_io_read_buffer(device *me,
+			 void *dest,
+			 int space,
+			 unsigned_word addr,
+			 unsigned nr_bytes,
+			 cpu *processor,
+			 unsigned_word cia)
+{
+  hw_shm_device *shm = (hw_shm_device*)device_data(me);
+
+  /* do we need to worry about out of range addresses? */
+
+/*
+  printf( "read %p %x %x %x\n", shm->shm_address, shm->physical_address,
+                               addr, nr_bytes );
+*/
+  memcpy(dest, &shm->shm_address[addr - shm->physical_address], nr_bytes);
+  return nr_bytes;
+}
+
+
+static unsigned
+hw_shm_io_write_buffer(device *me,
+			  const void *source,
+			  int space,
+			  unsigned_word addr,
+			  unsigned nr_bytes,
+			  cpu *processor,
+			  unsigned_word cia)
+{
+  hw_shm_device *shm = (hw_shm_device*)device_data(me);
+
+  /* do we need to worry about out of range addresses? */
+
+/*
+  printf( "write %p %p %x %x %x\n",
+        shm->shm_address, &shm->shm_address[addr - shm->physical_address],
+        shm->physical_address, addr, nr_bytes );
+*/
+  memcpy(&shm->shm_address[addr - shm->physical_address], source, nr_bytes);
+  return nr_bytes;
+}
+
+static device_callbacks const hw_shm_callbacks = {
+  { generic_device_init_address, hw_shm_init_data },
+  { hw_shm_attach_address_callback, }, /* address */
+  { hw_shm_io_read_buffer,
+    hw_shm_io_write_buffer }, /* IO */
+  { NULL, }, /* DMA */
+  { NULL, }, /* interrupt */
+  { NULL, }, /* unit */
+  NULL,
+};
+
+static void *
+hw_shm_create(const char *name,
+		 const device_unit *unit_address,
+		 const char *args)
+{
+  hw_shm_device *shm = ZALLOC(hw_shm_device);
+  return shm;
+}
+
+
+
+const device_descriptor hw_shm_device_descriptor[] = {
+  { "shm", hw_shm_create, &hw_shm_callbacks },
+  { NULL },
+};
+
+#endif /* _HW_SHM_C_ */
