target: Use 'bool' data type in target_{step,resume}

While at it, adapt data types of related functions and fix some coding
style issues.

Change-Id: I74db9258fc17b1ee8aa446f35ae722ea7c2f67e6
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8524
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
This commit is contained in:
Marc Schink
2024-10-10 17:07:20 +02:00
committed by Antonio Borneo
parent f63b41bbe4
commit 297844cf46
44 changed files with 303 additions and 285 deletions
+14 -11
View File
@@ -1591,10 +1591,10 @@ int xtensa_halt(struct target *target)
}
int xtensa_prepare_resume(struct target *target,
int current,
bool current,
target_addr_t address,
int handle_breakpoints,
int debug_execution)
bool handle_breakpoints,
bool debug_execution)
{
struct xtensa *xtensa = target_to_xtensa(target);
uint32_t bpena = 0;
@@ -1671,13 +1671,14 @@ int xtensa_do_resume(struct target *target)
}
int xtensa_resume(struct target *target,
int current,
bool current,
target_addr_t address,
int handle_breakpoints,
int debug_execution)
bool handle_breakpoints,
bool debug_execution)
{
LOG_TARGET_DEBUG(target, "start");
int res = xtensa_prepare_resume(target, current, address, handle_breakpoints, debug_execution);
int res = xtensa_prepare_resume(target, current, address,
handle_breakpoints, debug_execution);
if (res != ERROR_OK) {
LOG_TARGET_ERROR(target, "Failed to prepare for resume!");
return res;
@@ -1719,7 +1720,8 @@ static bool xtensa_pc_in_winexc(struct target *target, target_addr_t pc)
return false;
}
int xtensa_do_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
int xtensa_do_step(struct target *target, bool current, target_addr_t address,
bool handle_breakpoints)
{
struct xtensa *xtensa = target_to_xtensa(target);
int res;
@@ -1844,7 +1846,7 @@ int xtensa_do_step(struct target *target, int current, target_addr_t address, in
/* Now that ICOUNT (LX) or DCR.StepRequest (NX) is set,
* we can resume as if we were going to run
*/
res = xtensa_prepare_resume(target, current, address, 0, 0);
res = xtensa_prepare_resume(target, current, address, false, false);
if (res != ERROR_OK) {
LOG_TARGET_ERROR(target, "Failed to prepare resume for single step");
return res;
@@ -1941,7 +1943,8 @@ int xtensa_do_step(struct target *target, int current, target_addr_t address, in
return res;
}
int xtensa_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
int xtensa_step(struct target *target, bool current, target_addr_t address,
bool handle_breakpoints)
{
int retval = xtensa_do_step(target, current, address, handle_breakpoints);
if (retval != ERROR_OK)
@@ -2806,7 +2809,7 @@ int xtensa_start_algorithm(struct target *target,
}
}
return xtensa_resume(target, 0, entry_point, 1, 1);
return xtensa_resume(target, false, entry_point, true, true);
}
/** Waits for an algorithm in the target. */
+10 -8
View File
@@ -378,18 +378,20 @@ int xtensa_poll(struct target *target);
void xtensa_on_poll(struct target *target);
int xtensa_halt(struct target *target);
int xtensa_resume(struct target *target,
int current,
bool current,
target_addr_t address,
int handle_breakpoints,
int debug_execution);
bool handle_breakpoints,
bool debug_execution);
int xtensa_prepare_resume(struct target *target,
int current,
bool current,
target_addr_t address,
int handle_breakpoints,
int debug_execution);
bool handle_breakpoints,
bool debug_execution);
int xtensa_do_resume(struct target *target);
int xtensa_step(struct target *target, int current, target_addr_t address, int handle_breakpoints);
int xtensa_do_step(struct target *target, int current, target_addr_t address, int handle_breakpoints);
int xtensa_step(struct target *target, bool current, target_addr_t address,
bool handle_breakpoints);
int xtensa_do_step(struct target *target, bool current, target_addr_t address,
bool handle_breakpoints);
int xtensa_mmu_is_enabled(struct target *target, int *enabled);
int xtensa_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer);
int xtensa_read_buffer(struct target *target, target_addr_t address, uint32_t count, uint8_t *buffer);