25 #include <sys/ptrace.h>
30 #ifndef PTRACE_GET_THREAD_AREA
31 #define PTRACE_GET_THREAD_AREA 25
35 #define TIC6X_NUM_REGS 69
37 #include <asm/ptrace.h>
60 #if __BYTE_ORDER == __BIG_ENDIAN
63 53, 52, 55, 54, 57, 56, 59, 58,
64 61, 60, 63, 62, 65, 64, 67, 66,
66 23, 22, 25, 24, 27, 26, 29, 28,
67 31, 30, 33, 32, 35, 34, 69, 68,
71 37, 36, 39, 38, 41, 40, 43, 42,
72 45, 44, 47, 46, 49, 48, 51, 50,
74 7, 6, 9, 8, 11, 10, 13, 12,
75 15, 14, 17, 16, 19, 18, 21, 20,
82 51, 50, 53, 52, 55, 54, 57, 56,
83 59, 58, 61, 60, 63, 62, 65, 64,
85 21, 20, 23, 22, 25, 24, 27, 26,
86 29, 28, 31, 30, 33, 32, 67, 66,
90 35, 34, 37, 36, 39, 38, 41, 40,
91 43, 42, 45, 44, 47, 46, 49, 48,
93 5, 4, 7, 6, 9, 8, 11, 10,
94 13, 12, 15, 14, 17, 16, 19, 18,
100 19, 18, 21, 20, 23, 22, 25, 24,
101 27, 26, 29, 28, 31, 30, 33, 32,
103 5, 4, 7, 6, 9, 8, 11, 10,
104 13, 12, 15, 14, 17, 16, 35, 34,
107 -1, -1, -1, -1, -1, -1, -1, -1,
108 -1, -1, -1, -1, -1, -1, -1, -1,
109 -1, -1, -1, -1, -1, -1, -1, -1,
110 -1, -1, -1, -1, -1, -1, -1, -1,
115 static int tic6x_regmap_c64xp[] = {
117 52, 53, 54, 55, 56, 57, 58, 59,
118 60, 61, 62, 63, 64, 65, 66, 67,
120 22, 23, 24, 25, 26, 27, 28, 29,
121 30, 31, 32, 33, 34, 35, 68, 69,
125 36, 37, 38, 39, 40, 41, 42, 43,
126 44, 45, 46, 47, 48, 49, 50, 51,
128 6, 7, 8, 9, 10, 11, 12, 13,
129 14, 15, 16, 17, 18, 19, 20, 31,
134 static int tic6x_regmap_c64x[] = {
136 50, 51, 52, 53, 54, 55, 56, 57,
137 58, 59, 60, 61, 62, 63, 64, 65,
139 20, 21, 22, 23, 24, 25, 26, 27,
140 28, 29, 30, 31, 32, 33, 66, 67,
144 34, 35, 36, 37, 38, 39, 40, 41,
145 42, 43, 44, 45, 46, 47, 48, 49,
147 4, 5, 6, 7, 8, 9, 10, 11,
148 12, 13, 14, 15, 16, 17, 18, 19,
152 static int tic6x_regmap_c62x[] = {
154 18, 19, 20, 21, 22, 23, 24, 25,
155 26, 27, 28, 29, 30, 31, 32, 33,
157 4, 5, 6, 7, 8, 9, 10, 11,
158 12, 13, 14, 15, 16, 17, 34, 35,
161 -1, -1, -1, -1, -1, -1, -1, -1,
162 -1, -1, -1, -1, -1, -1, -1, -1,
163 -1, -1, -1, -1, -1, -1, -1, -1,
164 -1, -1, -1, -1, -1, -1, -1, -1,
181 register unsigned int csr
asm (
"B2");
186 __asm__ (
"MVC .S2 CSR,%0" :
"=r" (csr) :);
193 tic6x_breakpoint = 0x0000a122;
198 tic6x_breakpoint = 0x0000a122;
203 tic6x_breakpoint = 0x0000a122;
210 tic6x_breakpoint = 0x56454314;
214 error (
"Unknown CPU ID 0x%02x", cpuid);
223 return (tic6x_regmap[regno] == -1);
229 return (tic6x_regmap[regno] == -1);
250 #define tic6x_breakpoint_len 4
258 if (insn == tic6x_breakpoint)
270 lwpid_t lwpid,
int idx,
void **base)
278 *base = (
void *) ((
char *) *base - idx);
309 if (tic6x_regmap[i] != -1)
320 if (tic6x_regmap[i] != -1)
325 { PTRACE_GETREGS, PTRACE_SETREGS, 0,
TIC6X_NUM_REGS * 4, GENERAL_REGS,
327 { 0, 0, 0, -1, -1, NULL, NULL }
349 static struct regs_info regs_info =
356 static const struct regs_info *
370 (
const unsigned char *) &tic6x_breakpoint,
385 initialize_regsets_info (&tic6x_regsets_info);
static void tic6x_fill_gregset(struct regcache *regcache, void *buf)
const struct target_desc * tdesc_tic6x_c64xp_linux
void collect_register(struct regcache *regcache, int n, void *buf)
void supply_register_by_name(struct regcache *regcache, const char *name, const void *buf)
#define PTRACE_GET_THREAD_AREA
static int tic6x_cannot_fetch_register(int regno)
static const struct regs_info * tic6x_regs_info(void)
static void tic6x_collect_register(struct regcache *regcache, int regno, union tic6x_register *reg)
static struct regset_info tic6x_regsets[]
void initialize_low_arch(void)
struct target_ops * the_target
static struct regs_info regs_info
const struct target_desc * tdesc_tic6x_c64x_linux
const struct target_desc * tdesc
static void tic6x_supply_register(struct regcache *regcache, int regno, const union tic6x_register *reg)
void collect_register_by_name(struct regcache *regcache, const char *name, void *buf)
static int tic6x_regmap_c62x[]
static int * tic6x_regmap
static void tic6x_store_gregset(struct regcache *regcache, const void *buf)
static CORE_ADDR tic6x_get_pc(struct regcache *regcache)
void init_registers_tic6x_c64xp_linux(void)
struct process_info * current_process(void)
#define tic6x_breakpoint_len
static struct usrregs_info tic6x_usrregs_info
static int tic6x_regmap_c64x[]
ps_err_e ps_get_thread_area(const struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
static unsigned int tic6x_breakpoint
int(* read_memory)(CORE_ADDR memaddr, unsigned char *myaddr, int len)
void init_registers_tic6x_c62x_linux(void)
static const struct target_desc * tic6x_read_description(void)
static int tic6x_cannot_store_register(int regno)
const struct target_desc * tdesc_tic6x_c62x_linux
static int tic6x_regmap_c64xp[]
static void tic6x_set_pc(struct regcache *regcache, CORE_ADDR pc)
static int tic6x_breakpoint_at(CORE_ADDR where)
static void tic6x_arch_setup(void)
void supply_register(struct regcache *regcache, int n, const void *buf)
static struct regsets_info tic6x_regsets_info
void error(const char *fmt,...)
void init_registers_tic6x_c64x_linux(void)