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"
#include "linux-ppc-tdesc.h"
#include "ax.h"
#include "tracepoint.h"

Go to the source code of this file.

Classes

struct  gdb_evrregset_t
 

Macros

#define PPC_FIELD(value, from, len)   (((value) >> (32 - (from) - (len))) & ((1 << (len)) - 1))
 
#define PPC_SEXT(v, bs)
 
#define PPC_OP6(insn)   PPC_FIELD (insn, 0, 6)
 
#define PPC_BO(insn)   PPC_FIELD (insn, 6, 5)
 
#define PPC_LI(insn)   (PPC_SEXT (PPC_FIELD (insn, 6, 24), 24) << 2)
 
#define PPC_BD(insn)   (PPC_SEXT (PPC_FIELD (insn, 16, 14), 14) << 2)
 
#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
 
#define GEN_STD(buf, rs, ra, offset)   gen_ds_form (buf, 62, rs, ra, offset, 0)
 
#define GEN_STDU(buf, rs, ra, offset)   gen_ds_form (buf, 62, rs, ra, offset, 1)
 
#define GEN_LD(buf, rt, ra, offset)   gen_ds_form (buf, 58, rt, ra, offset, 0)
 
#define GEN_LDU(buf, rt, ra, offset)   gen_ds_form (buf, 58, rt, ra, offset, 1)
 
#define GEN_ADDI(buf, rt, ra, si)   gen_d_form (buf, 14, rt, ra, si)
 
#define GEN_ADDIS(buf, rt, ra, si)   gen_d_form (buf, 15, rt, ra, si)
 
#define GEN_LI(buf, rt, si)   GEN_ADDI (buf, rt, 0, si)
 
#define GEN_LIS(buf, rt, si)   GEN_ADDIS (buf, rt, 0, si)
 
#define GEN_ORI(buf, rt, ra, si)   gen_d_form (buf, 24, rt, ra, si)
 
#define GEN_ORIS(buf, rt, ra, si)   gen_d_form (buf, 25, rt, ra, si)
 
#define GEN_LWZ(buf, rt, ra, si)   gen_d_form (buf, 32, rt, ra, si)
 
#define GEN_STW(buf, rt, ra, si)   gen_d_form (buf, 36, rt, ra, si)
 
#define GEN_STWU(buf, rt, ra, si)   gen_d_form (buf, 37, rt, ra, si)
 
#define GEN_MFSPR(buf, rt, spr)   gen_xfx_form (buf, 31, rt, spr, 339)
 
#define GEN_MTSPR(buf, rt, spr)   gen_xfx_form (buf, 31, rt, spr, 467)
 
#define GEN_MFCR(buf, rt)   gen_xfx_form (buf, 31, rt, 0, 19)
 
#define GEN_MTCR(buf, rt)   gen_xfx_form (buf, 31, rt, 0x3cf, 144)
 
#define GEN_SYNC(buf, L, E)
 
#define GEN_LWSYNC(buf)   GEN_SYNC (buf, 1, 0)
 
#define GEN_OR(buf, ra, rs, rb)   gen_x_form (buf, 31, rs, ra, rb, 444, 0)
 
#define GEN_MR(buf, ra, rs)   GEN_OR (buf, ra, rs, rs)
 
#define GEN_LWARX(buf, rt, ra, rb)   gen_x_form (buf, 31, rt, ra, rb, 20, 0)
 
#define GEN_STWCX(buf, rs, ra, rb)   gen_x_form (buf, 31, rs, ra, rb, 150, 1)
 
#define GEN_CMPW(buf, ra, rb)   gen_x_form (buf, 31, 28, ra, rb, 0, 0)
 
#define GEN_RLDICL(buf, ra, rs, sh, mb)   gen_md_form (buf, 30, rs, ra, sh, mb, 0, 0)
 
#define GEN_RLDICR(buf, ra, rs, sh, mb)   gen_md_form (buf, 30, rs, ra, sh, mb, 1, 0)
 
#define GEN_B(buf, li)   gen_i_form (buf, 18, li, 0, 0)
 
#define GEN_BL(buf, li)   gen_i_form (buf, 18, li, 0, 1)
 
#define GEN_BNE(buf, bd)   gen_b_form (buf, 16, 0x4, (7 << 2) | 2, bd, 0 ,0)
 
#define GEN_LOAD(buf, rt, ra, si, is_64)   GEN_LWZ (buf, rt, ra, si)
 
