OpenOCD
nds32_v3m.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 /***************************************************************************
4  * Copyright (C) 2013 Andes Technology *
5  * Hsiangkai Wang <hkwang@andestech.com> *
6  ***************************************************************************/
7 
8 #ifdef HAVE_CONFIG_H
9 #include "config.h"
10 #endif
11 
12 #include "breakpoints.h"
13 #include "nds32_cmd.h"
14 #include "nds32_aice.h"
15 #include "nds32_v3m.h"
16 #include "nds32_v3_common.h"
17 
19 {
20  struct nds32_v3m_common *nds32_v3m = target_to_nds32_v3m(target);
21  struct aice_port_s *aice = target_to_aice(target);
22  struct breakpoint *bp;
23  unsigned brp_num = nds32_v3m->n_hbr - 1;
24 
25  for (bp = target->breakpoints; bp; bp = bp->next) {
26  if (bp->type == BKPT_SOFT) {
27  /* already set at nds32_v3m_add_breakpoint() */
28  continue;
29  } else if (bp->type == BKPT_HARD) {
30  /* set address */
31  aice_write_debug_reg(aice, NDS_EDM_SR_BPA0 + brp_num, bp->address);
32  /* set mask */
33  aice_write_debug_reg(aice, NDS_EDM_SR_BPAM0 + brp_num, 0);
34 
35  if (nds32_v3m->nds32.memory.address_translation)
36  /* enable breakpoint (virtual address) */
37  aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + brp_num, 0x2);
38  else
39  /* enable breakpoint (physical address) */
40  aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + brp_num, 0xA);
41 
42  LOG_DEBUG("Add hardware BP %u at %08" TARGET_PRIxADDR, brp_num,
43  bp->address);
44 
45  brp_num--;
46  } else {
47  return ERROR_FAIL;
48  }
49  }
50 
51  return ERROR_OK;
52 }
53 
55 {
56  struct nds32_v3m_common *nds32_v3m = target_to_nds32_v3m(target);
57  struct aice_port_s *aice = target_to_aice(target);
58  struct breakpoint *bp;
59  unsigned brp_num = nds32_v3m->n_hbr - 1;
60 
61  for (bp = target->breakpoints; bp; bp = bp->next) {
62  if (bp->type == BKPT_SOFT)
63  continue;
64  else if (bp->type == BKPT_HARD)
65  /* disable breakpoint */
66  aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + brp_num, 0x0);
67  else
68  return ERROR_FAIL;
69 
70  LOG_DEBUG("Remove hardware BP %u at %08" TARGET_PRIxADDR, brp_num,
71  bp->address);
72 
73  brp_num--;
74  }
75 
76  return ERROR_OK;
77 }
78 
80 {
81  struct aice_port_s *aice = target_to_aice(target);
82  struct nds32_v3m_common *nds32_v3m = target_to_nds32_v3m(target);
83  struct watchpoint *wp;
84  int32_t wp_num = 0;
85  uint32_t wp_config = 0;
86  bool ld_stop, st_stop;
87 
88  if (nds32_v3m->nds32.global_stop)
89  ld_stop = st_stop = false;
90 
91  for (wp = target->watchpoints; wp; wp = wp->next) {
92 
93  if (wp_num < nds32_v3m->used_n_wp) {
94  wp->mask = wp->length - 1;
95  if ((wp->address % wp->length) != 0)
96  wp->mask = (wp->mask << 1) + 1;
97 
98  if (wp->rw == WPT_READ)
99  wp_config = 0x3;
100  else if (wp->rw == WPT_WRITE)
101  wp_config = 0x5;
102  else if (wp->rw == WPT_ACCESS)
103  wp_config = 0x7;
104 
105  /* set/unset physical address bit of BPCn according to PSW.DT */
106  if (nds32_v3m->nds32.memory.address_translation == false)
107  wp_config |= 0x8;
108 
109  /* set address */
110  aice_write_debug_reg(aice, NDS_EDM_SR_BPA0 + wp_num,
111  wp->address - (wp->address % wp->length));
112  /* set mask */
113  aice_write_debug_reg(aice, NDS_EDM_SR_BPAM0 + wp_num, wp->mask);
114  /* enable watchpoint */
115  aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + wp_num, wp_config);
116 
117  LOG_DEBUG("Add hardware watchpoint %" PRId32 " at %08" TARGET_PRIxADDR
118  " mask %08" PRIx32, wp_num, wp->address, wp->mask);
119 
120  wp_num++;
121  } else if (nds32_v3m->nds32.global_stop) {
122  if (wp->rw == WPT_READ)
123  ld_stop = true;
124  else if (wp->rw == WPT_WRITE)
125  st_stop = true;
126  else if (wp->rw == WPT_ACCESS)
127  ld_stop = st_stop = true;
128  }
129  }
130 
131  if (nds32_v3m->nds32.global_stop) {
132  uint32_t edm_ctl;
133  aice_read_debug_reg(aice, NDS_EDM_SR_EDM_CTL, &edm_ctl);
134  if (ld_stop)
135  edm_ctl |= 0x10;
136  if (st_stop)
137  edm_ctl |= 0x20;
139  }
140 
141  return ERROR_OK;
142 }
143 
145 {
146  struct nds32_v3m_common *nds32_v3m = target_to_nds32_v3m(target);
147  struct aice_port_s *aice = target_to_aice(target);
148  struct watchpoint *wp;
149  int32_t wp_num = 0;
150  bool clean_global_stop = false;
151 
152  for (wp = target->watchpoints; wp; wp = wp->next) {
153 
154  if (wp_num < nds32_v3m->used_n_wp) {
155  /* disable watchpoint */
156  aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + wp_num, 0x0);
157 
158  LOG_DEBUG("Remove hardware watchpoint %" PRId32 " at %08" TARGET_PRIxADDR
159  " mask %08" PRIx32, wp_num, wp->address, wp->mask);
160  wp_num++;
161  } else if (nds32_v3m->nds32.global_stop) {
162  clean_global_stop = true;
163  }
164  }
165 
166  if (clean_global_stop) {
167  uint32_t edm_ctl;
168  aice_read_debug_reg(aice, NDS_EDM_SR_EDM_CTL, &edm_ctl);
169  edm_ctl = edm_ctl & (~0x30);
171  }
172 
173  return ERROR_OK;
174 }
175 
177 {
178  uint32_t val_ir0;
179  uint32_t value;
180 
181  /* Save interrupt level */
182  nds32_get_mapped_reg(nds32, IR0, &val_ir0);
183  nds32->current_interrupt_level = (val_ir0 >> 1) & 0x3;
184 
186  LOG_ERROR("<-- TARGET ERROR! Reaching the max interrupt stack level %" PRIu32 ". -->",
188 
189  /* backup $ir6 to avoid suppressed exception overwrite */
191 
192  return ERROR_OK;
193 }
194 
196 {
197  uint32_t value;
198 
199  /* get backup value from cache */
200  /* then set back to make the register dirty */
203 
206 
207  return ERROR_OK;
208 }
209 
211 {
212  int retval;
213 
215 
216  if (target->state != TARGET_HALTED) {
217  /* reset only */
218  LOG_WARNING("%s: ran after reset and before halt ...",
220  retval = target_halt(target);
221  if (retval != ERROR_OK)
222  return retval;
223 
224  }
225 
226  return ERROR_OK;
227 }
228 
230  struct breakpoint *breakpoint)
231 {
232  struct nds32_v3m_common *nds32_v3m = target_to_nds32_v3m(target);
233  struct nds32 *nds32 = &(nds32_v3m->nds32);
234  int result;
235 
236  if (breakpoint->type == BKPT_HARD) {
237  /* check hardware resource */
238  if (nds32_v3m->next_hbr_index < nds32_v3m->next_hwp_index) {
239  LOG_WARNING("<-- TARGET WARNING! Insert too many "
240  "hardware breakpoints/watchpoints! "
241  "The limit of combined hardware "
242  "breakpoints/watchpoints is %" PRId32 ". -->",
243  nds32_v3m->n_hbr);
244  LOG_WARNING("<-- TARGET STATUS: Inserted number of "
245  "hardware breakpoint: %" PRId32 ", hardware "
246  "watchpoints: %" PRId32 ". -->",
247  nds32_v3m->n_hbr - nds32_v3m->next_hbr_index - 1,
248  nds32_v3m->used_n_wp);
250  }
251 
252  /* update next place to put hardware breakpoint */
253  nds32_v3m->next_hbr_index--;
254 
255  /* hardware breakpoint insertion occurs before 'continue' actually */
256  return ERROR_OK;
257  } else if (breakpoint->type == BKPT_SOFT) {
259  if (result != ERROR_OK) {
260  /* auto convert to hardware breakpoint if failed */
261  if (nds32->auto_convert_hw_bp) {
262  /* convert to hardware breakpoint */
264 
266  }
267  }
268 
269  return result;
270  } else /* unrecognized breakpoint type */
271  return ERROR_FAIL;
272 
273  return ERROR_OK;
274 }
275 
277  struct breakpoint *breakpoint)
278 {
279  struct nds32_v3m_common *nds32_v3m = target_to_nds32_v3m(target);
280 
281  if (breakpoint->type == BKPT_HARD) {
282  if (nds32_v3m->next_hbr_index >= nds32_v3m->n_hbr - 1)
283  return ERROR_FAIL;
284 
285  /* update next place to put hardware breakpoint */
286  nds32_v3m->next_hbr_index++;
287 
288  /* hardware breakpoint removal occurs after 'halted' actually */
289  return ERROR_OK;
290  } else if (breakpoint->type == BKPT_SOFT) {
292  } else /* unrecognized breakpoint type */
293  return ERROR_FAIL;
294 
295  return ERROR_OK;
296 }
297 
299  struct watchpoint *watchpoint)
300 {
301  struct nds32_v3m_common *nds32_v3m = target_to_nds32_v3m(target);
302 
303  /* check hardware resource */
304  if (nds32_v3m->next_hwp_index >= nds32_v3m->n_hwp) {
305  /* No hardware resource */
306  if (nds32_v3m->nds32.global_stop) {
307  LOG_WARNING("<-- TARGET WARNING! The number of "
308  "watchpoints exceeds the hardware "
309  "resources. Stop at every load/store "
310  "instruction to check for watchpoint matches. -->");
311  return ERROR_OK;
312  }
313 
314  LOG_WARNING("<-- TARGET WARNING! Insert too many hardware "
315  "watchpoints! The limit of hardware watchpoints "
316  "is %" PRId32 ". -->", nds32_v3m->n_hwp);
317  LOG_WARNING("<-- TARGET STATUS: Inserted number of "
318  "hardware watchpoint: %" PRId32 ". -->",
319  nds32_v3m->used_n_wp);
321  }
322 
323  if (nds32_v3m->next_hwp_index > nds32_v3m->next_hbr_index) {
324  /* No hardware resource */
325  if (nds32_v3m->nds32.global_stop) {
326  LOG_WARNING("<-- TARGET WARNING! The number of "
327  "watchpoints exceeds the hardware "
328  "resources. Stop at every load/store "
329  "instruction to check for watchpoint matches. -->");
330  return ERROR_OK;
331  }
332 
333  LOG_WARNING("<-- TARGET WARNING! Insert too many hardware "
334  "breakpoints/watchpoints! The limit of combined "
335  "hardware breakpoints/watchpoints is %" PRId32 ". -->",
336  nds32_v3m->n_hbr);
337  LOG_WARNING("<-- TARGET STATUS: Inserted number of "
338  "hardware breakpoint: %" PRId32 ", hardware "
339  "watchpoints: %" PRId32 ". -->",
340  nds32_v3m->n_hbr - nds32_v3m->next_hbr_index - 1,
341  nds32_v3m->used_n_wp);
343  }
344 
345  /* update next place to put hardware watchpoint */
346  nds32_v3m->next_hwp_index++;
347  nds32_v3m->used_n_wp++;
348 
349  return ERROR_OK;
350 }
351 
353  struct watchpoint *watchpoint)
354 {
355  struct nds32_v3m_common *nds32_v3m = target_to_nds32_v3m(target);
356 
357  if (nds32_v3m->next_hwp_index <= 0) {
358  if (nds32_v3m->nds32.global_stop)
359  return ERROR_OK;
360 
361  return ERROR_FAIL;
362  }
363 
364  /* update next place to put hardware watchpoint */
365  nds32_v3m->next_hwp_index--;
366  nds32_v3m->used_n_wp--;
367 
368  return ERROR_OK;
369 }
370 
373  .restore_interrupt_stack = nds32_v3m_restore_interrupt_stack,
374  .activate_hardware_breakpoint = nds32_v3m_activate_hardware_breakpoint,
375  .activate_hardware_watchpoint = nds32_v3m_activate_hardware_watchpoint,
376  .deactivate_hardware_breakpoint = nds32_v3m_deactivate_hardware_breakpoint,
377  .deactivate_hardware_watchpoint = nds32_v3m_deactivate_hardware_watchpoint,
378 };
379 
380 static int nds32_v3m_target_create(struct target *target, Jim_Interp *interp)
381 {
382  struct nds32_v3m_common *nds32_v3m;
383 
384  nds32_v3m = calloc(1, sizeof(*nds32_v3m));
385  if (!nds32_v3m)
386  return ERROR_FAIL;
387 
390 
391  return ERROR_OK;
392 }
393 
394 /* talk to the target and set things up */
395 static int nds32_v3m_examine(struct target *target)
396 {
397  struct nds32_v3m_common *nds32_v3m = target_to_nds32_v3m(target);
398  struct nds32 *nds32 = &(nds32_v3m->nds32);
399  struct aice_port_s *aice = target_to_aice(target);
400 
401  if (!target_was_examined(target)) {
403 
406  }
407 
408  uint32_t edm_cfg;
409  aice_read_debug_reg(aice, NDS_EDM_SR_EDM_CFG, &edm_cfg);
410 
411  /* get the number of hardware breakpoints */
412  nds32_v3m->n_hbr = (edm_cfg & 0x7) + 1;
413  nds32_v3m->used_n_wp = 0;
414 
415  /* get the number of hardware watchpoints */
416  /* If the WP field is hardwired to zero, it means this is a
417  * simple breakpoint. Otherwise, if the WP field is writable
418  * then it means this is a regular watchpoints. */
419  nds32_v3m->n_hwp = 0;
420  for (int32_t i = 0 ; i < nds32_v3m->n_hbr ; i++) {
422  uint32_t tmp_value;
423  aice_write_debug_reg(aice, NDS_EDM_SR_BPC0 + i, 0x1);
424  aice_read_debug_reg(aice, NDS_EDM_SR_BPC0 + i, &tmp_value);
425 
426  if (tmp_value)
427  nds32_v3m->n_hwp++;
428  }
429  /* hardware breakpoint is inserted from high index to low index */
430  nds32_v3m->next_hbr_index = nds32_v3m->n_hbr - 1;
431  /* hardware watchpoint is inserted from low index to high index */
432  nds32_v3m->next_hwp_index = 0;
433 
434  LOG_INFO("%s: total hardware breakpoint %" PRId32 " (simple breakpoint %" PRId32 ")",
435  target_name(target), nds32_v3m->n_hbr, nds32_v3m->n_hbr - nds32_v3m->n_hwp);
436  LOG_INFO("%s: total hardware watchpoint %" PRId32, target_name(target), nds32_v3m->n_hwp);
437 
440 
442 
443  return ERROR_OK;
444 }
445 
447 struct target_type nds32_v3m_target = {
448  .name = "nds32_v3m",
449 
450  .poll = nds32_poll,
451  .arch_state = nds32_arch_state,
452 
453  .target_request_data = nds32_v3_target_request_data,
454 
455  .halt = nds32_halt,
456  .resume = nds32_resume,
457  .step = nds32_step,
458 
459  .assert_reset = nds32_assert_reset,
460  .deassert_reset = nds32_v3m_deassert_reset,
461 
462  /* register access */
463  .get_gdb_reg_list = nds32_get_gdb_reg_list,
464 
465  /* memory access */
466  .read_buffer = nds32_v3_read_buffer,
467  .write_buffer = nds32_v3_write_buffer,
468  .read_memory = nds32_v3_read_memory,
469  .write_memory = nds32_v3_write_memory,
470 
471  .checksum_memory = nds32_v3_checksum_memory,
472 
473  /* breakpoint/watchpoint */
474  .add_breakpoint = nds32_v3m_add_breakpoint,
475  .remove_breakpoint = nds32_v3m_remove_breakpoint,
476  .add_watchpoint = nds32_v3m_add_watchpoint,
477  .remove_watchpoint = nds32_v3m_remove_watchpoint,
478  .hit_watchpoint = nds32_v3_hit_watchpoint,
479 
480  /* MMU */
481  .mmu = nds32_mmu,
482  .virt2phys = nds32_virtual_to_physical,
483  .read_phys_memory = nds32_read_phys_memory,
484  .write_phys_memory = nds32_write_phys_memory,
485 
486  .run_algorithm = nds32_v3_run_algorithm,
487 
488  .commands = nds32_command_handlers,
489  .target_create = nds32_v3m_target_create,
490  .init_target = nds32_v3_init_target,
491  .examine = nds32_v3m_examine,
492 
493  .get_gdb_fileio_info = nds32_get_gdb_fileio_info,
494  .gdb_fileio_end = nds32_gdb_fileio_end,
495 };
#define CHECK_RETVAL(action)
Definition: arc.h:246
@ BKPT_HARD
Definition: breakpoints.h:18
@ BKPT_SOFT
Definition: breakpoints.h:19
@ WPT_ACCESS
Definition: breakpoints.h:23
@ WPT_READ
Definition: breakpoints.h:23
@ WPT_WRITE
Definition: breakpoints.h:23
#define LOG_WARNING(expr ...)
Definition: log.h:120
#define ERROR_FAIL
Definition: log.h:161
#define LOG_ERROR(expr ...)
Definition: log.h:123
#define LOG_INFO(expr ...)
Definition: log.h:117
#define LOG_DEBUG(expr ...)
Definition: log.h:109
#define ERROR_OK
Definition: log.h:155
int nds32_poll(struct target *target)
Definition: nds32.c:2061
int nds32_mmu(struct target *target, int *enabled)
Definition: nds32.c:945
int nds32_halt(struct target *target)
Definition: nds32.c:2031
int nds32_gdb_fileio_end(struct target *target, int retcode, int fileio_errno, bool ctrl_c)
Definition: nds32.c:2458
int nds32_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
get all register list
Definition: nds32.c:596
int nds32_arch_state(struct target *target)
Definition: nds32.c:964
int nds32_get_mapped_reg(struct nds32 *nds32, unsigned regnum, uint32_t *value)
Definition: nds32.c:513
int nds32_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fileio_info)
Definition: nds32.c:2297
int nds32_edm_config(struct nds32 *nds32)
Definition: nds32.c:1554
int nds32_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
Definition: nds32.c:1750
int nds32_read_phys_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
Definition: nds32.c:812
int nds32_add_software_breakpoint(struct target *target, struct breakpoint *breakpoint)
Definition: nds32.c:1431
int nds32_virtual_to_physical(struct target *target, target_addr_t address, target_addr_t *physical)
Definition: nds32.c:1662
int nds32_write_phys_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
Definition: nds32.c:921
int nds32_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
Definition: nds32.c:2104
int nds32_set_mapped_reg(struct nds32 *nds32, unsigned regnum, uint32_t value)
set register internally
Definition: nds32.c:532
int nds32_assert_reset(struct target *target)
Definition: nds32.c:2176
int nds32_remove_software_breakpoint(struct target *target, struct breakpoint *breakpoint)
Definition: nds32.c:1469
int nds32_reset_halt(struct nds32 *nds32)
Definition: nds32.c:2605
static bool nds32_reach_max_interrupt_level(struct nds32 *nds32)
Definition: nds32.h:441
static struct aice_port_s * target_to_aice(struct target *target)
Definition: nds32.h:429
static int aice_write_debug_reg(struct aice_port_s *aice, uint32_t addr, const uint32_t val)
Definition: nds32_aice.h:85
static int aice_read_debug_reg(struct aice_port_s *aice, uint32_t addr, uint32_t *val)
Definition: nds32_aice.h:79
const struct command_registration nds32_command_handlers[]
Definition: nds32_cmd.c:1114
@ NDS_EDM_SR_BPAM0
Definition: nds32_edm.h:48
@ NDS_EDM_SR_EDM_CTL
Definition: nds32_edm.h:74
@ NDS_EDM_SR_BPA0
Definition: nds32_edm.h:40
@ NDS_EDM_SR_BPC0
Definition: nds32_edm.h:32
@ NDS_EDM_SR_EDM_CFG
Definition: nds32_edm.h:72
@ IR6
Definition: nds32_reg.h:67
@ IR0
Definition: nds32_reg.h:61
int nds32_v3_write_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
int nds32_v3_init_target(struct command_context *cmd_ctx, struct target *target)
int nds32_v3_run_algorithm(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t entry_point, target_addr_t exit_point, int timeout_ms, void *arch_info)
int nds32_v3_target_create_common(struct target *target, struct nds32 *nds32)
int nds32_v3_checksum_memory(struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum)
int nds32_v3_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
int nds32_v3_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
int nds32_v3_target_request_data(struct target *target, uint32_t size, uint8_t *buffer)
target_type functions:
int nds32_v3_hit_watchpoint(struct target *target, struct watchpoint **hit_watchpoint)
find out which watchpoint hits get exception address and compare the address to watchpoints
void nds32_v3_common_register_callback(struct nds32_v3_common_callback *callback)
int nds32_v3_write_buffer(struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer)
static int nds32_v3m_deassert_reset(struct target *target)
Definition: nds32_v3m.c:210
static struct nds32_v3_common_callback nds32_v3m_common_callback
Definition: nds32_v3m.c:371
static int nds32_v3m_examine(struct target *target)
Definition: nds32_v3m.c:395
static int nds32_v3m_remove_watchpoint(struct target *target, struct watchpoint *watchpoint)
Definition: nds32_v3m.c:352
static int nds32_v3m_deactivate_hardware_watchpoint(struct target *target)
Definition: nds32_v3m.c:144
static int nds32_v3m_activate_hardware_watchpoint(struct target *target)
Definition: nds32_v3m.c:79
static int nds32_v3m_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
Definition: nds32_v3m.c:298
static int nds32_v3m_remove_breakpoint(struct target *target, struct breakpoint *breakpoint)
Definition: nds32_v3m.c:276
static int nds32_v3m_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
Definition: nds32_v3m.c:229
struct target_type nds32_v3m_target
Holds methods for NDS32 V3m targets.
Definition: nds32_v3m.c:447
static int nds32_v3m_deactivate_hardware_breakpoint(struct target *target)
Definition: nds32_v3m.c:54
static int nds32_v3m_restore_interrupt_stack(struct nds32 *nds32)
Definition: nds32_v3m.c:195
static int nds32_v3m_check_interrupt_stack(struct nds32 *nds32)
Definition: nds32_v3m.c:176
static int nds32_v3m_activate_hardware_breakpoint(struct target *target)
Definition: nds32_v3m.c:18
static int nds32_v3m_target_create(struct target *target, Jim_Interp *interp)
Definition: nds32_v3m.c:380
static struct nds32_v3m_common * target_to_nds32_v3m(struct target *target)
Definition: nds32_v3m.h:35
struct breakpoint * next
Definition: breakpoints.h:34
enum breakpoint_type type
Definition: breakpoints.h:30
target_addr_t address
Definition: breakpoints.h:27
bool address_translation
Address translation.
Definition: nds32.h:164
int(* check_interrupt_stack)(struct nds32 *nds32)
int32_t next_hwp_index
next hardware watchpoint index
Definition: nds32_v3m.h:32
int32_t used_n_wp
number of used hardware watchpoints
Definition: nds32_v3m.h:23
int32_t next_hbr_index
next hardware breakpoint index
Definition: nds32_v3m.h:28
int32_t n_hwp
number of hardware watchpoints
Definition: nds32_v3m.h:20
int32_t n_hbr
number of hardware breakpoints
Definition: nds32_v3m.h:17
struct nds32 nds32
Definition: nds32_v3m.h:14
Represents a generic Andes core.
Definition: nds32.h:226
struct target * target
Backpointer to the target.
Definition: nds32.h:346
bool auto_convert_hw_bp
Flag to indicate if auto convert software breakpoints to hardware breakpoints or not in ROM.
Definition: nds32.h:340
bool reset_halt_as_examine
reset-halt as target examine
Definition: nds32.h:296
struct nds32_memory memory
Memory information.
Definition: nds32.h:235
bool global_stop
Flag reporting whether global stop is active.
Definition: nds32.h:290
uint32_t current_interrupt_level
current interrupt level
Definition: nds32.h:268
This holds methods shared between all instances of a given target type.
Definition: target_type.h:26
const char * name
Name of this type of target.
Definition: target_type.h:31
Definition: target.h:120
enum target_debug_reason debug_reason
Definition: target.h:159
enum target_state state
Definition: target.h:162
struct breakpoint * breakpoints
Definition: target.h:164
struct watchpoint * watchpoints
Definition: target.h:165
enum watchpoint_rw rw
Definition: breakpoints.h:44
uint32_t mask
Definition: breakpoints.h:42
struct watchpoint * next
Definition: breakpoints.h:47
uint32_t value
Definition: breakpoints.h:43
uint32_t length
Definition: breakpoints.h:41
target_addr_t address
Definition: breakpoints.h:40
int target_halt(struct target *target)
Definition: target.c:585
@ DBG_REASON_NOTHALTED
Definition: target.h:78
@ TARGET_HALTED
Definition: target.h:55
@ TARGET_RUNNING
Definition: target.h:54
static const char * target_name(struct target *target)
Returns the instance-specific name of the specified target.
Definition: target.h:234
#define ERROR_TARGET_RESOURCE_NOT_AVAILABLE
Definition: target.h:796
static void target_set_examined(struct target *target)
Sets the examined flag for the given target.
Definition: target.h:445
static bool target_was_examined(struct target *target)
Definition: target.h:438
#define TARGET_PRIxADDR
Definition: types.h:340