Move thread-sdl.[ch] into the target tree.
authorThomas Martitz <thomas.martitz@student.htw-berlin.de>
Fri, 14 May 2010 14:36:24 +0000 (14 16:36 +0200)
committerThomas Martitz <thomas.martitz@student.htw-berlin.de>
Fri, 14 May 2010 14:36:24 +0000 (14 16:36 +0200)
firmware/SOURCES
firmware/target/hosted/sdl/system-sdl.c
firmware/target/hosted/sdl/thread-sdl.c [moved from uisimulator/sdl/thread-sdl.c with 99% similarity]
firmware/target/hosted/sdl/thread-sdl.h [moved from uisimulator/sdl/thread-sdl.h with 69% similarity]
uisimulator/common/io.c
uisimulator/sdl/SOURCES
uisimulator/sdl/timefuncs.h [deleted file]
uisimulator/uisimulator.make

index 60a3661..b9611e0 100644 (file)
@@ -21,6 +21,7 @@ timer.c
 #ifdef HAVE_SDL
 target/hosted/sdl/kernel-sdl.c
 target/hosted/sdl/system-sdl.c
+target/hosted/sdl/thread-sdl.c
 target/hosted/sdl/timer-sdl.c
 #endif
 panic.c
index bc3e340..c4e5d85 100644 (file)
@@ -65,7 +65,7 @@ void sys_poweroff(void)
 {
     /* Order here is relevent to prevent deadlocks and use of destroyed
        sync primitives by kernel threads */
-    thread_sdl_shutdown();
+    sim_thread_shutdown();
     sim_kernel_shutdown();
     SDL_Quit();
 }
@@ -130,12 +130,12 @@ void system_init(void)
 
 void system_exception_wait(void)
 {
-    thread_sdl_exception_wait();
+    sim_thread_exception_wait();
 }
 
 void system_reboot(void)
 {
-    thread_sdl_exception_wait();
+    sim_thread_exception_wait();
 }
 
 void sys_handle_argv(int argc, char *argv[])
similarity index 99%
rename from uisimulator/sdl/thread-sdl.c
rename to firmware/target/hosted/sdl/thread-sdl.c
index 46c1e98..fbe2621 100644 (file)
@@ -64,7 +64,7 @@ static volatile bool threads_exit = false;
 
 extern long start_tick;
 
-void thread_sdl_shutdown(void)
+void sim_thread_shutdown(void)
 {
     int i;
 
@@ -177,7 +177,7 @@ void init_threads(void)
     return;
 }
 
-void thread_sdl_exception_wait(void)
+void sim_thread_exception_wait(void)
 {
     while (1)
     {
@@ -188,7 +188,7 @@ void thread_sdl_exception_wait(void)
 }
 
 /* A way to yield and leave the threading system for extended periods */
-void thread_sdl_thread_lock(void *me)
+void sim_thread_lock(void *me)
 {
     SDL_LockMutex(m);
     cores[CURRENT_CORE].running = (struct thread_entry *)me;
@@ -197,7 +197,7 @@ void thread_sdl_thread_lock(void *me)
         thread_exit();
 }
 
-void * thread_sdl_thread_unlock(void)
+void * sim_thread_unlock(void)
 {
     struct thread_entry *current = cores[CURRENT_CORE].running;
     SDL_UnlockMutex(m);
similarity index 69%
rename from uisimulator/sdl/thread-sdl.h
rename to firmware/target/hosted/sdl/thread-sdl.h
index f221aa5..9384e60 100644 (file)
 #ifndef __THREADSDL_H__
 #define __THREADSDL_H__
 
-#include "SDL_thread.h"
-
-extern SDL_Thread *gui_thread;   /* The "main" thread */
-void thread_sdl_thread_lock(void *me);
-void * thread_sdl_thread_unlock(void);
-void thread_sdl_exception_wait(void);
-bool thread_sdl_init(void *param); /* Init the sim threading API - thread created calls app_main */
-void thread_sdl_shutdown(void); /* Shut down all kernel threads gracefully */
-void thread_sdl_lock(void); /* Sync with SDL threads */
-void thread_sdl_unlock(void); /* Sync with SDL threads */
+/* extra thread functions that only apply when running on hosting platforms */
+void sim_thread_lock(void *me);
+void * sim_thread_unlock(void);
+void sim_thread_exception_wait(void);
+void sim_thread_shutdown(void); /* Shut down all kernel threads gracefully */
 
 #endif /* #ifndef __THREADSDL_H__ */
 
index cddb19c..bdcc7e6 100644 (file)
@@ -233,7 +233,7 @@ static ssize_t io_trigger_and_wait(int cmd)
     {
         /* Allow other rockbox threads to run */
         io.accum = 0;
-        mythread = thread_sdl_thread_unlock();
+        mythread = sim_thread_unlock();
     }
 
     switch (cmd)
@@ -249,7 +249,7 @@ static ssize_t io_trigger_and_wait(int cmd)
     /* Regain our status as current */
     if (mythread != NULL)
     {
-        thread_sdl_thread_lock(mythread);
+        sim_thread_lock(mythread);
     }
 
     return result;
index be9a7a4..19d9718 100644 (file)
@@ -8,4 +8,3 @@ lcd-charcells.c
 lcd-remote-bitmap.c
 #endif
 lcd-sdl.c
-thread-sdl.c
diff --git a/uisimulator/sdl/timefuncs.h b/uisimulator/sdl/timefuncs.h
deleted file mode 100644 (file)
index de17fcd..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <time.h>
-#include <stdbool.h>
-
-/* struct tm defined */
-struct tm *get_time(void);
-int set_time(const struct tm *tm);
-bool valid_time(const struct tm *tm);
index 121f31e..05b973f 100644 (file)
@@ -8,11 +8,9 @@
 #
 
 INCLUDES += -I$(ROOTDIR)/uisimulator/sdl -I$(ROOTDIR)/uisimulator/common \
+       -I$(FIRMDIR)/include -I$(FIRMDIR)/export $(TARGET_INC) -I$(BUILDDIR) -I$(APPSDIR)
 
-SIMINCLUDES += -I$(ROOTDIR)/uisimulator/sdl -I$(ROOTDIR)/uisimulator/common \
-       -I$(FIRMDIR)/export $(TARGET_INC) -I$(BUILDDIR) -I$(APPSDIR)
-
-SIMFLAGS += $(SIMINCLUDES) $(DEFINES) -DHAVE_CONFIG_H $(GCCOPTS)
+SIMFLAGS += $(INCLUDES) $(DEFINES) -DHAVE_CONFIG_H $(GCCOPTS)
 
 SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/sdl/SOURCES)
 SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/common/SOURCES)