GDBserver
Classes | Macros | Functions | Variables
linux-ppc-low.c File Reference
#include "server.h"
#include "linux-low.h"
#include <elf.h>
#include <asm/ptrace.h>
#include "nat/ppc-linux.h"

Go to the source code of this file.

Classes

struct  gdb_evrregset_t
 

Macros

#define ppc_num_regs   73
 
#define INSTR_SC   0x44000002
 
#define NR_spu_run   0x0116
 
#define ppc_breakpoint_len   4
 
#define SIZEOF_VSXREGS   32*8
 
#define SIZEOF_VRREGS   33*16+4
 

Functions

void init_registers_powerpc_32l (void)
 
void init_registers_powerpc_altivec32l (void)
 
void init_registers_powerpc_cell32l (void)
 
void init_registers_powerpc_vsx32l (void)
 
void init_registers_powerpc_isa205_32l (void)
 
void init_registers_powerpc_isa205_altivec32l (void)
 
void init_registers_powerpc_isa205_vsx32l (void)
 
void init_registers_powerpc_e500l (void)
 
void init_registers_powerpc_64l (void)
 
void init_registers_powerpc_altivec64l (void)
 
void init_registers_powerpc_cell64l (void)
 
void init_registers_powerpc_vsx64l (void)
 
void init_registers_powerpc_isa205_64l (void)
 
void init_registers_powerpc_isa205_altivec64l (void)
 
void init_registers_powerpc_isa205_vsx64l (void)
 
static int ppc_cannot_store_register (int regno)
 
static int ppc_cannot_fetch_register (int regno)
 
static void ppc_collect_ptrace_register (struct regcache *regcache, int regno, char *buf)
 
static void ppc_supply_ptrace_register (struct regcache *regcache, int regno, const char *buf)
 
static int parse_spufs_run (struct regcache *regcache, int *fd, CORE_ADDR *addr)
 
static CORE_ADDR ppc_get_pc (struct regcache *regcache)
 
static void ppc_set_pc (struct regcache *regcache, CORE_ADDR pc)
 
static int ppc_get_hwcap (unsigned long *valp)
 
static void ppc_arch_setup (void)
 
static int ppc_breakpoint_at (CORE_ADDR where)
 
static void ppc_fill_gregset (struct regcache *regcache, void *buf)
 
static void ppc_fill_vsxregset (struct regcache *regcache, void *buf)
 
static void ppc_store_vsxregset (struct regcache *regcache, const void *buf)
 
static void ppc_fill_vrregset (struct regcache *regcache, void *buf)
 
static void ppc_store_vrregset (struct regcache *regcache, const void *buf)
 
static void ppc_fill_evrregset (struct regcache *regcache, void *buf)
 
static void ppc_store_evrregset (struct regcache *regcache, const void *buf)
 
static const struct regs_infoppc_regs_info (void)
 
void initialize_low_arch (void)
 

Variables

static unsigned long ppc_hwcap
 
const struct target_desctdesc_powerpc_32l
 
const struct target_desctdesc_powerpc_altivec32l
 
const struct target_desctdesc_powerpc_cell32l
 
const struct target_desctdesc_powerpc_vsx32l
 
const struct target_desctdesc_powerpc_isa205_32l
 
const struct target_desctdesc_powerpc_isa205_altivec32l
 
const struct target_desctdesc_powerpc_isa205_vsx32l
 
const struct target_desctdesc_powerpc_e500l
 
const struct target_desctdesc_powerpc_64l
 
const struct target_desctdesc_powerpc_altivec64l
 
const struct target_desctdesc_powerpc_cell64l
 
const struct target_desctdesc_powerpc_vsx64l
 
const struct target_desctdesc_powerpc_isa205_64l
 
const struct target_desctdesc_powerpc_isa205_altivec64l
 
const struct target_desctdesc_powerpc_isa205_vsx64l
 
static int ppc_regmap []
 
static int ppc_regmap_e500 []
 
static struct usrregs_info ppc_usrregs_info
 
static int ppc_regmap_adjusted
 
static const unsigned int ppc_breakpoint = 0x7d821008
 