#define GEN_STORE(buf, rt, ra, si, is_64)   GEN_STW (buf, rt, ra, si)
 
#define __EMIT_ASM(NAME, INSNS)
 
#define _EMIT_ASM(NAME, INSNS)   __EMIT_ASM (NAME, INSNS)
 
#define EMIT_ASM(INSNS)   _EMIT_ASM (__LINE__, INSNS)
 
#define TOP_FIRST   "4"
 
#define TOP_SECOND   "3"
 
#define TMP_FIRST   "6"
 
#define TMP_SECOND   "5"
 

Functions

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_auxv (unsigned long type, unsigned long *valp)
 
static const gdb_byteppc_sw_breakpoint_from_kind (int kind, int *size)
 
static int ppc_breakpoint_at (CORE_ADDR where)
 
static int ppc_supports_z_point_type (char z_type)
 
static int ppc_insert_point (enum raw_bkpt_type type, CORE_ADDR addr, int size, struct raw_breakpoint *bp)
 
static int ppc_remove_point (enum raw_bkpt_type type, CORE_ADDR addr, int size, struct raw_breakpoint *bp)
 
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 int ppc_supports_hardware_single_step (void)
 
static const struct regs_infoppc_regs_info (void)
 
static void ppc_arch_setup (void)
 
static int ppc_supports_tracepoints (void)
 
static int ppc_get_thread_area (int lwpid, CORE_ADDR *addr)
 
 __attribute__ ((unused))
 
static int gen_d_form (uint32_t *buf, int opcd, int rst, int ra, int si)
 
static int gen_xfx_form (uint32_t *buf, int opcd, int rst, int ri, int xo)
 
static int gen_x_form (uint32_t *buf, int opcd, int rst, int ra, int rb, int xo, int rc)
 
static int gen_md_form (uint32_t *buf, int opcd, int rs, int ra, int sh, int mb, int xo, int rc)
 
static int gen_i_form (uint32_t *buf, int opcd, int li, int aa, int lk)
 
static int gen_b_form (uint32_t *buf, int opcd, int bo, int bi, int bd, int aa, int lk)
 
static int gen_limm (uint32_t *buf, int reg, uint64_t imm, int is_64)
 
static int gen_atomic_xchg (uint32_t *buf, CORE_ADDR lock, int old_value, int r_new, int is_64)
 
static int gen_call (uint32_t *buf, CORE_ADDR fn, int is_64, int is_opd)
 
static void ppc_relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc)
 
static int ppc_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint, CORE_ADDR tpaddr, CORE_ADDR collector, CORE_ADDR lockaddr, ULONGEST orig_size, CORE_ADDR *jump_entry, CORE_ADDR *trampoline, ULONGEST *trampoline_size, unsigned char *jjump_pad_insn, ULONGEST *jjump_pad_insn_size, CORE_ADDR *adjusted_insn_addr, CORE_ADDR *adjusted_insn_addr_end, char *err)
 
static int ppc_get_min_fast_tracepoint_insn_len (void)
 
static void emit_insns (uint32_t *buf, int n)
 
static void ppc_emit_prologue (void)
 
static void ppc_emit_epilogue (void)
 
static void ppc_emit_add (void)
 
static void ppc_emit_sub (void)
 
static void ppc_emit_mul (void)
 
static void ppc_emit_lsh (void)
 
static void ppc_emit_rsh_signed (void)
 
static void ppc_emit_rsh_unsigned (void)
 
static void ppc_emit_ext (int arg)
 
static void ppc_emit_zero_ext (int arg)
 
static void ppc_emit_log_not (void)
 
static void ppc_emit_bit_and (void)
 
static void ppc_emit_bit_or (void)
 
static void ppc_emit_bit_xor (void)
 
static void ppc_emit_bit_not (void)
 
static void ppc_emit_equal (void)
 
static void ppc_emit_less_signed (void)
 
static void ppc_emit_less_unsigned (void)
 
static void ppc_emit_ref (int size)
 
static void ppc_emit_const (LONGEST num)
 
static void ppc_emit_reg (int reg)
 
static void ppc_emit_pop (void)
 
static void ppc_emit_stack_flush (void)
 
static void ppc_emit_swap (void)
 
static void ppc_emit_stack_adjust (int n)
 
static void ppc_emit_call (CORE_ADDR fn)
 
