diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/asm/thread.c | 20 | ||||
-rw-r--r-- | firmware/asm/thread.h | 35 |
2 files changed, 26 insertions, 29 deletions
diff --git a/firmware/asm/thread.c b/firmware/asm/thread.c index 49e71d73af..d6b881bdc5 100644 --- a/firmware/asm/thread.c +++ b/firmware/asm/thread.c | |||
@@ -1,4 +1,11 @@ | |||
1 | #if defined(CPU_ARM) | 1 | /* First some generic implementations */ |
2 | #if defined(HAVE_WIN32_FIBER_THREADS) | ||
3 | #include "thread-win32.c" | ||
4 | #elif defined(HAVE_SIGALTSTACK_THREADS) | ||
5 | #include "thread-unix.c" | ||
6 | |||
7 | /* Now the CPU-specific implementations */ | ||
8 | #elif defined(CPU_ARM) | ||
2 | #include "arm/thread.c" | 9 | #include "arm/thread.c" |
3 | #elif defined(CPU_COLDFIRE) | 10 | #elif defined(CPU_COLDFIRE) |
4 | #include "m68k/thread.c" | 11 | #include "m68k/thread.c" |
@@ -7,15 +14,6 @@ | |||
7 | #elif defined(CPU_MIPS) | 14 | #elif defined(CPU_MIPS) |
8 | #include "mips/thread.c" | 15 | #include "mips/thread.c" |
9 | #else | 16 | #else |
10 | 17 | /* Nothing? OK, give up */ | |
11 | /* generic thread.c */ | ||
12 | |||
13 | #if defined(HAVE_WIN32_FIBER_THREADS) | ||
14 | #include "thread-win32.c" | ||
15 | #elif defined(HAVE_SIGALTSTACK_THREADS) | ||
16 | #include "thread-unix.c" | ||
17 | #else | ||
18 | #error Missing thread impl | 18 | #error Missing thread impl |
19 | #endif | 19 | #endif |
20 | |||
21 | #endif | ||
diff --git a/firmware/asm/thread.h b/firmware/asm/thread.h index 9bdff3881e..3fa8f5625d 100644 --- a/firmware/asm/thread.h +++ b/firmware/asm/thread.h | |||
@@ -23,18 +23,10 @@ | |||
23 | #define __ASM_THREAD_H__ | 23 | #define __ASM_THREAD_H__ |
24 | #include "config.h" | 24 | #include "config.h" |
25 | 25 | ||
26 | #if defined(CPU_ARM) | ||
27 | #include "arm/thread.h" | ||
28 | #elif defined(CPU_COLDFIRE) | ||
29 | #include "m68k/thread.h" | ||
30 | #elif CONFIG_CPU == SH7034 | ||
31 | #include "sh/thread.h" | ||
32 | #elif defined(CPU_MIPS) | ||
33 | #include "mips/thread.h" | ||
34 | #else | ||
35 | |||
36 | /* generic thread.h */ | 26 | /* generic thread.h */ |
37 | 27 | ||
28 | #if defined(HAVE_WIN32_FIBER_THREADS) || defined(HAVE_SIGALTSTACK_THREADS) | ||
29 | |||
38 | struct regs | 30 | struct regs |
39 | { | 31 | { |
40 | void (*start)(void); /* thread's entry point, or NULL when started */ | 32 | void (*start)(void); /* thread's entry point, or NULL when started */ |
@@ -44,14 +36,21 @@ struct regs | |||
44 | uintptr_t stack; /* pointer to start of the stack buffer */ | 36 | uintptr_t stack; /* pointer to start of the stack buffer */ |
45 | }; | 37 | }; |
46 | 38 | ||
47 | #ifdef HAVE_SIGALTSTACK_THREADS | 39 | #ifdef HAVE_SIGALTSTACK_THREADS |
48 | #include <signal.h> | 40 | #include <signal.h> |
49 | /* MINSIGSTKSZ for the OS to deliver the signal + 0x3000 for us */ | 41 | /* MINSIGSTKSZ for the OS to deliver the signal + 0x3000 for us */ |
50 | #define DEFAULT_STACK_SIZE (MINSIGSTKSZ+0x3000) /* Bytes */ | 42 | #define DEFAULT_STACK_SIZE (MINSIGSTKSZ+0x3000) /* Bytes */ |
51 | #elif defined(HAVE_WIN32_FIBER_THREADS) | 43 | #elif defined(HAVE_WIN32_FIBER_THREADS) |
52 | #define DEFAULT_STACK_SIZE 0x1000 /* Bytes */ | 44 | #define DEFAULT_STACK_SIZE 0x1000 /* Bytes */ |
45 | #endif | ||
46 | #elif defined(CPU_ARM) | ||
47 | #include "arm/thread.h" | ||
48 | #elif defined(CPU_COLDFIRE) | ||
49 | #include "m68k/thread.h" | ||
50 | #elif CONFIG_CPU == SH7034 | ||
51 | #include "sh/thread.h" | ||
52 | #elif defined(CPU_MIPS) | ||
53 | #include "mips/thread.h" | ||
53 | #endif | 54 | #endif |
54 | 55 | ||
55 | #endif /* __ASM_THREAD_H__ */ | ||
56 | |||
57 | #endif | 56 | #endif |