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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.2/] [gdb/] [gdbserver/] [linux-or32-low.c] - Diff between revs 446 and 447

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 446 Rev 447
Line 37... Line 37...
 
 
#ifdef HAVE_SYS_REG_H
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
#include <sys/reg.h>
#endif
#endif
 
 
 
 
 
/* -------------------------------------------------------------------------- */
 
/*!Global register map
 
 
 
   This should be in GDB order (r0-r1, ppc, npc, sr) to ptrace offset.
 
 
 
   ptrace does not support r0 (so we use r31 for now), nor ppc (so we use npc
 
   for now).
 
 
 
   @note This must be a global variable.
 
 
 
   @todo Fix r0 and ppc (needs ptrace changes).                               */
 
/* -------------------------------------------------------------------------- */
struct reg regs_or32[] = {
struct reg regs_or32[] = {
    { "npc", PC * 8, 32 },
  { "r0",  GPR31 * 8, 32 },
    { "sr", SR * 8, 32 },
 
    { "sp", SP * 8, 32 },
    { "sp", SP * 8, 32 },
    { "fp", GPR2 * 8, 32 },
    { "fp", GPR2 * 8, 32 },
    { "r3", GPR3 * 8, 32 },
    { "r3", GPR3 * 8, 32 },
    { "r4", GPR4 * 8, 32 },
    { "r4", GPR4 * 8, 32 },
    { "r5", GPR5 * 8, 32 },
    { "r5", GPR5 * 8, 32 },
Line 71... Line 83...
    { "r27", GPR27 * 8, 32 },
    { "r27", GPR27 * 8, 32 },
    { "r28", GPR28 * 8, 32 },
    { "r28", GPR28 * 8, 32 },
    { "r29", GPR29 * 8, 32 },
    { "r29", GPR29 * 8, 32 },
    { "r30", GPR30 * 8, 32 },
    { "r30", GPR30 * 8, 32 },
    { "r31", GPR31 * 8, 32 },
    { "r31", GPR31 * 8, 32 },
 
  { "ppc", PC    * 8, 32 },
 
  { "npc", PC    * 8, 32 },
 
  { "sr",  SR    * 8, 32 }
  };
  };
 
 
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/*!Initialize the register data.
/*!Initialize the register data.
 
 
Line 91... Line 106...
  gdbserver_expedite_regs = expedite_regs_or32;
  gdbserver_expedite_regs = expedite_regs_or32;
  gdbserver_xmltarget     = NULL;
  gdbserver_xmltarget     = NULL;
}
}
 
 
 
 
/*! OpenRISC Linux ptrace provides NPC, SR, then GPRS 1 to 31 */
/*! This is the number of *GDB* registers. I.e. r0-r31, PPC, NPC and SR. */
#define or32_num_regs  (2 + 31)
#define or32_num_regs  35
 
 
 
 
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/*!Provide the ptrace "address" of a register.
/*!Provide the ptrace "address" of a register.
                                                                              */
 
 
   This must be in GDB order (r0-r1, ppc, npc, sr) to ptrace offset. As with
 
   regs_or32, we substitute r31 for r0 and NPC for PPC.                       */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
static int or32_regmap[] = {
static int or32_regmap[] = {
#ifdef PC
  GPR31, SP,    GPR2,  GPR3,  GPR4,  GPR5,  GPR6,  GPR7,
  PC   , SR   , SP   , GPR2 , GPR3 , GPR4 , GPR5 , GPR6 ,
  GPR8,  GPR9,  GPR10, GPR11, GPR12, GPR13, GPR14, GPR15,
  GPR7 , GPR8 , GPR9 , GPR10, GPR11, GPR12, GPR13, GPR14,
  GPR16, GPR17, GPR18, GPR19, GPR20, GPR21, GPR22, GPR23,
  GPR15, GPR16, GPR17, GPR18, GPR19, GPR20, GPR21, GPR22,
  GPR24, GPR25, GPR26, GPR27, GPR28, GPR29, GPR30, GPR31,
  GPR23, GPR24, GPR25, GPR26, GPR27, GPR28, GPR29, GPR30,
  PC,    PC,    SR
  GPR31
 
#else
 
  4 *  0, 4 *  1, 4 *  2, 4 *  3, 4 *  4, 4 *  5, 4 *  6, 4 *  7,
 
  4 *  8, 4 *  9, 4 * 10, 4 * 11, 4 * 12, 4 * 13, 4 * 14, 4 * 15,
 
  4 * 16, 4 * 17, 4 * 18, 4 * 19, 4 * 20, 4 * 21, 4 * 22, 4 * 23,
 
  4 * 24, 4 * 25, 4 * 26, 4 * 27, 4 * 28, 4 * 29, 4 * 30, 4 * 31,
 
  4 * 32, 4 * 33, 4 * 34
 
#endif
 
};
};
 
 
 
 
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/*!Predicate to indicate if a register can be read.
/*!Predicate to indicate if a register can be read.

powered by: WebSVN 2.1.0

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