static void ppc_emit_int_call_1 (CORE_ADDR fn, int arg1)
 
static void ppc_emit_void_call_2 (CORE_ADDR fn, int arg1)
 
static void ppc_emit_if_goto (int *offset_p, int *size_p)
 
static void ppc_emit_goto (int *offset_p, int *size_p)
 
static void ppc_emit_eq_goto (int *offset_p, int *size_p)
 
static void ppc_emit_ne_goto (int *offset_p, int *size_p)
 
static void ppc_emit_lt_goto (int *offset_p, int *size_p)
 
static void ppc_emit_le_goto (int *offset_p, int *size_p)
 
static void ppc_emit_gt_goto (int *offset_p, int *size_p)
 
static void ppc_emit_ge_goto (int *offset_p, int *size_p)
 
static void ppc_write_goto_address (CORE_ADDR from, CORE_ADDR to, int size)
 
static struct emit_opsppc_emit_ops (void)
 
static int ppc_get_ipa_tdesc_idx (void)
 
void initialize_low_arch (void)
 

Variables

static unsigned long ppc_hwcap
 
static int ppc_regmap []
 
static int ppc_regmap_e500 []
 
static int ppc_regmap_adjusted
 
static const unsigned int ppc_breakpoint = 0x7d821008
 
static struct regset_info ppc_regsets []
 
static struct usrregs_info ppc_usrregs_info
 
static struct regsets_info ppc_regsets_info
 
static struct regs_info regs_info
 
static struct emit_ops ppc_emit_ops_impl
 
struct linux_target_ops the_low_target
 

Macro Definition Documentation

◆ __EMIT_ASM

#define __EMIT_ASM (   NAME,
  INSNS 
)
Value:
do \
{ \
extern uint32_t start_bcax_ ## NAME []; \
extern uint32_t end_bcax_ ## NAME []; \
emit_insns (start_bcax_ ## NAME, \
end_bcax_ ## NAME - start_bcax_ ## NAME); \
__asm__ (".section .text.__ppcbcax\n\t" \
"start_bcax_" #NAME ":\n\t" \
INSNS "\n\t" \
"end_bcax_" #NAME ":\n\t" \
".previous\n\t"); \
} while (0)

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

◆ _EMIT_ASM

#define _EMIT_ASM (   NAME,
  INSNS 
)    __EMIT_ASM (NAME, INSNS)

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

◆ EMIT_ASM

#define EMIT_ASM (   INSNS)    _EMIT_ASM (__LINE__, INSNS)

◆ GEN_ADDI

#define GEN_ADDI (   buf,
  rt,
  ra,
  si 
)    gen_d_form (buf, 14, rt, ra, si)

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

Referenced by ppc_emit_stack_adjust(), and ppc_install_fast_tracepoint_jump_pad().

◆ GEN_ADDIS

#define GEN_ADDIS (   buf,
  rt,
  ra,
  si 
)    gen_d_form (buf, 15, rt, ra, si)

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

◆ GEN_B

#define GEN_B (   buf,
  li 
)    gen_i_form (buf, 18, li, 0, 0)

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

Referenced by ppc_install_fast_tracepoint_jump_pad().

◆ GEN_BL

#define GEN_BL (   buf,
  li 
)    gen_i_form (buf, 18, li, 0, 1)

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

◆ GEN_BNE

#define GEN_BNE (   buf,
  bd 
)    gen_b_form (buf, 16, 0x4, (7 << 2) | 2, bd, 0 ,0)

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

Referenced by gen_atomic_xchg().

◆ GEN_CMPW

#define GEN_CMPW (   buf,
  ra,
  rb 
)    gen_x_form (buf, 31, 28, ra, rb, 0, 0)

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

Referenced by gen_atomic_xchg().

◆ GEN_LD

#define GEN_LD (   buf,
  rt,
  ra,
  offset 
)    gen_ds_form (buf, 58, rt, ra, offset, 0)

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

◆ GEN_LDU

#define GEN_LDU (   buf,
  rt,
  ra,
  offset 
)    gen_ds_form (buf, 58, rt, ra, offset, 1)

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

◆ GEN_LI

#define GEN_LI (   buf,
  rt,
  si 
)    GEN_ADDI (buf, rt, 0, si)

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

Referenced by gen_limm(), and ppc_emit_reg().

◆ GEN_LIS

#define GEN_LIS (   buf,
  rt,
  si 
)    GEN_ADDIS (buf, rt, 0, si)

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

