summaryrefslogtreecommitdiff
path: root/firmware/export/kernel.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-10-27 16:30:24 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-10-27 16:30:24 +0000
commita9e69d935cb5c2e5ffca1bbc977252ce7661d343 (patch)
tree8ac65804b294cfe7cc55febe445f904a1b33cb0e /firmware/export/kernel.h
parente5d72ac5f767a66b11c7a46dfb4edd322f7a723d (diff)
downloadrockbox-a9e69d935cb5c2e5ffca1bbc977252ce7661d343.tar.gz
rockbox-a9e69d935cb5c2e5ffca1bbc977252ce7661d343.zip
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
Diffstat (limited to 'firmware/export/kernel.h')
-rw-r--r--firmware/export/kernel.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h
index 51eb635004..9438f6d308 100644
--- a/firmware/export/kernel.h
+++ b/firmware/export/kernel.h
@@ -207,6 +207,18 @@ int tick_add_task(void (*f)(void));
207int tick_remove_task(void (*f)(void)); 207int tick_remove_task(void (*f)(void));
208extern void tick_start(unsigned int interval_in_ms); 208extern void tick_start(unsigned int interval_in_ms);
209 209
210/* inline helper for implementing target interrupt handler */
211static inline void call_tick_tasks(void)
212{
213 extern void (*tick_funcs[MAX_NUM_TICK_TASKS+1])(void);
214 int i;
215
216 current_tick++;
217
218 for (i = 0; tick_funcs[i] != NULL; i++)
219 tick_funcs[i]();
220}
221
210struct timeout; 222struct timeout;
211 223
212/* timeout callback type 224/* timeout callback type