mirror of
https://github.com/linux-msm/openocd.git
synced 2026-02-25 13:15:07 -08:00
target: Add 64-bit target address support
Define a target_addr_t type to support 32-bit and 64-bit addresses at the same time. Also define matching TARGET_PRI*ADDR format macros as well as a convenient TARGET_ADDR_FMT. In targets that are 32-bit (avr32, nds32, arm7/9/11, fm4, xmc1000) be least invasive by leaving the formatting unchanged apart from the type; for generic code adopt TARGET_ADDR_FMT as unified address format. Don't silently change gdb formatting here, leave that to later. Add COMMAND_PARSE_ADDRESS() macro to abstract the address type. Implement it using its own parse_target_addr() function, in the hopes of catching pointer type mismatches better. Add '--disable-target64' configure option to revert to previous 32-bit target address behavior. Change-Id: I2e91d205862ceb14f94b3e72a7e99ee0373a85d5 Signed-off-by: Dongxue Zhang <elta.era@gmail.com> Signed-off-by: David Ung <david.ung.42@gmail.com> [AF: Default to enabling (Paul Fertser), rename macros, simplify] Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
This commit is contained in:
committed by
Matthias Welwarsky
parent
0ecee83266
commit
47b8cf8420
12
configure.ac
12
configure.ac
@@ -339,6 +339,10 @@ AC_ARG_ENABLE([internal-libjaylink],
|
||||
[Disable building internal libjaylink]),
|
||||
[use_internal_libjaylink=$enableval], [use_internal_libjaylink=yes])
|
||||
|
||||
AC_ARG_ENABLE([target64],
|
||||
AS_HELP_STRING([--disable-target64], [Disable 64-bit target address]),
|
||||
[build_target64=$enableval], [build_target64=yes])
|
||||
|
||||
build_minidriver=no
|
||||
AC_MSG_CHECKING([whether to enable ZY1000 minidriver])
|
||||
AS_IF([test "x$build_zy1000" = "xyes"], [
|
||||
@@ -572,6 +576,13 @@ AS_IF([test "x$build_sysfsgpio" = "xyes"], [
|
||||
AC_DEFINE([BUILD_SYSFSGPIO], [0], [0 if you don't want SysfsGPIO driver.])
|
||||
])
|
||||
|
||||
AS_IF([test "x$build_target64" = "xyes"], [
|
||||
AC_DEFINE([BUILD_TARGET64], [1], [1 if you want 64-bit addresses.])
|
||||
], [
|
||||
AC_DEFINE([BUILD_TARGET64], [0], [0 if you don't want 64-bit addresses.])
|
||||
])
|
||||
|
||||
|
||||
PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0], [
|
||||
use_libusb1=yes
|
||||
AC_DEFINE([HAVE_LIBUSB1], [1], [Define if you have libusb-1.x])
|
||||
@@ -689,6 +700,7 @@ AM_CONDITIONAL([BITQ], [test "x$build_bitq" = "xyes"])
|
||||
AM_CONDITIONAL([USE_LIBFTDI], [test "x$use_libftdi" = "xyes"])
|
||||
AM_CONDITIONAL([USE_HIDAPI], [test "x$use_hidapi" = "xyes"])
|
||||
AM_CONDITIONAL([USE_LIBJAYLINK], [test "x$use_libjaylink" = "xyes"])
|
||||
AM_CONDITIONAL([TARGET64], [test "x$build_target64" = "xyes"])
|
||||
|
||||
AM_CONDITIONAL([MINIDRIVER], [test "x$build_minidriver" = "xyes"])
|
||||
AM_CONDITIONAL([MINIDRIVER_DUMMY], [test "x$build_minidriver_dummy" = "xyes"])
|
||||
|
||||
@@ -1312,7 +1312,7 @@ static int cfi_intel_write_block(struct flash_bank *bank, const uint8_t *buffer,
|
||||
busy_pattern_val = cfi_command_val(bank, 0x80);
|
||||
error_pattern_val = cfi_command_val(bank, 0x7e);
|
||||
|
||||
LOG_DEBUG("Using target buffer at 0x%08" PRIx32 " and of size 0x%04" PRIx32,
|
||||
LOG_DEBUG("Using target buffer at " TARGET_ADDR_FMT " and of size 0x%04" PRIx32,
|
||||
source->address, buffer_size);
|
||||
|
||||
/* Programming main loop */
|
||||
|
||||
@@ -272,7 +272,7 @@ static int fm4_flash_write(struct flash_bank *bank, const uint8_t *buffer,
|
||||
uint32_t halfwords = MIN(halfword_count, data_workarea->size / 2);
|
||||
uint32_t addr = bank->base + offset;
|
||||
|
||||
LOG_DEBUG("copying %" PRId32 " bytes to SRAM 0x%08" PRIx32,
|
||||
LOG_DEBUG("copying %" PRId32 " bytes to SRAM 0x%08" TARGET_PRIxADDR,
|
||||
MIN(halfwords * 2, byte_count), data_workarea->address);
|
||||
|
||||
retval = target_write_buffer(target, data_workarea->address,
|
||||
|
||||
@@ -688,7 +688,7 @@ static int lpc2000_iap_working_area_init(struct flash_bank *bank, struct working
|
||||
|
||||
int retval = target_write_memory(target, (*iap_working_area)->address, 4, 2, jump_gate);
|
||||
if (retval != ERROR_OK) {
|
||||
LOG_ERROR("Write memory at address 0x%8.8" PRIx32 " failed (check work_area definition)",
|
||||
LOG_ERROR("Write memory at address 0x%8.8" TARGET_PRIxADDR " failed (check work_area definition)",
|
||||
(*iap_working_area)->address);
|
||||
target_free_working_area(target, *iap_working_area);
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ static int lpcspifi_set_hw_mode(struct flash_bank *bank)
|
||||
return retval;
|
||||
}
|
||||
|
||||
LOG_DEBUG("Writing algorithm to working area at 0x%08" PRIx32,
|
||||
LOG_DEBUG("Writing algorithm to working area at 0x%08" TARGET_PRIxADDR,
|
||||
spifi_init_algorithm->address);
|
||||
/* Write algorithm to working area */
|
||||
retval = target_write_buffer(target,
|
||||
|
||||
@@ -305,7 +305,7 @@ static int xmc1xxx_write(struct flash_bank *bank, const uint8_t *buffer,
|
||||
uint32_t blocks = MIN(block_count, data_workarea->size / NVM_BLOCK_SIZE);
|
||||
uint32_t addr = bank->base + offset;
|
||||
|
||||
LOG_DEBUG("copying %" PRId32 " bytes to SRAM 0x%08" PRIx32,
|
||||
LOG_DEBUG("copying %" PRId32 " bytes to SRAM 0x%08" TARGET_PRIxADDR,
|
||||
MIN(blocks * NVM_BLOCK_SIZE, byte_count),
|
||||
data_workarea->address);
|
||||
|
||||
|
||||
@@ -1410,6 +1410,8 @@ DEFINE_PARSE_ULONGLONG(_u32, uint32_t, 0, UINT32_MAX)
|
||||
DEFINE_PARSE_ULONGLONG(_u16, uint16_t, 0, UINT16_MAX)
|
||||
DEFINE_PARSE_ULONGLONG(_u8, uint8_t, 0, UINT8_MAX)
|
||||
|
||||
DEFINE_PARSE_ULONGLONG(_target_addr, target_addr_t, 0, TARGET_ADDR_MAX)
|
||||
|
||||
#define DEFINE_PARSE_LONGLONG(name, type, min, max) \
|
||||
DEFINE_PARSE_WRAPPER(name, type, min, max, long long, _llong)
|
||||
DEFINE_PARSE_LONGLONG(_int, int, n < INT_MIN, INT_MAX)
|
||||
|
||||
@@ -357,10 +357,13 @@ DECLARE_PARSE_WRAPPER(_u16, uint16_t);
|
||||
DECLARE_PARSE_WRAPPER(_u8, uint8_t);
|
||||
|
||||
DECLARE_PARSE_WRAPPER(_int, int);
|
||||
DECLARE_PARSE_WRAPPER(_s64, int64_t);
|
||||
DECLARE_PARSE_WRAPPER(_s32, int32_t);
|
||||
DECLARE_PARSE_WRAPPER(_s16, int16_t);
|
||||
DECLARE_PARSE_WRAPPER(_s8, int8_t);
|
||||
|
||||
DECLARE_PARSE_WRAPPER(_target_addr, target_addr_t);
|
||||
|
||||
/**
|
||||
* @brief parses the string @a in into @a out as a @a type, or prints
|
||||
* a command error and passes the error code to the caller. If an error
|
||||
@@ -382,6 +385,9 @@ DECLARE_PARSE_WRAPPER(_s8, int8_t);
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define COMMAND_PARSE_ADDRESS(in, out) \
|
||||
COMMAND_PARSE_NUMBER(target_addr, in, out)
|
||||
|
||||
/**
|
||||
* Parse the string @c as a binary parameter, storing the boolean value
|
||||
* in @c out. The strings @c on and @c off are used to match different
|
||||
|
||||
@@ -296,14 +296,21 @@ static inline int parity_u32(uint32_t x)
|
||||
*/
|
||||
|
||||
#if !defined(_STDINT_H)
|
||||
#define PRIx32 "x"
|
||||
#define PRId32 "d"
|
||||
#define SCNx32 "x"
|
||||
#define PRIi32 "i"
|
||||
#define PRIo32 "o"
|
||||
#define PRIu32 "u"
|
||||
#define PRIx32 "x"
|
||||
#define PRIX32 "X"
|
||||
#define SCNx32 "x"
|
||||
#define PRId8 PRId32
|
||||
#define SCNx64 "llx"
|
||||
#define PRId64 "lld"
|
||||
#define PRIi64 "lli"
|
||||
#define PRIo64 "llo"
|
||||
#define PRIu64 "llu"
|
||||
#define PRIx64 "llx"
|
||||
#define PRIX64 "llX"
|
||||
|
||||
typedef CYG_ADDRWORD intptr_t;
|
||||
typedef int64_t intmax_t;
|
||||
@@ -337,4 +344,23 @@ typedef uint64_t uintmax_t;
|
||||
|
||||
#endif
|
||||
|
||||
#if BUILD_TARGET64
|
||||
typedef uint64_t target_addr_t;
|
||||
#define TARGET_ADDR_MAX UINT64_MAX
|
||||
#define TARGET_PRIdADDR PRId64
|
||||
#define TARGET_PRIuADDR PRIu64
|
||||
#define TARGET_PRIoADDR PRIo64
|
||||
#define TARGET_PRIxADDR PRIx64
|
||||
#define TARGET_PRIXADDR PRIX64
|
||||
#else
|
||||
typedef uint32_t target_addr_t;
|
||||
#define TARGET_ADDR_MAX UINT32_MAX
|
||||
#define TARGET_PRIdADDR PRId32
|
||||
#define TARGET_PRIuADDR PRIu32
|
||||
#define TARGET_PRIoADDR PRIo32
|
||||
#define TARGET_PRIxADDR PRIx32
|
||||
#define TARGET_PRIXADDR PRIX32
|
||||
#endif
|
||||
#define TARGET_ADDR_FMT "0x%8.8" TARGET_PRIxADDR
|
||||
|
||||
#endif /* OPENOCD_HELPER_TYPES_H */
|
||||
|
||||
@@ -786,8 +786,8 @@ static int aice_pipe_memory_mode(uint32_t coreid, enum nds_memory_select mem_sel
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
static int aice_pipe_read_tlb(uint32_t coreid, uint32_t virtual_address,
|
||||
uint32_t *physical_address)
|
||||
static int aice_pipe_read_tlb(uint32_t coreid, target_addr_t virtual_address,
|
||||
target_addr_t *physical_address)
|
||||
{
|
||||
char line[AICE_PIPE_MAXLINE];
|
||||
char command[AICE_PIPE_MAXLINE];
|
||||
|
||||
@@ -180,7 +180,7 @@ struct aice_port_api_s {
|
||||
int (*memory_mode)(uint32_t coreid, enum nds_memory_select mem_select);
|
||||
|
||||
/** */
|
||||
int (*read_tlb)(uint32_t coreid, uint32_t virtual_address, uint32_t *physical_address);
|
||||
int (*read_tlb)(uint32_t coreid, target_addr_t virtual_address, target_addr_t *physical_address);
|
||||
|
||||
/** */
|
||||
int (*cache_ctl)(uint32_t coreid, uint32_t subtype, uint32_t address);
|
||||
|
||||
@@ -3424,10 +3424,10 @@ static int aice_usb_memory_mode(uint32_t coreid, enum nds_memory_select mem_sele
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int aice_usb_read_tlb(uint32_t coreid, uint32_t virtual_address,
|
||||
uint32_t *physical_address)
|
||||
static int aice_usb_read_tlb(uint32_t coreid, target_addr_t virtual_address,
|
||||
target_addr_t *physical_address)
|
||||
{
|
||||
LOG_DEBUG("aice_usb_read_tlb, virtual address: 0x%08" PRIx32, virtual_address);
|
||||
LOG_DEBUG("aice_usb_read_tlb, virtual address: 0x%08" TARGET_PRIxADDR, virtual_address);
|
||||
|
||||
uint32_t instructions[4];
|
||||
uint32_t probe_result;
|
||||
|
||||
@@ -105,11 +105,11 @@ static int linux_os_dummy_update(struct rtos *rtos)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int linux_compute_virt2phys(struct target *target, uint32_t address)
|
||||
static int linux_compute_virt2phys(struct target *target, target_addr_t address)
|
||||
{
|
||||
struct linux_os *linux_os = (struct linux_os *)
|
||||
target->rtos->rtos_specific_params;
|
||||
uint32_t pa = 0;
|
||||
target_addr_t pa = 0;
|
||||
int retval = target->type->virt2phys(target, address, &pa);
|
||||
if (retval != ERROR_OK) {
|
||||
LOG_ERROR("Cannot compute linux virt2phys translation");
|
||||
|
||||
@@ -735,22 +735,22 @@ static void gdb_signal_reply(struct target *target, struct connection *connectio
|
||||
stop_reason[0] = '\0';
|
||||
if (target->debug_reason == DBG_REASON_WATCHPOINT) {
|
||||
enum watchpoint_rw hit_wp_type;
|
||||
uint32_t hit_wp_address;
|
||||
target_addr_t hit_wp_address;
|
||||
|
||||
if (watchpoint_hit(target, &hit_wp_type, &hit_wp_address) == ERROR_OK) {
|
||||
|
||||
switch (hit_wp_type) {
|
||||
case WPT_WRITE:
|
||||
snprintf(stop_reason, sizeof(stop_reason),
|
||||
"watch:%08" PRIx32 ";", hit_wp_address);
|
||||
"watch:%08" TARGET_PRIxADDR ";", hit_wp_address);
|
||||
break;
|
||||
case WPT_READ:
|
||||
snprintf(stop_reason, sizeof(stop_reason),
|
||||
"rwatch:%08" PRIx32 ";", hit_wp_address);
|
||||
"rwatch:%08" TARGET_PRIxADDR ";", hit_wp_address);
|
||||
break;
|
||||
case WPT_ACCESS:
|
||||
snprintf(stop_reason, sizeof(stop_reason),
|
||||
"awatch:%08" PRIx32 ";", hit_wp_address);
|
||||
"awatch:%08" TARGET_PRIxADDR ";", hit_wp_address);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -26,7 +26,7 @@ enum param_direction {
|
||||
};
|
||||
|
||||
struct mem_param {
|
||||
uint32_t address;
|
||||
target_addr_t address;
|
||||
uint32_t size;
|
||||
uint8_t *value;
|
||||
enum param_direction direction;
|
||||
|
||||
@@ -231,7 +231,7 @@ int arm_init_arch_info(struct target *target, struct arm *arm);
|
||||
int armv4_5_run_algorithm(struct target *target,
|
||||
int num_mem_params, struct mem_param *mem_params,
|
||||
int num_reg_params, struct reg_param *reg_params,
|
||||
uint32_t entry_point, uint32_t exit_point,
|
||||
target_addr_t entry_point, target_addr_t exit_point,
|
||||
int timeout_ms, void *arch_info);
|
||||
int armv4_5_run_algorithm_inner(struct target *target,
|
||||
int num_mem_params, struct mem_param *mem_params,
|
||||
@@ -242,9 +242,9 @@ int armv4_5_run_algorithm_inner(struct target *target,
|
||||
int timeout_ms, void *arch_info));
|
||||
|
||||
int arm_checksum_memory(struct target *target,
|
||||
uint32_t address, uint32_t count, uint32_t *checksum);
|
||||
target_addr_t address, uint32_t count, uint32_t *checksum);
|
||||
int arm_blank_check_memory(struct target *target,
|
||||
uint32_t address, uint32_t count, uint32_t *blank, uint8_t erased_value);
|
||||
target_addr_t address, uint32_t count, uint32_t *blank, uint8_t erased_value);
|
||||
|
||||
void arm_set_cpsr(struct arm *arm, uint32_t cpsr);
|
||||
struct reg *arm_reg_current(struct arm *arm, unsigned regnum);
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
|
||||
static int arm11_step(struct target *target, int current,
|
||||
uint32_t address, int handle_breakpoints);
|
||||
target_addr_t address, int handle_breakpoints);
|
||||
|
||||
|
||||
/** Check and if necessary take control of the system
|
||||
@@ -449,7 +449,7 @@ static uint32_t arm11_nextpc(struct arm11_common *arm11, int current, uint32_t a
|
||||
}
|
||||
|
||||
static int arm11_resume(struct target *target, int current,
|
||||
uint32_t address, int handle_breakpoints, int debug_execution)
|
||||
target_addr_t address, int handle_breakpoints, int debug_execution)
|
||||
{
|
||||
/* LOG_DEBUG("current %d address %08x handle_breakpoints %d debug_execution %d", */
|
||||
/* current, address, handle_breakpoints, debug_execution); */
|
||||
@@ -467,7 +467,7 @@ static int arm11_resume(struct target *target, int current,
|
||||
|
||||
address = arm11_nextpc(arm11, current, address);
|
||||
|
||||
LOG_DEBUG("RESUME PC %08" PRIx32 "%s", address, !current ? "!" : "");
|
||||
LOG_DEBUG("RESUME PC %08" TARGET_PRIxADDR "%s", address, !current ? "!" : "");
|
||||
|
||||
/* clear breakpoints/watchpoints and VCR*/
|
||||
CHECK_RETVAL(arm11_sc7_clear_vbw(arm11));
|
||||
@@ -481,7 +481,7 @@ static int arm11_resume(struct target *target, int current,
|
||||
|
||||
for (bp = target->breakpoints; bp; bp = bp->next) {
|
||||
if (bp->address == address) {
|
||||
LOG_DEBUG("must step over %08" PRIx32 "", bp->address);
|
||||
LOG_DEBUG("must step over %08" TARGET_PRIxADDR "", bp->address);
|
||||
arm11_step(target, 1, 0, 0);
|
||||
break;
|
||||
}
|
||||
@@ -507,7 +507,7 @@ static int arm11_resume(struct target *target, int current,
|
||||
|
||||
CHECK_RETVAL(arm11_sc7_run(arm11, brp, ARRAY_SIZE(brp)));
|
||||
|
||||
LOG_DEBUG("Add BP %d at %08" PRIx32, brp_num,
|
||||
LOG_DEBUG("Add BP %d at %08" TARGET_PRIxADDR, brp_num,
|
||||
bp->address);
|
||||
|
||||
brp_num++;
|
||||
@@ -557,7 +557,7 @@ static int arm11_resume(struct target *target, int current,
|
||||
}
|
||||
|
||||
static int arm11_step(struct target *target, int current,
|
||||
uint32_t address, int handle_breakpoints)
|
||||
target_addr_t address, int handle_breakpoints)
|
||||
{
|
||||
LOG_DEBUG("target->state: %s",
|
||||
target_state_name(target));
|
||||
@@ -571,7 +571,7 @@ static int arm11_step(struct target *target, int current,
|
||||
|
||||
address = arm11_nextpc(arm11, current, address);
|
||||
|
||||
LOG_DEBUG("STEP PC %08" PRIx32 "%s", address, !current ? "!" : "");
|
||||
LOG_DEBUG("STEP PC %08" TARGET_PRIxADDR "%s", address, !current ? "!" : "");
|
||||
|
||||
|
||||
/** \todo TODO: Thumb not supported here */
|
||||
@@ -583,13 +583,13 @@ static int arm11_step(struct target *target, int current,
|
||||
/* skip over BKPT */
|
||||
if ((next_instruction & 0xFFF00070) == 0xe1200070) {
|
||||
address = arm11_nextpc(arm11, 0, address + 4);
|
||||
LOG_DEBUG("Skipping BKPT %08" PRIx32, address);
|
||||
LOG_DEBUG("Skipping BKPT %08" TARGET_PRIxADDR, address);
|
||||
}
|
||||
/* skip over Wait for interrupt / Standby
|
||||
* mcr 15, 0, r?, cr7, cr0, {4} */
|
||||
else if ((next_instruction & 0xFFFF0FFF) == 0xee070f90) {
|
||||
address = arm11_nextpc(arm11, 0, address + 4);
|
||||
LOG_DEBUG("Skipping WFI %08" PRIx32, address);
|
||||
LOG_DEBUG("Skipping WFI %08" TARGET_PRIxADDR, address);
|
||||
}
|
||||
/* ignore B to self */
|
||||
else if ((next_instruction & 0xFEFFFFFF) == 0xeafffffe)
|
||||
@@ -887,7 +887,7 @@ static int arm11_read_memory_inner(struct target *target,
|
||||
}
|
||||
|
||||
static int arm11_read_memory(struct target *target,
|
||||
uint32_t address,
|
||||
target_addr_t address,
|
||||
uint32_t size,
|
||||
uint32_t count,
|
||||
uint8_t *buffer)
|
||||
@@ -1043,7 +1043,7 @@ static int arm11_write_memory_inner(struct target *target,
|
||||
}
|
||||
|
||||
static int arm11_write_memory(struct target *target,
|
||||
uint32_t address, uint32_t size,
|
||||
target_addr_t address, uint32_t size,
|
||||
uint32_t count, const uint8_t *buffer)
|
||||
{
|
||||
/* pointer increment matters only for multi-unit writes ...
|
||||
|
||||
@@ -271,7 +271,7 @@ static int arm720_mmu(struct target *target, int *enabled)
|
||||
}
|
||||
|
||||
static int arm720_virt2phys(struct target *target,
|
||||
uint32_t virtual, uint32_t *physical)
|
||||
target_addr_t virtual, target_addr_t *physical)
|
||||
{
|
||||
uint32_t cb;
|
||||
struct arm720t_common *arm720t = target_to_arm720(target);
|
||||
@@ -286,7 +286,7 @@ static int arm720_virt2phys(struct target *target,
|
||||
}
|
||||
|
||||
static int arm720t_read_memory(struct target *target,
|
||||
uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer)
|
||||
target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
|
||||
{
|
||||
int retval;
|
||||
struct arm720t_common *arm720t = target_to_arm720(target);
|
||||
@@ -309,7 +309,7 @@ static int arm720t_read_memory(struct target *target,
|
||||
}
|
||||
|
||||
static int arm720t_read_phys_memory(struct target *target,
|
||||
uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer)
|
||||
target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
|
||||
{
|
||||
struct arm720t_common *arm720t = target_to_arm720(target);
|
||||
|
||||
@@ -317,7 +317,7 @@ static int arm720t_read_phys_memory(struct target *target,
|
||||
}
|
||||
|
||||
static int arm720t_write_phys_memory(struct target *target,
|
||||
uint32_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
|
||||
target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
|
||||
{
|
||||
struct arm720t_common *arm720t = target_to_arm720(target);
|
||||
|
||||
|
||||
@@ -101,7 +101,8 @@ static void arm7_9_assign_wp(struct arm7_9_common *arm7_9, struct breakpoint *br
|
||||
arm7_9->wp_available--;
|
||||
} else
|
||||
LOG_ERROR("BUG: no hardware comparator available");
|
||||
LOG_DEBUG("BPID: %" PRId32 " (0x%08" PRIx32 ") using hw wp: %d",
|
||||
|
||||
LOG_DEBUG("BPID: %" PRId32 " (0x%08" TARGET_PRIxADDR ") using hw wp: %d",
|
||||
breakpoint->unique_id,
|
||||
breakpoint->address,
|
||||
breakpoint->set);
|
||||
@@ -187,7 +188,7 @@ static int arm7_9_set_breakpoint(struct target *target, struct breakpoint *break
|
||||
struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
|
||||
int retval = ERROR_OK;
|
||||
|
||||
LOG_DEBUG("BPID: %" PRId32 ", Address: 0x%08" PRIx32 ", Type: %d",
|
||||
LOG_DEBUG("BPID: %" PRId32 ", Address: 0x%08" TARGET_PRIxADDR ", Type: %d",
|
||||
breakpoint->unique_id,
|
||||
breakpoint->address,
|
||||
breakpoint->type);
|
||||
@@ -244,7 +245,7 @@ static int arm7_9_set_breakpoint(struct target *target, struct breakpoint *break
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
if (verify != arm7_9->arm_bkpt) {
|
||||
LOG_ERROR("Unable to set 32 bit software breakpoint at address %08" PRIx32
|
||||
LOG_ERROR("Unable to set 32 bit software breakpoint at address %08" TARGET_PRIxADDR
|
||||
" - check that memory is read/writable", breakpoint->address);
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -264,7 +265,7 @@ static int arm7_9_set_breakpoint(struct target *target, struct breakpoint *break
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
if (verify != arm7_9->thumb_bkpt) {
|
||||
LOG_ERROR("Unable to set thumb software breakpoint at address %08" PRIx32
|
||||
LOG_ERROR("Unable to set thumb software breakpoint at address %08" TARGET_PRIxADDR
|
||||
" - check that memory is read/writable", breakpoint->address);
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -299,7 +300,7 @@ static int arm7_9_unset_breakpoint(struct target *target, struct breakpoint *bre
|
||||
int retval = ERROR_OK;
|
||||
struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
|
||||
|
||||
LOG_DEBUG("BPID: %" PRId32 ", Address: 0x%08" PRIx32,
|
||||
LOG_DEBUG("BPID: %" PRId32 ", Address: 0x%08" TARGET_PRIxADDR,
|
||||
breakpoint->unique_id,
|
||||
breakpoint->address);
|
||||
|
||||
@@ -1692,7 +1693,7 @@ static void arm7_9_enable_breakpoints(struct target *target)
|
||||
|
||||
int arm7_9_resume(struct target *target,
|
||||
int current,
|
||||
uint32_t address,
|
||||
target_addr_t address,
|
||||
int handle_breakpoints,
|
||||
int debug_execution)
|
||||
{
|
||||
@@ -1724,7 +1725,7 @@ int arm7_9_resume(struct target *target,
|
||||
breakpoint = breakpoint_find(target,
|
||||
buf_get_u32(arm->pc->value, 0, 32));
|
||||
if (breakpoint != NULL) {
|
||||
LOG_DEBUG("unset breakpoint at 0x%8.8" PRIx32 " (id: %" PRId32,
|
||||
LOG_DEBUG("unset breakpoint at 0x%8.8" TARGET_PRIxADDR " (id: %" PRId32,
|
||||
breakpoint->address,
|
||||
breakpoint->unique_id);
|
||||
retval = arm7_9_unset_breakpoint(target, breakpoint);
|
||||
@@ -1783,7 +1784,7 @@ int arm7_9_resume(struct target *target,
|
||||
LOG_DEBUG("new PC after step: 0x%8.8" PRIx32,
|
||||
buf_get_u32(arm->pc->value, 0, 32));
|
||||
|
||||
LOG_DEBUG("set breakpoint at 0x%8.8" PRIx32 "", breakpoint->address);
|
||||
LOG_DEBUG("set breakpoint at 0x%8.8" TARGET_PRIxADDR "", breakpoint->address);
|
||||
retval = arm7_9_set_breakpoint(target, breakpoint);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
@@ -1894,7 +1895,7 @@ void arm7_9_disable_eice_step(struct target *target)
|
||||
embeddedice_store_reg(&arm7_9->eice_cache->reg_list[EICE_W1_CONTROL_VALUE]);
|
||||
}
|
||||
|
||||
int arm7_9_step(struct target *target, int current, uint32_t address, int handle_breakpoints)
|
||||
int arm7_9_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
|
||||
{
|
||||
struct arm7_9_common *arm7_9 = target_to_arm7_9(target);
|
||||
struct arm *arm = &arm7_9->arm;
|
||||
@@ -2094,7 +2095,7 @@ static int arm7_9_write_core_reg(struct target *target, struct reg *r,
|
||||
}
|
||||
|
||||
int arm7_9_read_memory(struct target *target,
|
||||
uint32_t address,
|
||||
target_addr_t address,
|
||||
uint32_t size,
|
||||
uint32_t count,
|
||||
uint8_t *buffer)
|
||||
@@ -2109,7 +2110,7 @@ int arm7_9_read_memory(struct target *target,
|
||||
int retval;
|
||||
int last_reg = 0;
|
||||
|
||||
LOG_DEBUG("address: 0x%8.8" PRIx32 ", size: 0x%8.8" PRIx32 ", count: 0x%8.8" PRIx32 "",
|
||||
LOG_DEBUG("address: 0x%8.8" TARGET_PRIxADDR ", size: 0x%8.8" PRIx32 ", count: 0x%8.8" PRIx32 "",
|
||||
address, size, count);
|
||||
|
||||
if (target->state != TARGET_HALTED) {
|
||||
@@ -2247,7 +2248,8 @@ int arm7_9_read_memory(struct target *target,
|
||||
|
||||
if (((cpsr & 0x1f) == ARM_MODE_ABT) && (arm->core_mode != ARM_MODE_ABT)) {
|
||||
LOG_WARNING(
|
||||
"memory read caused data abort (address: 0x%8.8" PRIx32 ", size: 0x%" PRIx32 ", count: 0x%" PRIx32 ")",
|
||||
"memory read caused data abort "
|
||||
"(address: 0x%8.8" TARGET_PRIxADDR ", size: 0x%" PRIx32 ", count: 0x%" PRIx32 ")",
|
||||
address,
|
||||
size,
|
||||
count);
|
||||
@@ -2263,7 +2265,7 @@ int arm7_9_read_memory(struct target *target,
|
||||
}
|
||||
|
||||
int arm7_9_write_memory(struct target *target,
|
||||
uint32_t address,
|
||||
target_addr_t address,
|
||||
uint32_t size,
|
||||
uint32_t count,
|
||||
const uint8_t *buffer)
|
||||
@@ -2460,7 +2462,8 @@ int arm7_9_write_memory(struct target *target,
|
||||
|
||||
if (((cpsr & 0x1f) == ARM_MODE_ABT) && (arm->core_mode != ARM_MODE_ABT)) {
|
||||
LOG_WARNING(
|
||||
"memory write caused data abort (address: 0x%8.8" PRIx32 ", size: 0x%" PRIx32 ", count: 0x%" PRIx32 ")",
|
||||
"memory write caused data abort "
|
||||
"(address: 0x%8.8" TARGET_PRIxADDR ", size: 0x%" PRIx32 ", count: 0x%" PRIx32 ")",
|
||||
address,
|
||||
size,
|
||||
count);
|
||||
@@ -2476,7 +2479,7 @@ int arm7_9_write_memory(struct target *target,
|
||||
}
|
||||
|
||||
int arm7_9_write_memory_opt(struct target *target,
|
||||
uint32_t address,
|
||||
target_addr_t address,
|
||||
uint32_t size,
|
||||
uint32_t count,
|
||||
const uint8_t *buffer)
|
||||
@@ -2576,7 +2579,7 @@ static const uint32_t dcc_code[] = {
|
||||
};
|
||||
|
||||
int arm7_9_bulk_write_memory(struct target *target,
|
||||
uint32_t address,
|
||||
target_addr_t address,
|
||||
uint32_t count,
|
||||
const uint8_t *buffer)
|
||||
{
|
||||
@@ -2632,7 +2635,7 @@ int arm7_9_bulk_write_memory(struct target *target,
|
||||
uint32_t endaddress = buf_get_u32(reg_params[0].value, 0, 32);
|
||||
if (endaddress != (address + count*4)) {
|
||||
LOG_ERROR(
|
||||
"DCC write failed, expected end address 0x%08" PRIx32 " got 0x%0" PRIx32 "",
|
||||
"DCC write failed, expected end address 0x%08" TARGET_PRIxADDR " got 0x%0" PRIx32 "",
|
||||
(address + count*4),
|
||||
endaddress);
|
||||
retval = ERROR_FAIL;
|
||||
|
||||
@@ -122,13 +122,13 @@ struct arm7_9_common {
|
||||
* Used as a fallback when bulk writes are unavailable, or for writing data needed to
|
||||
* do the bulk writes.
|
||||
*/
|
||||
int (*write_memory)(struct target *target, uint32_t address,
|
||||
int (*write_memory)(struct target *target, target_addr_t address,
|
||||
uint32_t size, uint32_t count, const uint8_t *buffer);
|
||||
/**
|
||||
* Write target memory in multiples of 4 bytes, optimized for
|
||||
* writing large quantities of data.
|
||||
*/
|
||||
int (*bulk_write_memory)(struct target *target, uint32_t address,
|
||||
int (*bulk_write_memory)(struct target *target, target_addr_t address,
|
||||
uint32_t count, const uint8_t *buffer);
|
||||
};
|
||||
|
||||
@@ -155,19 +155,19 @@ int arm7_9_early_halt(struct target *target);
|
||||
int arm7_9_soft_reset_halt(struct target *target);
|
||||
|
||||
int arm7_9_halt(struct target *target);
|
||||
int arm7_9_resume(struct target *target, int current, uint32_t address,
|
||||
int arm7_9_resume(struct target *target, int current, target_addr_t address,
|
||||
int handle_breakpoints, int debug_execution);
|
||||
int arm7_9_step(struct target *target, int current, uint32_t address,
|
||||
int arm7_9_step(struct target *target, int current, target_addr_t address,
|
||||
int handle_breakpoints);
|
||||
int arm7_9_read_memory(struct target *target, uint32_t address,
|
||||
int arm7_9_read_memory(struct target *target, target_addr_t address,
|
||||
uint32_t size, uint32_t count, uint8_t *buffer);
|
||||
int arm7_9_write_memory(struct target *target, uint32_t address,
|
||||
int arm7_9_write_memory(struct target *target, target_addr_t address,
|
||||
uint32_t size, uint32_t count, const uint8_t *buffer);
|
||||
int arm7_9_write_memory_opt(struct target *target, uint32_t address,
|
||||
int arm7_9_write_memory_opt(struct target *target, target_addr_t address,
|
||||
uint32_t size, uint32_t count, const uint8_t *buffer);
|
||||
int arm7_9_write_memory_no_opt(struct target *target, uint32_t address,
|
||||
uint32_t size, uint32_t count, const uint8_t *buffer);
|
||||
int arm7_9_bulk_write_memory(struct target *target, uint32_t address,
|
||||
int arm7_9_bulk_write_memory(struct target *target, target_addr_t address,
|
||||
uint32_t count, const uint8_t *buffer);
|
||||
|
||||
int arm7_9_run_algorithm(struct target *target, int num_mem_params,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user