static struct regset_info ppc_regsets []
 
static struct regsets_info ppc_regsets_info
 
static struct regs_info regs_info
 
struct linux_target_ops the_low_target
 

Macro Definition Documentation

#define INSTR_SC   0x44000002

Definition at line 241 of file linux-ppc-low.c.

Referenced by parse_spufs_run().

#define NR_spu_run   0x0116

Definition at line 242 of file linux-ppc-low.c.

Referenced by parse_spufs_run().

#define ppc_breakpoint_len   4

Definition at line 487 of file linux-ppc-low.c.

#define ppc_num_regs   73

Definition at line 91 of file linux-ppc-low.c.

#define SIZEOF_VRREGS   33*16+4

Definition at line 562 of file linux-ppc-low.c.

#define SIZEOF_VSXREGS   32*8

Definition at line 532 of file linux-ppc-low.c.

Function Documentation

void init_registers_powerpc_32l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_64l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_altivec32l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_altivec64l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_cell32l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_cell64l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_e500l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_isa205_32l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_isa205_64l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_isa205_altivec32l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_isa205_altivec64l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_isa205_vsx32l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_isa205_vsx64l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_vsx32l ( void  )

Referenced by initialize_low_arch().

void init_registers_powerpc_vsx64l ( void  )

Referenced by initialize_low_arch().

void initialize_low_arch ( void  )
static int parse_spufs_run ( struct regcache regcache,
int *  fd,
CORE_ADDR addr 
)
static
static void ppc_arch_setup ( void  )
static
static int ppc_breakpoint_at ( CORE_ADDR  where)
static
static int ppc_cannot_fetch_register ( int  regno)
static

Definition at line 184 of file linux-ppc-low.c.

static int ppc_cannot_store_register ( int  regno)
static
static void ppc_collect_ptrace_register ( struct regcache regcache,
int  regno,
char *  buf 
)
static

Definition at line 190 of file linux-ppc-low.c.

References collect_register(), perror_with_name(), register_size(), and regcache::tdesc.

Referenced by ppc_fill_gregset().

static void ppc_fill_evrregset ( struct regcache regcache,
void *  buf 
)
static
static void ppc_fill_gregset ( struct regcache regcache,
void *  buf 
)
static

Definition at line 518 of file linux-ppc-low.c.

References ppc_collect_ptrace_register(), and ppc_regmap.

static void ppc_fill_vrregset ( struct regcache regcache,
void *  buf 
)
static
static void ppc_fill_vsxregset ( struct regcache regcache,
void *  buf 
)
static
static int ppc_get_hwcap ( unsigned long *  valp)
static
static CORE_ADDR ppc_get_pc ( struct regcache regcache)
static
static const struct regs_info* ppc_regs_info ( void  )
static

Definition at line 675 of file linux-ppc-low.c.

References regs_info.

static void ppc_set_pc ( struct regcache regcache,
CORE_ADDR  pc 
)
static
static void ppc_store_evrregset ( struct regcache regcache,
const void *  buf 
)
static
static void ppc_store_vrregset ( struct regcache regcache,
const void *  buf 
)
static
static void ppc_store_vsxregset ( struct regcache regcache,
const void *  buf 
)
static
static void ppc_supply_ptrace_register ( struct regcache regcache,
int  regno,
const char *  buf 
)
static

Variable Documentation

const unsigned int ppc_breakpoint = 0x7d821008
static

Definition at line 486 of file linux-ppc-low.c.

Referenced by ppc_breakpoint_at().

