This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PSIM Device Help Request


Hi,

I am taking a shot at updating a couple of
devices I wrote for psim years ago and
submitting them.  One maps UNIX shared
memory into simulated CPU space and
the other gives access to a UNIX semaphore
so you can protect the shared memory.

This was done against an older gdb version
and something has changed that I can't
put my finger on.


It works well enough to get UNIX devices
created and visible via ipcs but accessing
the device it should be at (0xc0000000)
results in a fault even at the gdb command line.

I suspect it is something in either the tree
file device definition or the requirements
for putting the device in simulated CPU address
space.


Attached is the diff and here is the tree file.

========================
/#address-cells 2
/openprom/options/oea-memory-size 8388608
/openprom/init/register/pvr 0xfffe0000
/shm@0xc0000000/reg 0xc0000000 0x10000
/shm@0xc0000000/key 0x1234
/sem@0xc0010000/reg 0xc0010000 12
/sem@0xc0010000/key 0x1234
/sem@0xc0010000/value 1
========================

Any advice on what step I am missing would really
be appreciated.

Thanks.

--joel sherrill
diff -uNr --exclude='*auto4mate.cache*' gdb-6.7.1-orig/sim/ppc/configure.ac gdb-6.7.1/sim/ppc/configure.ac
--- gdb-6.7.1-orig/sim/ppc/configure.ac	2006-05-31 10:14:45.000000000 -0500
+++ gdb-6.7.1/sim/ppc/configure.ac	2008-01-18 15:33:49.000000000 -0600
@@ -209,10 +209,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="";;
@@ -224,14 +319,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
diff -uNr --exclude='*auto4mate.cache*' gdb-6.7.1-orig/sim/ppc/debug.c gdb-6.7.1/sim/ppc/debug.c
--- gdb-6.7.1-orig/sim/ppc/debug.c	1999-04-15 20:35:08.000000000 -0500
+++ gdb-6.7.1/sim/ppc/debug.c	2008-01-18 15:33:49.000000000 -0600
@@ -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 --exclude='*auto4mate.cache*' gdb-6.7.1-orig/sim/ppc/debug.h gdb-6.7.1/sim/ppc/debug.h
--- gdb-6.7.1-orig/sim/ppc/debug.h	1999-04-15 20:35:08.000000000 -0500
+++ gdb-6.7.1/sim/ppc/debug.h	2008-01-18 15:33:49.000000000 -0600
@@ -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 --exclude='*auto4mate.cache*' gdb-6.7.1-orig/sim/ppc/hw_sem.c gdb-6.7.1/sim/ppc/hw_sem.c
--- gdb-6.7.1-orig/sim/ppc/hw_sem.c	1969-12-31 18:00:00.000000000 -0600
+++ gdb-6.7.1/sim/ppc/hw_sem.c	2008-01-18 15:33:49.000000000 -0600
@@ -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 --exclude='*auto4mate.cache*' gdb-6.7.1-orig/sim/ppc/hw_shm.c gdb-6.7.1/sim/ppc/hw_shm.c
--- gdb-6.7.1-orig/sim/ppc/hw_shm.c	1969-12-31 18:00:00.000000000 -0600
+++ gdb-6.7.1/sim/ppc/hw_shm.c	2008-01-25 14:32:35.000000000 -0600
@@ -0,0 +1,229 @@
+/*  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_ */
Binary files gdb-6.7.1-orig/sim/ppc/.hw_shm.c.swp and gdb-6.7.1/sim/ppc/.hw_shm.c.swp differ

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]