2003-06-20 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / sim / ppc / sim_calls.c
index 22aa21b18dd4edc398150e2b30d2706c7dd75185..040ce83320291cab7967a139a0bdadc13068ace0 100644 (file)
@@ -1,6 +1,6 @@
 /*  This file is part of the program psim.
 
-    Copyright (C) 1994-1996,1998, Andrew Cagney <cagney@highland.com.au>
+    Copyright 1994, 1995, 1996, 1998, 2003 Andrew Cagney
 
     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
@@ -180,7 +180,7 @@ sim_write (SIM_DESC sd, SIM_ADDR mem, unsigned char *buf, int length)
 int
 sim_fetch_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
 {
-  char *regname;
+  const char *regname;
 
   if (simulator == NULL) {
     return 0;
@@ -194,43 +194,33 @@ sim_fetch_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
      But there are loops that just walk through the entire list of
      names and try to get everything.  */
   regname = gdbarch_register_name (current_gdbarch, regno);
-  /* FIXME: ezannoni 2002/04/15 Remove the 'vr' and 'vscr' check
-     once AltiVec support is committed.  */
-  if (! regname || regname[0] == '\0'
-      || (regname[0] == 'v' && regname[1] == 'r')
-      || (strcmp (regname, "vscr") == 0))
+  if (! regname || regname[0] == '\0')
     return -1;
 
   TRACE(trace_gdb, ("sim_fetch_register(regno=%d(%s), buf=0x%lx)\n",
                    regno, regname, (long)buf));
-  psim_read_register(simulator, MAX_NR_PROCESSORS,
-                    buf, regname, raw_transfer);
-  return -1;
+  return psim_read_register(simulator, MAX_NR_PROCESSORS,
+                           buf, regname, raw_transfer);
 }
 
 
 int
 sim_store_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
 {
-  char *regname;
+  const char *regname;
 
   if (simulator == NULL)
     return 0;
 
   /* See comments in sim_fetch_register, above.  */
   regname = gdbarch_register_name (current_gdbarch, regno);
-  /* FIXME: ezannoni 2002/04/15 Remove the 'vr' and 'vscr' check
-     once AltiVec support is committed.  */
-  if (! regname || regname[0] == '\0'
-      || (regname[0] == 'v' && regname[1] == 'r')
-      || (strcmp (regname, "vscr") == 0))
+  if (! regname || regname[0] == '\0')
     return -1;
 
   TRACE(trace_gdb, ("sim_store_register(regno=%d(%s), buf=0x%lx)\n",
                    regno, regname, (long)buf));
-  psim_write_register(simulator, MAX_NR_PROCESSORS,
-                     buf, regname, raw_transfer);
-  return -1;
+  return psim_write_register(simulator, MAX_NR_PROCESSORS,
+                            buf, regname, raw_transfer);
 }
 
 
@@ -263,8 +253,8 @@ sim_create_inferior (SIM_DESC sd,
   psim_init(simulator);
   psim_stack(simulator, argv, envp);
 
-  psim_write_register(simulator, -1 /* all start at same PC */,
-                     &entry_point, "pc", cooked_transfer);
+  ASSERT (psim_write_register(simulator, -1 /* all start at same PC */,
+                             &entry_point, "pc", cooked_transfer) > 0);
   return SIM_RC_OK;
 }
 
This page took 0.023719 seconds and 4 git commands to generate.