unsigned long ppc_hwcap
static
int ppc_regmap[]
static
Initial value:
=
{PT_R0 * 4, PT_R1 * 4, PT_R2 * 4, PT_R3 * 4,
PT_R4 * 4, PT_R5 * 4, PT_R6 * 4, PT_R7 * 4,
PT_R8 * 4, PT_R9 * 4, PT_R10 * 4, PT_R11 * 4,
PT_R12 * 4, PT_R13 * 4, PT_R14 * 4, PT_R15 * 4,
PT_R16 * 4, PT_R17 * 4, PT_R18 * 4, PT_R19 * 4,
PT_R20 * 4, PT_R21 * 4, PT_R22 * 4, PT_R23 * 4,
PT_R24 * 4, PT_R25 * 4, PT_R26 * 4, PT_R27 * 4,
PT_R28 * 4, PT_R29 * 4, PT_R30 * 4, PT_R31 * 4,
PT_FPR0*4, PT_FPR0*4 + 8, PT_FPR0*4+16, PT_FPR0*4+24,
PT_FPR0*4+32, PT_FPR0*4+40, PT_FPR0*4+48, PT_FPR0*4+56,
PT_FPR0*4+64, PT_FPR0*4+72, PT_FPR0*4+80, PT_FPR0*4+88,
PT_FPR0*4+96, PT_FPR0*4+104, PT_FPR0*4+112, PT_FPR0*4+120,
PT_FPR0*4+128, PT_FPR0*4+136, PT_FPR0*4+144, PT_FPR0*4+152,
PT_FPR0*4+160, PT_FPR0*4+168, PT_FPR0*4+176, PT_FPR0*4+184,
PT_FPR0*4+192, PT_FPR0*4+200, PT_FPR0*4+208, PT_FPR0*4+216,
PT_FPR0*4+224, PT_FPR0*4+232, PT_FPR0*4+240, PT_FPR0*4+248,
PT_NIP * 4, PT_MSR * 4, PT_CCR * 4, PT_LNK * 4,
PT_CTR * 4, PT_XER * 4, PT_FPSCR * 4,
}
#define PT_ORIG_R3
Definition: ppc-linux.h:26
#define PT_TRAP
Definition: ppc-linux.h:29

Definition at line 118 of file linux-ppc-low.c.

Referenced by ppc_arch_setup(), and ppc_fill_gregset().

int ppc_regmap_adjusted
static

Definition at line 383 of file linux-ppc-low.c.

Referenced by ppc_arch_setup().

int ppc_regmap_e500[]
static
Initial value:
=
{PT_R0 * 4, PT_R1 * 4, PT_R2 * 4, PT_R3 * 4,
PT_R4 * 4, PT_R5 * 4, PT_R6 * 4, PT_R7 * 4,
PT_R8 * 4, PT_R9 * 4, PT_R10 * 4, PT_R11 * 4,
PT_R12 * 4, PT_R13 * 4, PT_R14 * 4, PT_R15 * 4,
PT_R16 * 4, PT_R17 * 4, PT_R18 * 4, PT_R19 * 4,
PT_R20 * 4, PT_R21 * 4, PT_R22 * 4, PT_R23 * 4,
PT_R24 * 4, PT_R25 * 4, PT_R26 * 4, PT_R27 * 4,
PT_R28 * 4, PT_R29 * 4, PT_R30 * 4, PT_R31 * 4,
-1, -1, -1, -1,
-1, -1, -1, -1,
-1, -1, -1, -1,
-1, -1, -1, -1,
-1, -1, -1, -1,
-1, -1, -1, -1,
-1, -1, -1, -1,
-1, -1, -1, -1,
PT_NIP * 4, PT_MSR * 4, PT_CCR * 4, PT_LNK * 4,
PT_CTR * 4, PT_XER * 4, -1,
}
#define PT_ORIG_R3
Definition: ppc-linux.h:26
#define PT_TRAP
Definition: ppc-linux.h:29

Definition at line 140 of file linux-ppc-low.c.

Referenced by ppc_arch_setup().

