- Fixed regression introduced in 890 when "fixing warnings" for target_call_timer_callbacks_now().

target_call_timer_callbacks_now() did the same as target_call_timer_callbacks().

- Reduced keep_alive()'s job to only deal with GDB keep  alive problems.

git-svn-id: svn://svn.berlios.de/openocd/trunk@985 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
oharboe 2008-09-12 07:09:38 +00:00
parent 0ae7f962f8
commit 9b6853bc4c
2 changed files with 36 additions and 34 deletions

View File

@ -374,13 +374,13 @@ void keep_alive()
/* this will keep the GDB connection alive */ /* this will keep the GDB connection alive */
LOG_USER_N("%s", ""); LOG_USER_N("%s", "");
/* also process TCL events (we have to do this from 'log.c' since its /* DANGER!!!! do not add code to invoke e.g. target event processing,
* keep_alive() is the only routine guaranteed to be called at least * jim timer processing, etc. it can cause infinite recursion +
* once per second :( */ * jim event callbacks need to happen at a well defined time,
process_jim_events (); * not anywhere keep_alive() is invoked.
*
/* process any timer events now */ * These functions should be invoked at a well defined spot in server.c
target_call_timer_callbacks_now(); */
last_time=current_time; last_time=current_time;
} }

View File

@ -812,6 +812,8 @@ static int target_call_timer_callbacks_check_time(int checktime)
target_timer_callback_t *next_callback; target_timer_callback_t *next_callback;
struct timeval now; struct timeval now;
keep_alive();
gettimeofday(&now, NULL); gettimeofday(&now, NULL);
while (callback) while (callback)
@ -856,7 +858,7 @@ int target_call_timer_callbacks(void)
/* invoke periodic callbacks immediately */ /* invoke periodic callbacks immediately */
int target_call_timer_callbacks_now(void) int target_call_timer_callbacks_now(void)
{ {
return target_call_timer_callbacks(); return target_call_timer_callbacks_check_time(0);
} }
int target_alloc_working_area(struct target_s *target, u32 size, working_area_t **area) int target_alloc_working_area(struct target_s *target, u32 size, working_area_t **area)