1
0
Fork 0
forked from len0rd/rockbox

Strange little kernel optimization to ease targeting the timer tick and to limit the number of loops in the tick function to the number of tasks added rather than always looping the max number.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18893 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2008-10-27 16:30:24 +00:00
parent e5d72ac5f7
commit a9e69d935c
8 changed files with 37 additions and 126 deletions

View file

@ -207,6 +207,18 @@ int tick_add_task(void (*f)(void));
int tick_remove_task(void (*f)(void));
extern void tick_start(unsigned int interval_in_ms);
/* inline helper for implementing target interrupt handler */
static inline void call_tick_tasks(void)
{
extern void (*tick_funcs[MAX_NUM_TICK_TASKS+1])(void);
int i;
current_tick++;
for (i = 0; tick_funcs[i] != NULL; i++)
tick_funcs[i]();
}
struct timeout;
/* timeout callback type