struct regset_info ppc_regsets[]
static
Initial value:
= {
{ PTRACE_GETEVRREGS, PTRACE_SETEVRREGS, 0, 32 * 4 + 8 + 4, EXTENDED_REGS,
{ 0, 0, 0, 0, GENERAL_REGS, ppc_fill_gregset, NULL },
{ 0, 0, 0, -1, -1, NULL, NULL }
}
#define SIZEOF_VSXREGS
static void ppc_store_vsxregset(struct regcache *regcache, const void *buf)
static void ppc_fill_evrregset(struct regcache *regcache, void *buf)
#define PTRACE_GETEVRREGS
Definition: ppc-linux.h:81
static void ppc_store_evrregset(struct regcache *regcache, const void *buf)
static void ppc_fill_vrregset(struct regcache *regcache, void *buf)
#define PTRACE_SETEVRREGS
Definition: ppc-linux.h:82
#define SIZEOF_VRREGS
static void ppc_fill_vsxregset(struct regcache *regcache, void *buf)
#define PTRACE_SETVRREGS
Definition: ppc-linux.h:68
#define PTRACE_GETVRREGS
Definition: ppc-linux.h:67
#define PTRACE_GETVSXREGS
Definition: ppc-linux.h:73
#define PTRACE_SETVSXREGS
Definition: ppc-linux.h:74
static void ppc_store_vrregset(struct regcache *regcache, const void *buf)
static void ppc_fill_gregset(struct regcache *regcache, void *buf)

Definition at line 639 of file linux-ppc-low.c.

struct regsets_info ppc_regsets_info
static
Initial value:
=
{
0,
NULL,
}
static struct regset_info ppc_regsets[]

Definition at line 660 of file linux-ppc-low.c.

Referenced by initialize_low_arch().

static struct usrregs_info ppc_usrregs_info
static
Initial value:
=
{
}
#define ppc_num_regs
Definition: linux-ppc-low.c:91
static int ppc_regmap[]

Definition at line 381 of file linux-ppc-low.c.

Referenced by ppc_arch_setup().

struct regs_info regs_info
static
Initial value:
=
{
NULL,
}
static struct regsets_info ppc_regsets_info
static struct usrregs_info ppc_usrregs_info

Definition at line 667 of file linux-ppc-low.c.

Referenced by ppc_regs_info().

const struct target_desc* tdesc_powerpc_32l

Referenced by ppc_arch_setup().

const struct target_desc* tdesc_powerpc_64l

Referenced by ppc_arch_setup().

const struct target_desc* tdesc_powerpc_altivec32l

Referenced by ppc_arch_setup().

const struct target_desc* tdesc_powerpc_altivec64l

Referenced by ppc_arch_setup().

const struct target_desc* tdesc_powerpc_cell32l

Referenced by ppc_arch_setup().

const struct target_desc* tdesc_powerpc_cell64l

Referenced by ppc_arch_setup().

const struct target_desc* tdesc_powerpc_e500l

Referenced by ppc_arch_setup().

const struct target_desc* tdesc_powerpc_isa205_32l
const struct target_desc* tdesc_powerpc_isa205_64l
const struct target_desc* tdesc_powerpc_isa205_altivec32l

Referenced by ppc_arch_setup().

const struct target_desc* tdesc_powerpc_isa205_altivec64l

Referenced by ppc_arch_setup().

const struct target_desc* tdesc_powerpc_isa205_vsx32l

Referenced by ppc_arch_setup().

const struct target_desc* tdesc_powerpc_isa205_vsx64l

Referenced by ppc_arch_setup().

const struct target_desc* tdesc_powerpc_vsx32l

Referenced by ppc_arch_setup().

const struct target_desc* tdesc_powerpc_vsx64l

Referenced by ppc_arch_setup().

struct linux_target_ops the_low_target
Initial value:
= {
NULL,
(const unsigned char *) &ppc_breakpoint,
NULL,
0,
NULL,
NULL,
NULL,
NULL,
NULL,
}
static int ppc_cannot_fetch_register(int regno)
static void ppc_collect_ptrace_register(struct regcache *regcache, int regno, char *buf)
static int ppc_breakpoint_at(CORE_ADDR where)
#define ppc_breakpoint_len
static int ppc_cannot_store_register(int regno)
static void ppc_supply_ptrace_register(struct regcache *regcache, int regno, const char *buf)
static CORE_ADDR ppc_get_pc(struct regcache *regcache)
static void ppc_arch_setup(void)
static const unsigned int ppc_breakpoint
static const struct regs_info * ppc_regs_info(void)
static void ppc_set_pc(struct regcache *regcache, CORE_ADDR pc)

Definition at line 680 of file linux-ppc-low.c.