Referenced by gen_limm().

◆ GEN_LOAD

#define GEN_LOAD (   buf,
  rt,
  ra,
  si,
  is_64 
)    GEN_LWZ (buf, rt, ra, si)

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

Referenced by gen_call(), and ppc_install_fast_tracepoint_jump_pad().

◆ GEN_LWARX

#define GEN_LWARX (   buf,
  rt,
  ra,
  rb 
)    gen_x_form (buf, 31, rt, ra, rb, 20, 0)

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

Referenced by gen_atomic_xchg().

◆ GEN_LWSYNC

#define GEN_LWSYNC (   buf)    GEN_SYNC (buf, 1, 0)

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

Referenced by ppc_install_fast_tracepoint_jump_pad().

◆ GEN_LWZ

#define GEN_LWZ (   buf,
  rt,
  ra,
  si 
)    gen_d_form (buf, 32, rt, ra, si)

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

Referenced by ppc_emit_reg(), and ppc_emit_void_call_2().

◆ GEN_MFCR

#define GEN_MFCR (   buf,
  rt 
)    gen_xfx_form (buf, 31, rt, 0, 19)

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

Referenced by ppc_install_fast_tracepoint_jump_pad().

◆ GEN_MFSPR

#define GEN_MFSPR (   buf,
  rt,
  spr 
)    gen_xfx_form (buf, 31, rt, spr, 339)

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

Referenced by ppc_install_fast_tracepoint_jump_pad().

◆ GEN_MR

#define GEN_MR (   buf,
  ra,
  rs 
)    GEN_OR (buf, ra, rs, rs)

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

Referenced by ppc_emit_void_call_2().

◆ GEN_MTCR

#define GEN_MTCR (   buf,
  rt 
)    gen_xfx_form (buf, 31, rt, 0x3cf, 144)

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

Referenced by ppc_install_fast_tracepoint_jump_pad().

◆ GEN_MTSPR

#define GEN_MTSPR (   buf,
  rt,
  spr 
)    gen_xfx_form (buf, 31, rt, spr, 467)

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

Referenced by gen_call(), and ppc_install_fast_tracepoint_jump_pad().

◆ GEN_OR

#define GEN_OR (   buf,
  ra,
  rs,
  rb 
)    gen_x_form (buf, 31, rs, ra, rb, 444, 0)

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

◆ GEN_ORI

#define GEN_ORI (   buf,
  rt,
  ra,
  si 
)    gen_d_form (buf, 24, rt, ra, si)

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

Referenced by gen_limm().

◆ GEN_ORIS

#define GEN_ORIS (   buf,
  rt,
  ra,
  si 
)    gen_d_form (buf, 25, rt, ra, si)

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

Referenced by gen_limm().

◆ GEN_RLDICL

#define GEN_RLDICL (   buf,
  ra,
  rs,
  sh,
  mb 
)    gen_md_form (buf, 30, rs, ra, sh, mb, 0, 0)

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

Referenced by gen_limm().

◆ GEN_RLDICR

#define GEN_RLDICR (   buf,
  ra,
  rs,
  sh,
  mb 
)    gen_md_form (buf, 30, rs, ra, sh, mb, 1, 0)

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

Referenced by gen_limm().

◆ GEN_STD

#define GEN_STD (   buf,
  rs,
  ra,
  offset 
)    gen_ds_form (buf, 62, rs, ra, offset, 0)

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

◆ GEN_STDU

#define GEN_STDU (   buf,
  rs,
  ra,
  offset 
)    gen_ds_form (buf, 62, rs, ra, offset, 1)

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

Referenced by ppc_install_fast_tracepoint_jump_pad().

◆ GEN_STORE

#define GEN_STORE (   buf,
  rt,
  ra,
  si,
  is_64 
)    GEN_STW (buf, rt, ra, si)

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

Referenced by ppc_install_fast_tracepoint_jump_pad().

◆ GEN_STW

#define GEN_STW (   buf,
  rt,
  ra,
  si 
)    gen_d_form (buf, 36, rt, ra, si)

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

Referenced by ppc_emit_void_call_2().

◆ GEN_STWCX

#define GEN_STWCX (   buf,
  rs,
  ra,
  rb 
)    gen_x_form (buf, 31, rs, ra, rb, 150, 1)

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

Referenced by gen_atomic_xchg().

