diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2006-09-02 07:56:52 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-09-02 07:56:52 +0000 |
commit | 3686228f9d620b108ca272767a3b2fe4db5ec289 (patch) | |
tree | 12ffd0ebae7268fa13da8e913ba71591a7f32efa /firmware/export | |
parent | d386d31ce73da65f89e03e6f3fe93c081e776b83 (diff) | |
download | rockbox-3686228f9d620b108ca272767a3b2fe4db5ec289.tar.gz rockbox-3686228f9d620b108ca272767a3b2fe4db5ec289.zip |
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')
-rw-r--r-- | firmware/export/thread.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/firmware/export/thread.h b/firmware/export/thread.h index a5034aedab..16408e816e 100644 --- a/firmware/export/thread.h +++ b/firmware/export/thread.h | |||
@@ -29,6 +29,56 @@ | |||
29 | 29 | ||
30 | #define DEFAULT_STACK_SIZE 0x400 /* Bytes */ | 30 | #define DEFAULT_STACK_SIZE 0x400 /* Bytes */ |
31 | 31 | ||
32 | /* Need to keep structures inside the header file because debug_menu | ||
33 | * needs them. */ | ||
34 | #ifdef CPU_COLDFIRE | ||
35 | struct regs | ||
36 | { | ||
37 | unsigned int macsr; /* EMAC status register */ | ||
38 | unsigned int d[6]; /* d2-d7 */ | ||
39 | unsigned int a[5]; /* a2-a6 */ | ||
40 | void *sp; /* Stack pointer (a7) */ | ||
41 | void *start; /* Thread start address, or NULL when started */ | ||
42 | }; | ||
43 | #elif CONFIG_CPU == SH7034 | ||
44 | struct regs | ||
45 | { | ||
46 | unsigned int r[7]; /* Registers r8 thru r14 */ | ||
47 | void *sp; /* Stack pointer (r15) */ | ||
48 | void *pr; /* Procedure register */ | ||
49 | void *start; /* Thread start address, or NULL when started */ | ||
50 | }; | ||
51 | #elif defined(CPU_ARM) | ||
52 | struct regs | ||
53 | { | ||
54 | unsigned int r[8]; /* Registers r4-r11 */ | ||
55 | void *sp; /* Stack pointer (r13) */ | ||
56 | unsigned int lr; /* r14 (lr) */ | ||
57 | void *start; /* Thread start address, or NULL when started */ | ||
58 | }; | ||
59 | #elif CONFIG_CPU == TCC730 | ||
60 | struct regs | ||
61 | { | ||
62 | void *sp; /* Stack pointer (a15) */ | ||
63 | void *start; /* Thread start address */ | ||
64 | int started; /* 0 when not started */ | ||
65 | }; | ||
66 | #endif | ||
67 | |||
68 | struct thread_entry { | ||
69 | struct regs context; | ||
70 | const char *name; | ||
71 | void *stack; | ||
72 | int stack_size; | ||
73 | }; | ||
74 | |||
75 | struct core_entry { | ||
76 | int num_threads; | ||
77 | volatile int num_sleepers; | ||
78 | int current_thread; | ||
79 | struct thread_entry threads[MAXTHREADS]; | ||
80 | }; | ||
81 | |||
32 | int create_thread(void (*function)(void), void* stack, int stack_size, | 82 | int create_thread(void (*function)(void), void* stack, int stack_size, |
33 | const char *name); | 83 | const char *name); |
34 | int create_thread_on_core(unsigned int core, void (*function)(void), void* stack, int stack_size, | 84 | int create_thread_on_core(unsigned int core, void (*function)(void), void* stack, int stack_size, |