OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [delta68-nat.c] - Diff between revs 105 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 105 Rev 1765
/* Functions specific to running gdb native on a Motorola Delta Series sysV68.
/* Functions specific to running gdb native on a Motorola Delta Series sysV68.
   Copyright (C) 1993, 1997-98, Free Software Foundation, Inc.
   Copyright (C) 1993, 1997-98, Free Software Foundation, Inc.
 
 
   This file is part of GDB.
   This file is part of GDB.
 
 
   This program is free software; you can redistribute it and/or modify
   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
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   (at your option) any later version.
 
 
   This program is distributed in the hope that it will be useful,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */
   Boston, MA 02111-1307, USA.  */
 
 
#include "defs.h"
#include "defs.h"
#include <sys/signal.h>         /* for MAXSIG in sys/user.h */
#include <sys/signal.h>         /* for MAXSIG in sys/user.h */
#include <sys/types.h>          /* for ushort in sys/dir.h */
#include <sys/types.h>          /* for ushort in sys/dir.h */
#include <sys/dir.h>            /* for struct direct in sys/user.h */
#include <sys/dir.h>            /* for struct direct in sys/user.h */
#include <sys/user.h>
#include <sys/user.h>
 
 
#include <nlist.h>
#include <nlist.h>
 
 
#if !defined (offsetof)
#if !defined (offsetof)
#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
#endif
#endif
 
 
/* Return the address in the core dump or inferior of register REGNO.
/* Return the address in the core dump or inferior of register REGNO.
   BLOCKEND is the address of the end of the user structure.  */
   BLOCKEND is the address of the end of the user structure.  */
 
 
CORE_ADDR
CORE_ADDR
register_addr (regno, blockend)
register_addr (regno, blockend)
     int regno;
     int regno;
     CORE_ADDR blockend;
     CORE_ADDR blockend;
{
{
  static int sysv68reg[] =
  static int sysv68reg[] =
  {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, 15, 16};
  {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, 15, 16};
 
 
  if (regno >= 0 && regno < sizeof (sysv68reg) / sizeof (sysv68reg[0]))
  if (regno >= 0 && regno < sizeof (sysv68reg) / sizeof (sysv68reg[0]))
    return blockend + sysv68reg[regno] * 4;
    return blockend + sysv68reg[regno] * 4;
  else if (regno < FPC_REGNUM)
  else if (regno < FPC_REGNUM)
    return offsetof (struct user, u_fpu.regs.reg[regno - FP0_REGNUM][0]);
    return offsetof (struct user, u_fpu.regs.reg[regno - FP0_REGNUM][0]);
  else if (regno == FPC_REGNUM)
  else if (regno == FPC_REGNUM)
    return offsetof (struct user, u_fpu.regs.control);
    return offsetof (struct user, u_fpu.regs.control);
  else if (regno == FPS_REGNUM)
  else if (regno == FPS_REGNUM)
    return offsetof (struct user, u_fpu.regs.status);
    return offsetof (struct user, u_fpu.regs.status);
  else if (regno == FPI_REGNUM)
  else if (regno == FPI_REGNUM)
    return offsetof (struct user, u_fpu.regs.iaddr);
    return offsetof (struct user, u_fpu.regs.iaddr);
  else
  else
    {
    {
      fprintf_unfiltered (gdb_stderr, "\
      fprintf_unfiltered (gdb_stderr, "\
Internal error: invalid register number %d in REGISTER_U_ADDR\n",
Internal error: invalid register number %d in REGISTER_U_ADDR\n",
                          regno);
                          regno);
      return blockend;
      return blockend;
    }
    }
}
}
 
 
CORE_ADDR kernel_u_addr;
CORE_ADDR kernel_u_addr;
 
 
/* Read the value of the u area from the kernel.  */
/* Read the value of the u area from the kernel.  */
void
void
_initialize_delta68_nat ()
_initialize_delta68_nat ()
{
{
  struct nlist nl[2];
  struct nlist nl[2];
 
 
  nl[0].n_name = "u";
  nl[0].n_name = "u";
  nl[1].n_name = NULL;
  nl[1].n_name = NULL;
  if (nlist ("/sysV68", nl) == 0 && nl[0].n_scnum != 0)
  if (nlist ("/sysV68", nl) == 0 && nl[0].n_scnum != 0)
    kernel_u_addr = nl[0].n_value;
    kernel_u_addr = nl[0].n_value;
  else
  else
    {
    {
      perror ("Cannot get kernel u area address");
      perror ("Cannot get kernel u area address");
      exit (1);
      exit (1);
    }
    }
}
}
 
 
clear_insn_cache ()
clear_insn_cache ()
{
{
#ifdef MCT_TEXT                 /* in sys/signal.h on sysV68 R3V7.1 */
#ifdef MCT_TEXT                 /* in sys/signal.h on sysV68 R3V7.1 */
  memctl (0, 4096, MCT_TEXT);
  memctl (0, 4096, MCT_TEXT);
#endif
#endif
}
}
 
 
kernel_u_size ()
kernel_u_size ()
{
{
  return sizeof (struct user);
  return sizeof (struct user);
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.