◆ GEN_STWU

#define GEN_STWU (   buf,
  rt,
  ra,
  si 
)    gen_d_form (buf, 37, rt, ra, si)

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

Referenced by ppc_install_fast_tracepoint_jump_pad().

◆ GEN_SYNC

#define GEN_SYNC (   buf,
  L,
 
)
Value:
gen_xfx_form (buf, 31, L & 0x3, \
E & 0xf, 598)
static const struct aarch64_register x3
static int gen_xfx_form(uint32_t *buf, int opcd, int rst, int ri, int xo)

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

◆ INSTR_SC

#define INSTR_SC   0x44000002

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

Referenced by parse_spufs_run().

◆ NR_spu_run

#define NR_spu_run   0x0116

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

Referenced by parse_spufs_run().

◆ PPC_BD

#define PPC_BD (   insn)    (PPC_SEXT (PPC_FIELD (insn, 16, 14), 14) << 2)

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

Referenced by ppc_relocate_instruction().

◆ PPC_BO

#define PPC_BO (   insn)    PPC_FIELD (insn, 6, 5)

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

Referenced by ppc_relocate_instruction().

◆ ppc_breakpoint_len

#define ppc_breakpoint_len   4

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

Referenced by ppc_sw_breakpoint_from_kind().

◆ PPC_FIELD

#define PPC_FIELD (   value,
  from,
  len 
)    (((value) >> (32 - (from) - (len))) & ((1 << (len)) - 1))

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

◆ PPC_LI

#define PPC_LI (   insn)    (PPC_SEXT (PPC_FIELD (insn, 6, 24), 24) << 2)

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

Referenced by ppc_relocate_instruction().

◆ ppc_num_regs

#define ppc_num_regs   73

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

◆ PPC_OP6

#define PPC_OP6 (   insn)    PPC_FIELD (insn, 0, 6)

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

Referenced by ppc_relocate_instruction().

◆ PPC_SEXT

#define PPC_SEXT (   v,
  bs 
)
Value:
((((CORE_ADDR) (v) & (((CORE_ADDR) 1 << (bs)) - 1)) \
^ ((CORE_ADDR) 1 << ((bs) - 1))) \
- ((CORE_ADDR) 1 << ((bs) - 1)))
bfd_vma CORE_ADDR
Definition: common-types.h:41

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

◆ SIZEOF_VRREGS

#define SIZEOF_VRREGS   33*16+4

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

◆ SIZEOF_VSXREGS

#define SIZEOF_VSXREGS   32*8

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

◆ TMP_FIRST

#define TMP_FIRST   "6"

◆ TMP_SECOND

#define TMP_SECOND   "5"

◆ TOP_FIRST

#define TOP_FIRST   "4"

◆ TOP_SECOND

#define TOP_SECOND   "3"

Function Documentation

◆ __attribute__()

__attribute__ ( (unused)  )

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

References gdb_assert, and x3.

◆ emit_insns()

static void emit_insns ( uint32_t *  buf,
int  n 
)
static

◆ gen_atomic_xchg()

static int gen_atomic_xchg ( uint32_t *  buf,
CORE_ADDR  lock,
int  old_value,
int  r_new,
int  is_64 
)
static

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

References GEN_BNE, GEN_CMPW, gen_limm(), GEN_LWARX, and GEN_STWCX.

Referenced by ppc_install_fast_tracepoint_jump_pad().

◆ gen_b_form()

static int gen_b_form ( uint32_t *  buf,
int  opcd,
int  bo,
int  bi,
int  bd,
int  aa,
int  lk 
)
static

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

References gdb_assert.

◆ gen_call()

static int gen_call ( uint32_t *  buf,
CORE_ADDR  fn,
int  is_64,
int  is_opd 
)
static

◆ gen_d_form()

static int gen_d_form ( uint32_t *  buf,
int  opcd,
int  rst,
int  ra,
int  si 
)
static

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

References gdb_assert.

◆ gen_i_form()

static int gen_i_form ( uint32_t *  buf,
int  opcd,
int  li,
int  aa,
int  lk 
)
static

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

References gdb_assert.

◆ gen_limm()

static int gen_limm ( uint32_t *  buf,
int  reg,
uint64_t  imm,
int  is_64 
)
static

◆ gen_md_form()

static int gen_md_form ( uint32_t *  buf,
int  opcd,
int  rs,
int  ra,
int  sh,
int  mb,
int  xo,
int  rc 
)
static

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

