diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-03-30 04:59:51 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-03-30 04:59:51 +0000 |
commit | bc192c953eb2fe80cac471ea4601c27e23512440 (patch) | |
tree | 42b17a28635526d32560e14875865a88b2a6dac8 /firmware/export | |
parent | 8a6fd3ff4e63c81d7d50af535791318481280f95 (diff) | |
download | rockbox-bc192c953eb2fe80cac471ea4601c27e23512440.tar.gz rockbox-bc192c953eb2fe80cac471ea4601c27e23512440.zip |
Add a lightweight wakeup object for fast processors.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16885 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/config.h | 4 | ||||
-rw-r--r-- | firmware/export/kernel.h | 23 |
2 files changed, 27 insertions, 0 deletions
diff --git a/firmware/export/config.h b/firmware/export/config.h index 1a288dd590..cd98fc9dca 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -335,6 +335,10 @@ | |||
335 | #endif /* SIMULATOR */ | 335 | #endif /* SIMULATOR */ |
336 | #define HAVE_SEMAPHORE_OBJECTS | 336 | #define HAVE_SEMAPHORE_OBJECTS |
337 | #define HAVE_EVENT_OBJECTS | 337 | #define HAVE_EVENT_OBJECTS |
338 | |||
339 | #if defined (TOSHIBA_GIGABEAT_F) || defined (TOSHIBA_GIGABEAT_S) | ||
340 | #define HAVE_WAKEUP_OBJECTS | ||
341 | #endif | ||
338 | #endif | 342 | #endif |
339 | 343 | ||
340 | /* define for all cpus from SH family */ | 344 | /* define for all cpus from SH family */ |
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h index 78403c8b7d..337f249dfe 100644 --- a/firmware/export/kernel.h +++ b/firmware/export/kernel.h | |||
@@ -78,6 +78,11 @@ | |||
78 | 78 | ||
79 | #define IS_SYSEVENT(ev) ((ev & SYS_EVENT) == SYS_EVENT) | 79 | #define IS_SYSEVENT(ev) ((ev & SYS_EVENT) == SYS_EVENT) |
80 | 80 | ||
81 | #ifndef TIMEOUT_BLOCK | ||
82 | #define TIMEOUT_BLOCK -1 | ||
83 | #define TIMEOUT_NOBLOCK 0 | ||
84 | #endif | ||
85 | |||
81 | struct queue_event | 86 | struct queue_event |
82 | { | 87 | { |
83 | long id; | 88 | long id; |
@@ -178,6 +183,17 @@ struct event | |||
178 | }; | 183 | }; |
179 | #endif | 184 | #endif |
180 | 185 | ||
186 | |||
187 | #ifdef HAVE_WAKEUP_OBJECTS | ||
188 | struct wakeup | ||
189 | { | ||
190 | struct thread_entry *queue; /* waiter list */ | ||
191 | unsigned char signalled; /* signalled status */ | ||
192 | IF_COP( struct corelock cl; ) /* multiprocessor sync */ | ||
193 | }; | ||
194 | #endif | ||
195 | |||
196 | |||
181 | /* global tick variable */ | 197 | /* global tick variable */ |
182 | #if defined(CPU_PP) && defined(BOOTLOADER) | 198 | #if defined(CPU_PP) && defined(BOOTLOADER) |
183 | /* We don't enable interrupts in the iPod bootloader, so we need to fake | 199 | /* We don't enable interrupts in the iPod bootloader, so we need to fake |
@@ -225,6 +241,7 @@ void timeout_cancel(struct timeout *tmo); | |||
225 | #define STATE_SIGNALED 1 | 241 | #define STATE_SIGNALED 1 |
226 | 242 | ||
227 | #define WAIT_TIMEDOUT (-1) | 243 | #define WAIT_TIMEDOUT (-1) |
244 | #define WAIT_FAILED 0 | ||
228 | #define WAIT_SUCCEEDED 1 | 245 | #define WAIT_SUCCEEDED 1 |
229 | 246 | ||
230 | extern void queue_init(struct event_queue *q, bool register_queue); | 247 | extern void queue_init(struct event_queue *q, bool register_queue); |
@@ -274,4 +291,10 @@ extern void event_wait(struct event *e, unsigned int for_state); | |||
274 | extern void event_set_state(struct event *e, unsigned int state); | 291 | extern void event_set_state(struct event *e, unsigned int state); |
275 | #endif /* HAVE_EVENT_OBJECTS */ | 292 | #endif /* HAVE_EVENT_OBJECTS */ |
276 | 293 | ||
294 | #ifdef HAVE_WAKEUP_OBJECTS | ||
295 | extern void wakeup_init(struct wakeup *w); | ||
296 | extern int wakeup_wait(struct wakeup *w, int timeout); | ||
297 | extern int wakeup_signal(struct wakeup *w); | ||
298 | #endif /* HAVE_WAKEUP_OBJECTS */ | ||
299 | |||
277 | #endif /* _KERNEL_H_ */ | 300 | #endif /* _KERNEL_H_ */ |