From 21687eb983a4d5e30cd9c4050b9ebce2f3b280c7 Mon Sep 17 00:00:00 2001 From: Marc Schink Date: Fri, 15 Feb 2019 14:36:54 +0100 Subject: [PATCH] Use enum for target_register_timer_callback() Change-Id: I268e8c5d783914aa97cbde301448b2c5bc3cb9e6 Signed-off-by: Marc Schink Reviewed-on: http://openocd.zylin.com/4921 Tested-by: jenkins Reviewed-by: Tomas Vanek --- src/target/aarch64.c | 3 ++- src/target/arm7_9_common.c | 2 +- src/target/armv7m_trace.c | 3 ++- src/target/cortex_a.c | 3 ++- src/target/cortex_m.c | 3 ++- src/target/hla_target.c | 3 ++- src/target/openrisc/jsp_server.c | 3 ++- src/target/target.c | 2 +- 8 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/target/aarch64.c b/src/target/aarch64.c index 2357eb217..c9cedea82 100644 --- a/src/target/aarch64.c +++ b/src/target/aarch64.c @@ -2388,7 +2388,8 @@ static int aarch64_init_arch_info(struct target *target, armv8->armv8_mmu.read_physical_memory = aarch64_read_phys_memory; armv8_init_arch_info(target, armv8); - target_register_timer_callback(aarch64_handle_target_request, 1, 1, target); + target_register_timer_callback(aarch64_handle_target_request, 1, + TARGET_TIMER_TYPE_PERIODIC, target); return ERROR_OK; } diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 7fd1ed9f8..96e31b9d3 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -2859,7 +2859,7 @@ int arm7_9_init_arch_info(struct target *target, struct arm7_9_common *arm7_9) return retval; return target_register_timer_callback(arm7_9_handle_target_request, - 1, 1, target); + 1, TARGET_TIMER_TYPE_PERIODIC, target); } static const struct command_registration arm7_9_any_command_handlers[] = { diff --git a/src/target/armv7m_trace.c b/src/target/armv7m_trace.c index 62f0f8e61..6170119d9 100644 --- a/src/target/armv7m_trace.c +++ b/src/target/armv7m_trace.c @@ -116,7 +116,8 @@ int armv7m_trace_tpiu_config(struct target *target) return retval; if (trace_config->config_type == TRACE_CONFIG_TYPE_INTERNAL) - target_register_timer_callback(armv7m_poll_trace, 1, 1, target); + target_register_timer_callback(armv7m_poll_trace, 1, + TARGET_TIMER_TYPE_PERIODIC, target); target_call_event_callbacks(target, TARGET_EVENT_TRACE_CONFIG); diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c index 9203fb9ec..5d5fb9621 100644 --- a/src/target/cortex_a.c +++ b/src/target/cortex_a.c @@ -2833,7 +2833,8 @@ static int cortex_a_init_arch_info(struct target *target, /* REVISIT v7a setup should be in a v7a-specific routine */ armv7a_init_arch_info(target, armv7a); - target_register_timer_callback(cortex_a_handle_target_request, 1, 1, target); + target_register_timer_callback(cortex_a_handle_target_request, 1, + TARGET_TIMER_TYPE_PERIODIC, target); return ERROR_OK; } diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 62d376098..d751fd854 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -2269,7 +2269,8 @@ static int cortex_m_init_arch_info(struct target *target, armv7m->load_core_reg_u32 = cortex_m_load_core_reg_u32; armv7m->store_core_reg_u32 = cortex_m_store_core_reg_u32; - target_register_timer_callback(cortex_m_handle_target_request, 1, 1, target); + target_register_timer_callback(cortex_m_handle_target_request, 1, + TARGET_TIMER_TYPE_PERIODIC, target); return ERROR_OK; } diff --git a/src/target/hla_target.c b/src/target/hla_target.c index 4f97eb95c..60ed7d64d 100644 --- a/src/target/hla_target.c +++ b/src/target/hla_target.c @@ -346,7 +346,8 @@ static int adapter_init_arch_info(struct target *target, armv7m->examine_debug_reason = adapter_examine_debug_reason; armv7m->stlink = true; - target_register_timer_callback(hl_handle_target_request, 1, 1, target); + target_register_timer_callback(hl_handle_target_request, 1, + TARGET_TIMER_TYPE_PERIODIC, target); return ERROR_OK; } diff --git a/src/target/openrisc/jsp_server.c b/src/target/openrisc/jsp_server.c index 6cd53f43c..6fb764a6c 100644 --- a/src/target/openrisc/jsp_server.c +++ b/src/target/openrisc/jsp_server.c @@ -101,7 +101,8 @@ static int jsp_new_connection(struct connection *connection) jsp_service->connection = connection; - int retval = target_register_timer_callback(&jsp_poll_read, 1, 1, jsp_service); + int retval = target_register_timer_callback(&jsp_poll_read, 1, + TARGET_TIMER_TYPE_PERIODIC, jsp_service); if (ERROR_OK != retval) return retval; diff --git a/src/target/target.c b/src/target/target.c index a3230d248..9955a5655 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -1357,7 +1357,7 @@ static int target_init(struct command_context *cmd_ctx) return retval; retval = target_register_timer_callback(&handle_target, - polling_interval, 1, cmd_ctx->interp); + polling_interval, TARGET_TIMER_TYPE_PERIODIC, cmd_ctx->interp); if (ERROR_OK != retval) return retval;