References gdb_assert, and x1.

◆ gen_x_form()

static int gen_x_form ( uint32_t *  buf,
int  opcd,
int  rst,
int  ra,
int  rb,
int  xo,
int  rc 
)
static

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

References gdb_assert.

◆ gen_xfx_form()

static int gen_xfx_form ( uint32_t *  buf,
int  opcd,
int  rst,
int  ri,
int  xo 
)
static

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

References gdb_assert.

◆ initialize_low_arch()

void initialize_low_arch ( void  )

◆ parse_spufs_run()

static int parse_spufs_run ( struct regcache regcache,
int *  fd,
CORE_ADDR addr 
)
static

◆ ppc_arch_setup()

static void ppc_arch_setup ( void  )
static

◆ ppc_breakpoint_at()

static int ppc_breakpoint_at ( CORE_ADDR  where)
static

◆ ppc_cannot_fetch_register()

static int ppc_cannot_fetch_register ( int  regno)
static

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

◆ ppc_cannot_store_register()

static int ppc_cannot_store_register ( int  regno)
static

◆ ppc_collect_ptrace_register()

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

◆ ppc_emit_add()

static void ppc_emit_add ( void  )
static

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

References EMIT_ASM, TMP_FIRST, and TMP_SECOND.

◆ ppc_emit_bit_and()

static void ppc_emit_bit_and ( void  )
static

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

References EMIT_ASM, TMP_FIRST, and TMP_SECOND.

◆ ppc_emit_bit_not()

static void ppc_emit_bit_not ( void  )
static

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

References EMIT_ASM.

◆ ppc_emit_bit_or()

static void ppc_emit_bit_or ( void  )
static

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

References EMIT_ASM, TMP_FIRST, and TMP_SECOND.

◆ ppc_emit_bit_xor()

static void ppc_emit_bit_xor ( void  )
static

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

References EMIT_ASM, TMP_FIRST, and TMP_SECOND.

◆ ppc_emit_call()

static void ppc_emit_call ( CORE_ADDR  fn)
static

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

References emit_insns(), gdb_assert, and gen_call().

◆ ppc_emit_const()

static void ppc_emit_const ( LONGEST  num)
static

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

References emit_insns(), gdb_assert, and gen_limm().

◆ ppc_emit_epilogue()

static void ppc_emit_epilogue ( void  )
static

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

References EMIT_ASM, TOP_FIRST, and TOP_SECOND.

◆ ppc_emit_eq_goto()

static void ppc_emit_eq_goto ( int *  offset_p,
int *  size_p 
)
static

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

References EMIT_ASM, TMP_FIRST, TMP_SECOND, TOP_FIRST, and TOP_SECOND.

◆ ppc_emit_equal()

static void ppc_emit_equal ( void  )
static

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

References EMIT_ASM, TMP_FIRST, and TMP_SECOND.

◆ ppc_emit_ext()

static void ppc_emit_ext ( int  arg)
static

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

References EMIT_ASM, and emit_error.

◆ ppc_emit_ge_goto()

static void ppc_emit_ge_goto ( int *  offset_p,
int *  size_p 
)
static

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

References EMIT_ASM, TMP_FIRST, TMP_SECOND, TOP_FIRST, and TOP_SECOND.

◆ ppc_emit_goto()

static void ppc_emit_goto ( int *  offset_p,
int *  size_p 
)
static

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

References EMIT_ASM.

◆ ppc_emit_gt_goto()

static void ppc_emit_gt_goto ( int *  offset_p,
int *  size_p 
)
static

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

References EMIT_ASM, TMP_FIRST, TMP_SECOND, TOP_FIRST, and TOP_SECOND.

◆ ppc_emit_if_goto()

static void ppc_emit_if_goto ( int *  offset_p,
int *  size_p 
)
static

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

References EMIT_ASM, TOP_FIRST, and TOP_SECOND.

◆ ppc_emit_int_call_1()

static void ppc_emit_int_call_1 ( CORE_ADDR  fn,
int  arg1 
)
static

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

References EMIT_ASM, emit_insns(), gdb_assert, gen_call(), and gen_limm().

◆ ppc_emit_le_goto()

static void ppc_emit_le_goto ( int *  offset_p,
int *  size_p 
)
static

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

References EMIT_ASM, TMP_FIRST, TMP_SECOND, TOP_FIRST, and TOP_SECOND.

