- 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
__archive__
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 */
LOG_USER_N("%s", "");
/* also process TCL events (we have to do this from 'log.c' since its
* keep_alive() is the only routine guaranteed to be called at least
* once per second :( */
process_jim_events ();
/* process any timer events now */
target_call_timer_callbacks_now();
/* DANGER!!!! do not add code to invoke e.g. target event processing,
* jim timer processing, etc. it can cause infinite recursion +
* jim event callbacks need to happen at a well defined time,
* not anywhere keep_alive() is invoked.
*
* These functions should be invoked at a well defined spot in server.c
*/
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;
struct timeval now;
keep_alive();
gettimeofday(&now, NULL);
while (callback)
@ -856,7 +858,7 @@ int target_call_timer_callbacks(void)
/* invoke periodic callbacks immediately */
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)