From 27cf67733936abd75fcb1f8da765977cd75906ee Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Tue, 25 Mar 2008 02:34:12 +0000 Subject: Add a complete priority inheritance implementation to the scheduler (all mutex ownership and queue_send calls are inheritable). Priorities are differential so that dispatch depends on the runnable range of priorities. Codec priority can therefore be raised in small steps (pcmbuf updated to enable). Simplify the kernel functions to ease implementation and use the same kernel.c for both sim and target (I'm tired of maintaining two ;_). 1) Not sure if a minor audio break at first buffering issue will exist on large-sector disks (the main mutex speed issue was genuinely resolved earlier). At this point it's best dealt with at the buffering level. It seems a larger filechunk could be used again. 2) Perhaps 64-bit sims will have some minor issues (finicky) but a backroll of the code of concern there is a 5-minute job. All kernel objects become incompatible so a full rebuild and update is needed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16791 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/sdl/uisdl.c | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'uisimulator/sdl/uisdl.c') diff --git a/uisimulator/sdl/uisdl.c b/uisimulator/sdl/uisdl.c index e0a449ed48..09210926b5 100644 --- a/uisimulator/sdl/uisdl.c +++ b/uisimulator/sdl/uisdl.c @@ -40,19 +40,13 @@ #include "SDL_thread.h" /* extern functions */ -extern void app_main (void *); /* mod entry point */ -extern void new_key(int key); -extern void sim_tick_tasks(void); -extern bool sim_io_init(void); -extern void sim_io_shutdown(void); +extern void new_key(int key); void button_event(int key, bool pressed); SDL_Surface *gui_surface; bool background = false; /* Don't use backgrounds by default */ -SDL_TimerID tick_timer_id; - bool lcd_display_redraw = true; /* Used for player simulator */ char having_new_lcd = true; /* Used for player simulator */ bool sim_alarm_wakeup = false; @@ -63,31 +57,6 @@ bool debug_audio = false; bool debug_wps = false; int wps_verbose_level = 3; -long start_tick; - -Uint32 tick_timer(Uint32 interval, void *param) -{ - long new_tick; - - (void) interval; - (void) param; - - new_tick = (SDL_GetTicks() - start_tick) / (1000/HZ); - - if (new_tick != current_tick) { - long i; - for (i = new_tick - current_tick; i > 0; i--) - { - sim_enter_irq_handler(); - sim_tick_tasks(); - sim_exit_irq_handler(); - } - current_tick = new_tick; - } - - return 1; -} - void gui_message_loop(void) { SDL_Event event; @@ -181,8 +150,6 @@ bool gui_startup(void) SDL_UpdateRect(gui_surface, 0, 0, 0, 0); } - start_tick = SDL_GetTicks(); - return true; } @@ -191,7 +158,6 @@ bool gui_shutdown(void) /* Order here is relevent to prevent deadlocks and use of destroyed sync primitives by kernel threads */ thread_sdl_shutdown(); - SDL_RemoveTimer(tick_timer_id); sim_kernel_shutdown(); return true; } @@ -287,8 +253,6 @@ int main(int argc, char *argv[]) return -1; } - tick_timer_id = SDL_AddTimer(10, tick_timer, NULL); - gui_message_loop(); return gui_shutdown(); -- cgit v1.2.3