◆ ppc_emit_less_signed()

static void ppc_emit_less_signed ( void  )
static

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

References EMIT_ASM, TMP_FIRST, and TMP_SECOND.

◆ ppc_emit_less_unsigned()

static void ppc_emit_less_unsigned ( void  )
static

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

References EMIT_ASM, TMP_FIRST, and TMP_SECOND.

◆ ppc_emit_log_not()

static void ppc_emit_log_not ( void  )
static

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

References EMIT_ASM.

◆ ppc_emit_lsh()

static void ppc_emit_lsh ( void  )
static

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

References EMIT_ASM, TMP_FIRST, and TMP_SECOND.

◆ ppc_emit_lt_goto()

static void ppc_emit_lt_goto ( int *  offset_p,
int *  size_p 
)
static

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

References EMIT_ASM, TMP_FIRST, TMP_SECOND, TOP_FIRST, and TOP_SECOND.

◆ ppc_emit_mul()

static void ppc_emit_mul ( void  )
static

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

References EMIT_ASM, TMP_FIRST, and TMP_SECOND.

◆ ppc_emit_ne_goto()

static void ppc_emit_ne_goto ( int *  offset_p,
int *  size_p 
)
static

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

References EMIT_ASM, TMP_FIRST, TMP_SECOND, TOP_FIRST, and TOP_SECOND.

◆ ppc_emit_ops()

static struct emit_ops* ppc_emit_ops ( void  )
static

◆ ppc_emit_pop()

static void ppc_emit_pop ( void  )
static

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

References EMIT_ASM, TOP_FIRST, and TOP_SECOND.

◆ ppc_emit_prologue()

static void ppc_emit_prologue ( void  )
static

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

References EMIT_ASM.

◆ ppc_emit_ref()

static void ppc_emit_ref ( int  size)
static

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

References EMIT_ASM.

◆ ppc_emit_reg()

static void ppc_emit_reg ( int  reg)
static

◆ ppc_emit_rsh_signed()

static void ppc_emit_rsh_signed ( void  )
static

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

References EMIT_ASM, TMP_FIRST, and TMP_SECOND.

◆ ppc_emit_rsh_unsigned()

static void ppc_emit_rsh_unsigned ( void  )
static

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

References EMIT_ASM, TMP_FIRST, and TMP_SECOND.

◆ ppc_emit_stack_adjust()

static void ppc_emit_stack_adjust ( int  n)
static

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

References emit_error, emit_insns(), gdb_assert, and GEN_ADDI.

◆ ppc_emit_stack_flush()

static void ppc_emit_stack_flush ( void  )
static

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

References EMIT_ASM, TOP_FIRST, and TOP_SECOND.

◆ ppc_emit_sub()

static void ppc_emit_sub ( void  )
static

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

References EMIT_ASM, TMP_FIRST, and TMP_SECOND.

◆ ppc_emit_swap()

static void ppc_emit_swap ( void  )
static

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

References EMIT_ASM, TMP_FIRST, TMP_SECOND, TOP_FIRST, and TOP_SECOND.

◆ ppc_emit_void_call_2()

static void ppc_emit_void_call_2 ( CORE_ADDR  fn,
int  arg1 
)
static

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

References emit_insns(), gdb_assert, gen_call(), gen_limm(), GEN_LWZ, GEN_MR, and GEN_STW.

◆ ppc_emit_zero_ext()

static void ppc_emit_zero_ext ( int  arg)
static

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

References EMIT_ASM, and emit_error.

◆ ppc_fill_evrregset()

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

◆ ppc_fill_gregset()

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

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

References ppc_collect_ptrace_register(), and ppc_regmap.

◆ ppc_fill_vrregset()

static void ppc_fill_vrregset ( struct regcache regcache,
void *  buf 
)
static

◆ ppc_fill_vsxregset()

static void ppc_fill_vsxregset ( struct regcache regcache,
void *  buf 
)
static

◆ ppc_get_auxv()

static int ppc_get_auxv ( unsigned long  type,
unsigned long *  valp 
)
static

◆ ppc_get_ipa_tdesc_idx()

static int ppc_get_ipa_tdesc_idx ( void  )
static

◆ ppc_get_min_fast_tracepoint_insn_len()

static int ppc_get_min_fast_tracepoint_insn_len ( void  )
static

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

◆ ppc_get_pc()

