summaryrefslogtreecommitdiff
path: root/firmware/export/thread.h
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-09-02 07:56:52 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-09-02 07:56:52 +0000
commit3686228f9d620b108ca272767a3b2fe4db5ec289 (patch)
tree12ffd0ebae7268fa13da8e913ba71591a7f32efa /firmware/export/thread.h
parentd386d31ce73da65f89e03e6f3fe93c081e776b83 (diff)
downloadrockbox-3686228f9d620b108ca272767a3b2fe4db5ec289.zip
rockbox-3686228f9d620b108ca272767a3b2fe4db5ec289.tar.gz
rockbox-3686228f9d620b108ca272767a3b2fe4db5ec289.tar.bz2
rockbox-3686228f9d620b108ca272767a3b2fe4db5ec289.tar.xz
Cleanup threads.c by moving declarations inside structs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10853 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/thread.h')
-rw-r--r--firmware/export/thread.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/firmware/export/thread.h b/firmware/export/thread.h
index a5034ae..16408e8 100644
--- a/firmware/export/thread.h
+++ b/firmware/export/thread.h
@@ -29,6 +29,56 @@
#define DEFAULT_STACK_SIZE 0x400 /* Bytes */
+/* Need to keep structures inside the header file because debug_menu
+ * needs them. */
+#ifdef CPU_COLDFIRE
+struct regs
+{
+ unsigned int macsr; /* EMAC status register */
+ unsigned int d[6]; /* d2-d7 */
+ unsigned int a[5]; /* a2-a6 */
+ void *sp; /* Stack pointer (a7) */
+ void *start; /* Thread start address, or NULL when started */
+};
+#elif CONFIG_CPU == SH7034
+struct regs
+{
+ unsigned int r[7]; /* Registers r8 thru r14 */
+ void *sp; /* Stack pointer (r15) */
+ void *pr; /* Procedure register */
+ void *start; /* Thread start address, or NULL when started */
+};
+#elif defined(CPU_ARM)
+struct regs
+{
+ unsigned int r[8]; /* Registers r4-r11 */
+ void *sp; /* Stack pointer (r13) */
+ unsigned int lr; /* r14 (lr) */
+ void *start; /* Thread start address, or NULL when started */
+};
+#elif CONFIG_CPU == TCC730
+struct regs
+{
+ void *sp; /* Stack pointer (a15) */
+ void *start; /* Thread start address */
+ int started; /* 0 when not started */
+};
+#endif
+
+struct thread_entry {
+ struct regs context;
+ const char *name;
+ void *stack;
+ int stack_size;
+};
+
+struct core_entry {
+ int num_threads;
+ volatile int num_sleepers;
+ int current_thread;
+ struct thread_entry threads[MAXTHREADS];
+};
+
int create_thread(void (*function)(void), void* stack, int stack_size,
const char *name);
int create_thread_on_core(unsigned int core, void (*function)(void), void* stack, int stack_size,