diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/config.h | 17 | ||||
-rw-r--r-- | firmware/export/system.h | 14 | ||||
-rw-r--r-- | firmware/export/thread.h | 4 |
3 files changed, 29 insertions, 6 deletions
diff --git a/firmware/export/config.h b/firmware/export/config.h index 8f1a5e65cc..cd674b63f8 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -151,6 +151,10 @@ | |||
151 | #define USBOTG_ISP1362 1362 | 151 | #define USBOTG_ISP1362 1362 |
152 | #define USBOTG_M5636 5636 | 152 | #define USBOTG_M5636 5636 |
153 | 153 | ||
154 | /* Multiple cores */ | ||
155 | #define CPU 0 | ||
156 | #define COP 1 | ||
157 | |||
154 | /* now go and pick yours */ | 158 | /* now go and pick yours */ |
155 | #if defined(ARCHOS_PLAYER) | 159 | #if defined(ARCHOS_PLAYER) |
156 | #include "config-player.h" | 160 | #include "config-player.h" |
@@ -219,6 +223,19 @@ | |||
219 | /* define for all cpus from PP family */ | 223 | /* define for all cpus from PP family */ |
220 | #if (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5024) | 224 | #if (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5024) |
221 | #define CPU_PP | 225 | #define CPU_PP |
226 | |||
227 | /* PP family has dual cores */ | ||
228 | #if 0 | ||
229 | /* Keep it as single core until dual core support is ready */ | ||
230 | #define NUM_CORES 2 | ||
231 | #define CURRENT_CORE current_core() | ||
232 | #endif | ||
233 | |||
234 | #define NUM_CORES 1 | ||
235 | #define CURRENT_CORE 0 | ||
236 | #else | ||
237 | #define NUM_CORES 1 | ||
238 | #define CURRENT_CORE 0 | ||
222 | #endif | 239 | #endif |
223 | 240 | ||
224 | /* define for all cpus from ARM family */ | 241 | /* define for all cpus from ARM family */ |
diff --git a/firmware/export/system.h b/firmware/export/system.h index 1b326e1b8b..d13b27c529 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h | |||
@@ -43,6 +43,8 @@ static inline void udelay(unsigned usecs) | |||
43 | unsigned start = USEC_TIMER; | 43 | unsigned start = USEC_TIMER; |
44 | while ((USEC_TIMER - start) < usecs); | 44 | while ((USEC_TIMER - start) < usecs); |
45 | } | 45 | } |
46 | |||
47 | unsigned int current_core(void); | ||
46 | #endif | 48 | #endif |
47 | 49 | ||
48 | struct flash_header { | 50 | struct flash_header { |
@@ -88,7 +90,7 @@ void cpu_idle_mode(bool on_off); | |||
88 | #define betoh32(x) swap32(x) | 90 | #define betoh32(x) swap32(x) |
89 | #define htobe16(x) swap16(x) | 91 | #define htobe16(x) swap16(x) |
90 | #define htobe32(x) swap32(x) | 92 | #define htobe32(x) swap32(x) |
91 | #else | 93 | #else |
92 | #define letoh16(x) swap16(x) | 94 | #define letoh16(x) swap16(x) |
93 | #define letoh32(x) swap32(x) | 95 | #define letoh32(x) swap32(x) |
94 | #define htole16(x) swap16(x) | 96 | #define htole16(x) swap16(x) |
@@ -178,7 +180,7 @@ static inline void coldfire_set_macsr(unsigned long flags) | |||
178 | static inline unsigned long coldfire_get_macsr(void) | 180 | static inline unsigned long coldfire_get_macsr(void) |
179 | { | 181 | { |
180 | unsigned long m; | 182 | unsigned long m; |
181 | 183 | ||
182 | asm volatile ("move.l %%macsr, %0" : "=r" (m)); | 184 | asm volatile ("move.l %%macsr, %0" : "=r" (m)); |
183 | return m; | 185 | return m; |
184 | } | 186 | } |
@@ -301,7 +303,7 @@ static inline void invalidate_icache(void) | |||
301 | "move.l #0x80000000,%d0\n" | 303 | "move.l #0x80000000,%d0\n" |
302 | "movec.l %d0,%cacr"); | 304 | "movec.l %d0,%cacr"); |
303 | } | 305 | } |
304 | 306 | ||
305 | #define CPUFREQ_DEFAULT_MULT 1 | 307 | #define CPUFREQ_DEFAULT_MULT 1 |
306 | #define CPUFREQ_DEFAULT (CPUFREQ_DEFAULT_MULT * CPU_FREQ) | 308 | #define CPUFREQ_DEFAULT (CPUFREQ_DEFAULT_MULT * CPU_FREQ) |
307 | #define CPUFREQ_NORMAL_MULT 4 | 309 | #define CPUFREQ_NORMAL_MULT 4 |
@@ -315,7 +317,7 @@ static inline void invalidate_icache(void) | |||
315 | 317 | ||
316 | #define CPUFREQ_DEFAULT_MULT 8 | 318 | #define CPUFREQ_DEFAULT_MULT 8 |
317 | #define CPUFREQ_DEFAULT 24000000 | 319 | #define CPUFREQ_DEFAULT 24000000 |
318 | #define CPUFREQ_NORMAL_MULT 10 | 320 | #define CPUFREQ_NORMAL_MULT 10 |
319 | #define CPUFREQ_NORMAL 30000000 | 321 | #define CPUFREQ_NORMAL 30000000 |
320 | #define CPUFREQ_MAX_MULT 25 | 322 | #define CPUFREQ_MAX_MULT 25 |
321 | #define CPUFREQ_MAX 75000000 | 323 | #define CPUFREQ_MAX 75000000 |
@@ -336,7 +338,7 @@ static inline unsigned long swap32(unsigned long value) | |||
336 | result[15.. 8] = value[23..16]; | 338 | result[15.. 8] = value[23..16]; |
337 | result[ 7.. 0] = value[31..24]; | 339 | result[ 7.. 0] = value[31..24]; |
338 | */ | 340 | */ |
339 | { | 341 | { |
340 | unsigned int tmp; | 342 | unsigned int tmp; |
341 | 343 | ||
342 | asm volatile ( | 344 | asm volatile ( |
@@ -418,7 +420,7 @@ static inline int set_irq_level(int level) | |||
418 | __asm__ volatile ("clrsr ie"); | 420 | __asm__ volatile ("clrsr ie"); |
419 | else | 421 | else |
420 | __asm__ volatile ("setsr ie"); | 422 | __asm__ volatile ("setsr ie"); |
421 | 423 | ||
422 | return result; | 424 | return result; |
423 | } | 425 | } |
424 | 426 | ||
diff --git a/firmware/export/thread.h b/firmware/export/thread.h index 762e315a4c..a5034aedab 100644 --- a/firmware/export/thread.h +++ b/firmware/export/thread.h | |||
@@ -31,12 +31,16 @@ | |||
31 | 31 | ||
32 | int create_thread(void (*function)(void), void* stack, int stack_size, | 32 | int create_thread(void (*function)(void), void* stack, int stack_size, |
33 | const char *name); | 33 | const char *name); |
34 | int create_thread_on_core(unsigned int core, void (*function)(void), void* stack, int stack_size, | ||
35 | const char *name); | ||
34 | void remove_thread(int threadnum); | 36 | void remove_thread(int threadnum); |
37 | void remove_thread_on_core(unsigned int core, int threadnum); | ||
35 | void switch_thread(void); | 38 | void switch_thread(void); |
36 | void sleep_thread(void); | 39 | void sleep_thread(void); |
37 | void wake_up_thread(void); | 40 | void wake_up_thread(void); |
38 | void init_threads(void); | 41 | void init_threads(void); |
39 | int thread_stack_usage(int threadnum); | 42 | int thread_stack_usage(int threadnum); |
43 | int thread_stack_usage_on_core(unsigned int core, int threadnum); | ||
40 | #ifdef RB_PROFILE | 44 | #ifdef RB_PROFILE |
41 | void profile_thread(void); | 45 | void profile_thread(void); |
42 | #endif | 46 | #endif |