static CORE_ADDR ppc_get_pc ( struct regcache regcache)
static

◆ ppc_get_thread_area()

static int ppc_get_thread_area ( int  lwpid,
CORE_ADDR addr 
)
static

◆ ppc_insert_point()

static int ppc_insert_point ( enum raw_bkpt_type  type,
CORE_ADDR  addr,
int  size,
struct raw_breakpoint bp 
)
static

◆ ppc_install_fast_tracepoint_jump_pad()

static int ppc_install_fast_tracepoint_jump_pad ( CORE_ADDR  tpoint,
CORE_ADDR  tpaddr,
CORE_ADDR  collector,
CORE_ADDR  lockaddr,
ULONGEST  orig_size,
CORE_ADDR jump_entry,
CORE_ADDR trampoline,
ULONGEST trampoline_size,
unsigned char *  jjump_pad_insn,
ULONGEST jjump_pad_insn_size,
CORE_ADDR adjusted_insn_addr,
CORE_ADDR adjusted_insn_addr_end,
char *  err 
)
static

◆ ppc_regs_info()

static const struct regs_info* ppc_regs_info ( void  )
static

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

References regs_info.

◆ ppc_relocate_instruction()

static void ppc_relocate_instruction ( CORE_ADDR to,
CORE_ADDR  oldloc 
)
static

◆ ppc_remove_point()

static int ppc_remove_point ( enum raw_bkpt_type  type,
CORE_ADDR  addr,
int  size,
struct raw_breakpoint bp 
)
static

◆ ppc_set_pc()

static void ppc_set_pc ( struct regcache regcache,
CORE_ADDR  pc 
)
static

◆ ppc_store_evrregset()

static void ppc_store_evrregset ( struct regcache regcache,
const void *  buf 
)
static

◆ ppc_store_vrregset()

static void ppc_store_vrregset ( struct regcache regcache,
const void *  buf 
)
static

◆ ppc_store_vsxregset()

static void ppc_store_vsxregset ( struct regcache regcache,
const void *  buf 
)
static

◆ ppc_supply_ptrace_register()

static void ppc_supply_ptrace_register ( struct regcache regcache,
int  regno,
const char *  buf 
)
static

◆ ppc_supports_hardware_single_step()

static int ppc_supports_hardware_single_step ( void  )
static

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

◆ ppc_supports_tracepoints()

static int ppc_supports_tracepoints ( void  )
static

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

◆ ppc_supports_z_point_type()

static int ppc_supports_z_point_type ( char  z_type)
static

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

References Z_PACKET_ACCESS_WP, Z_PACKET_HW_BP, Z_PACKET_SW_BP, and Z_PACKET_WRITE_WP.

◆ ppc_sw_breakpoint_from_kind()

static const gdb_byte* ppc_sw_breakpoint_from_kind ( int  kind,
int *  size 
)
static

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

References ppc_breakpoint, and ppc_breakpoint_len.

◆ ppc_write_goto_address()

static void ppc_write_goto_address ( CORE_ADDR  from,
CORE_ADDR  to,
int  size 
)
static

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

References emit_error, read_inferior_memory(), and write_inferior_memory().

Variable Documentation

◆ ppc_breakpoint

const unsigned int ppc_breakpoint = 0x7d821008
static

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

Referenced by ppc_breakpoint_at(), and ppc_sw_breakpoint_from_kind().

◆ ppc_emit_ops_impl

struct emit_ops ppc_emit_ops_impl
static

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

Referenced by ppc_emit_ops().

◆ ppc_hwcap

unsigned long ppc_hwcap
static

◆ ppc_regmap

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 72 of file linux-ppc-low.c.

Referenced by ppc_arch_setup(), and ppc_fill_gregset().

◆ ppc_regmap_adjusted

int ppc_regmap_adjusted
static

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

Referenced by ppc_arch_setup().

◆ ppc_regmap_e500

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 94 of file linux-ppc-low.c.

Referenced by ppc_arch_setup().

◆ ppc_regsets

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 },
NULL_REGSET
}
#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 575 of file linux-ppc-low.c.

◆ ppc_regsets_info

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

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

Referenced by initialize_low_arch().

◆ ppc_usrregs_info

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

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

Referenced by ppc_arch_setup().

◆ regs_info

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 603 of file linux-ppc-low.c.

Referenced by ppc_regs_info().

◆ the_low_target

struct linux_target_ops the_low_target

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