diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/config.h | 8 | ||||
-rw-r--r-- | firmware/export/kernel.h | 8 | ||||
-rw-r--r-- | firmware/export/pp5020.h | 25 | ||||
-rw-r--r-- | firmware/export/thread.h | 57 |
4 files changed, 44 insertions, 54 deletions
diff --git a/firmware/export/config.h b/firmware/export/config.h index 40d1c168a3..9346abbdc9 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -372,10 +372,10 @@ | |||
372 | #define NOCACHEBSS_ATTR IBSS_ATTR | 372 | #define NOCACHEBSS_ATTR IBSS_ATTR |
373 | #define NOCACHEDATA_ATTR IDATA_ATTR | 373 | #define NOCACHEDATA_ATTR IDATA_ATTR |
374 | 374 | ||
375 | #define IF_COP(empty, x, y) , x, y | 375 | #define IF_COP(...) __VA_ARGS__ |
376 | 376 | ||
377 | /* Defines for inter-core messaging */ | 377 | #define IDLE_STACK_SIZE 0x80 |
378 | #define COP_REBOOT 1 | 378 | #define IDLE_STACK_WORDS 0x20 |
379 | 379 | ||
380 | #else | 380 | #else |
381 | #define NUM_CORES 1 | 381 | #define NUM_CORES 1 |
@@ -383,7 +383,7 @@ | |||
383 | #define NOCACHEBSS_ATTR | 383 | #define NOCACHEBSS_ATTR |
384 | #define NOCACHEDATA_ATTR | 384 | #define NOCACHEDATA_ATTR |
385 | 385 | ||
386 | #define IF_COP(empty, x, y) | 386 | #define IF_COP(...) |
387 | 387 | ||
388 | #endif /* Processor specific */ | 388 | #endif /* Processor specific */ |
389 | 389 | ||
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h index 50c9bdc0ae..8d7ca95184 100644 --- a/firmware/export/kernel.h +++ b/firmware/export/kernel.h | |||
@@ -94,9 +94,6 @@ struct event_queue | |||
94 | struct thread_entry *thread; | 94 | struct thread_entry *thread; |
95 | unsigned int read; | 95 | unsigned int read; |
96 | unsigned int write; | 96 | unsigned int write; |
97 | #if NUM_CORES > 1 | ||
98 | bool irq_safe; | ||
99 | #endif | ||
100 | #ifdef HAVE_EXTENDED_MESSAGING_AND_NAME | 97 | #ifdef HAVE_EXTENDED_MESSAGING_AND_NAME |
101 | struct queue_sender_list *send; | 98 | struct queue_sender_list *send; |
102 | #endif | 99 | #endif |
@@ -153,11 +150,6 @@ void timeout_register(struct timeout *tmo, timeout_cb_type callback, | |||
153 | void timeout_cancel(struct timeout *tmo); | 150 | void timeout_cancel(struct timeout *tmo); |
154 | 151 | ||
155 | extern void queue_init(struct event_queue *q, bool register_queue); | 152 | extern void queue_init(struct event_queue *q, bool register_queue); |
156 | #if NUM_CORES > 1 | ||
157 | extern void queue_set_irq_safe(struct event_queue *q, bool state); | ||
158 | #else | ||
159 | #define queue_set_irq_safe(q,state) | ||
160 | #endif | ||
161 | extern void queue_delete(struct event_queue *q); | 153 | extern void queue_delete(struct event_queue *q); |
162 | extern void queue_wait(struct event_queue *q, struct event *ev); | 154 | extern void queue_wait(struct event_queue *q, struct event *ev); |
163 | extern void queue_wait_w_tmo(struct event_queue *q, struct event *ev, int ticks); | 155 | extern void queue_wait_w_tmo(struct event_queue *q, struct event *ev, int ticks); |
diff --git a/firmware/export/pp5020.h b/firmware/export/pp5020.h index b2c7f4d0d2..5da2061798 100644 --- a/firmware/export/pp5020.h +++ b/firmware/export/pp5020.h | |||
@@ -118,18 +118,18 @@ | |||
118 | #define DEV_RS (*(volatile unsigned long *)(0x60006004)) | 118 | #define DEV_RS (*(volatile unsigned long *)(0x60006004)) |
119 | #define DEV_EN (*(volatile unsigned long *)(0x6000600c)) | 119 | #define DEV_EN (*(volatile unsigned long *)(0x6000600c)) |
120 | 120 | ||
121 | #define DEV_SYSTEM 0x4 | 121 | #define DEV_SYSTEM 0x00000004 |
122 | #define DEV_SER0 0x40 | 122 | #define DEV_SER0 0x00000040 |
123 | #define DEV_SER1 0x80 | 123 | #define DEV_SER1 0x00000080 |
124 | #define DEV_I2S 0x800 | 124 | #define DEV_I2S 0x00000800 |
125 | #define DEV_I2C 0x1000 | 125 | #define DEV_I2C 0x00001000 |
126 | #define DEV_ATA 0x4000 | 126 | #define DEV_ATA 0x00004000 |
127 | #define DEV_OPTO 0x10000 | 127 | #define DEV_OPTO 0x00010000 |
128 | #define DEV_PIEZO 0x10000 | 128 | #define DEV_PIEZO 0x00010000 |
129 | #define DEV_USB 0x400000 | 129 | #define DEV_USB 0x00400000 |
130 | #define DEV_FIREWIRE 0x800000 | 130 | #define DEV_FIREWIRE 0x00800000 |
131 | #define DEV_IDE0 0x2000000 | 131 | #define DEV_IDE0 0x02000000 |
132 | #define DEV_LCD 0x4000000 | 132 | #define DEV_LCD 0x04000000 |
133 | 133 | ||
134 | /* clock control */ | 134 | /* clock control */ |
135 | #define CLOCK_SOURCE (*(volatile unsigned long *)(0x60006020)) | 135 | #define CLOCK_SOURCE (*(volatile unsigned long *)(0x60006020)) |
@@ -174,6 +174,7 @@ | |||
174 | 174 | ||
175 | #define CACHE_DISABLE 0 | 175 | #define CACHE_DISABLE 0 |
176 | #define CACHE_ENABLE 1 | 176 | #define CACHE_ENABLE 1 |
177 | #define CACHE_RUN 2 | ||
177 | #define CACHE_INIT 4 | 178 | #define CACHE_INIT 4 |
178 | 179 | ||
179 | /* GPIO Ports */ | 180 | /* GPIO Ports */ |
diff --git a/firmware/export/thread.h b/firmware/export/thread.h index 19bf9e12fc..e16baa2256 100644 --- a/firmware/export/thread.h +++ b/firmware/export/thread.h | |||
@@ -50,32 +50,32 @@ | |||
50 | #ifndef SIMULATOR | 50 | #ifndef SIMULATOR |
51 | /* Need to keep structures inside the header file because debug_menu | 51 | /* Need to keep structures inside the header file because debug_menu |
52 | * needs them. */ | 52 | * needs them. */ |
53 | # ifdef CPU_COLDFIRE | 53 | #ifdef CPU_COLDFIRE |
54 | struct regs | 54 | struct regs |
55 | { | 55 | { |
56 | unsigned int macsr; /* EMAC status register */ | 56 | unsigned int macsr; /* 0 - EMAC status register */ |
57 | unsigned int d[6]; /* d2-d7 */ | 57 | unsigned int d[6]; /* 4-24 - d2-d7 */ |
58 | unsigned int a[5]; /* a2-a6 */ | 58 | unsigned int a[5]; /* 28-44 - a2-a6 */ |
59 | void *sp; /* Stack pointer (a7) */ | 59 | void *sp; /* 48 - Stack pointer (a7) */ |
60 | void *start; /* Thread start address, or NULL when started */ | 60 | void *start; /* 52 - Thread start address, or NULL when started */ |
61 | }; | 61 | } __attribute__((packed)); |
62 | # elif CONFIG_CPU == SH7034 | 62 | #elif CONFIG_CPU == SH7034 |
63 | struct regs | 63 | struct regs |
64 | { | 64 | { |
65 | unsigned int r[7]; /* Registers r8 thru r14 */ | 65 | unsigned int r[7]; /* 0-24 - Registers r8 thru r14 */ |
66 | void *sp; /* Stack pointer (r15) */ | 66 | void *sp; /* 28 - Stack pointer (r15) */ |
67 | void *pr; /* Procedure register */ | 67 | void *pr; /* 32 - Procedure register */ |
68 | void *start; /* Thread start address, or NULL when started */ | 68 | void *start; /* 36 - Thread start address, or NULL when started */ |
69 | }; | 69 | } __attribute__((packed)); |
70 | # elif defined(CPU_ARM) | 70 | #elif defined(CPU_ARM) |
71 | struct regs | 71 | struct regs |
72 | { | 72 | { |
73 | unsigned int r[8]; /* Registers r4-r11 */ | 73 | unsigned int r[8]; /* 0-28 - Registers r4-r11 */ |
74 | void *sp; /* Stack pointer (r13) */ | 74 | void *sp; /* 32 - Stack pointer (r13) */ |
75 | unsigned int lr; /* r14 (lr) */ | 75 | unsigned int lr; /* 36 - r14 (lr) */ |
76 | void *start; /* Thread start address, or NULL when started */ | 76 | void *start; /* 40 - Thread start address, or NULL when started */ |
77 | }; | 77 | } __attribute__((packed)); |
78 | # endif | 78 | #endif /* CONFIG_CPU */ |
79 | #else | 79 | #else |
80 | struct regs | 80 | struct regs |
81 | { | 81 | { |
@@ -140,9 +140,9 @@ struct core_entry { | |||
140 | }; | 140 | }; |
141 | 141 | ||
142 | #ifdef HAVE_PRIORITY_SCHEDULING | 142 | #ifdef HAVE_PRIORITY_SCHEDULING |
143 | #define IF_PRIO(empty, type) , type | 143 | #define IF_PRIO(...) __VA_ARGS__ |
144 | #else | 144 | #else |
145 | #define IF_PRIO(empty, type) | 145 | #define IF_PRIO(...) |
146 | #endif | 146 | #endif |
147 | 147 | ||
148 | /* PortalPlayer chips have 2 cores, therefore need atomic mutexes | 148 | /* PortalPlayer chips have 2 cores, therefore need atomic mutexes |
@@ -197,14 +197,6 @@ struct core_entry { | |||
197 | }) | 197 | }) |
198 | #endif | 198 | #endif |
199 | 199 | ||
200 | #if NUM_CORES > 1 | ||
201 | inline void lock_cores(void); | ||
202 | inline void unlock_cores(void); | ||
203 | #else | ||
204 | #define lock_cores(...) | ||
205 | #define unlock_cores(...) | ||
206 | #endif | ||
207 | |||
208 | struct thread_entry* | 200 | struct thread_entry* |
209 | create_thread(void (*function)(void), void* stack, int stack_size, | 201 | create_thread(void (*function)(void), void* stack, int stack_size, |
210 | const char *name IF_PRIO(, int priority) | 202 | const char *name IF_PRIO(, int priority) |
@@ -239,7 +231,12 @@ void priority_yield(void); | |||
239 | struct thread_entry * thread_get_current(void); | 231 | struct thread_entry * thread_get_current(void); |
240 | void init_threads(void); | 232 | void init_threads(void); |
241 | int thread_stack_usage(const struct thread_entry *thread); | 233 | int thread_stack_usage(const struct thread_entry *thread); |
234 | #if NUM_CORES > 1 | ||
235 | int idle_stack_usage(unsigned int core); | ||
236 | #endif | ||
242 | int thread_get_status(const struct thread_entry *thread); | 237 | int thread_get_status(const struct thread_entry *thread); |
238 | void thread_get_name(char *buffer, int size, | ||
239 | struct thread_entry *thread); | ||
243 | #ifdef RB_PROFILE | 240 | #ifdef RB_PROFILE |
244 | void profile_thread(void); | 241 | void profile_thread(void); |
245 | #endif | 242 | #endif |