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 @@ #endif /* SIMULATOR */ #define HAVE_SEMAPHORE_OBJECTS #define HAVE_EVENT_OBJECTS + +#if defined (TOSHIBA_GIGABEAT_F) || defined (TOSHIBA_GIGABEAT_S) +#define HAVE_WAKEUP_OBJECTS +#endif #endif /* 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 @@ #define IS_SYSEVENT(ev) ((ev & SYS_EVENT) == SYS_EVENT) +#ifndef TIMEOUT_BLOCK +#define TIMEOUT_BLOCK -1 +#define TIMEOUT_NOBLOCK 0 +#endif + struct queue_event { long id; @@ -178,6 +183,17 @@ struct event }; #endif + +#ifdef HAVE_WAKEUP_OBJECTS +struct wakeup +{ + struct thread_entry *queue; /* waiter list */ + unsigned char signalled; /* signalled status */ + IF_COP( struct corelock cl; ) /* multiprocessor sync */ +}; +#endif + + /* global tick variable */ #if defined(CPU_PP) && defined(BOOTLOADER) /* We don't enable interrupts in the iPod bootloader, so we need to fake @@ -225,6 +241,7 @@ void timeout_cancel(struct timeout *tmo); #define STATE_SIGNALED 1 #define WAIT_TIMEDOUT (-1) +#define WAIT_FAILED 0 #define WAIT_SUCCEEDED 1 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); extern void event_set_state(struct event *e, unsigned int state); #endif /* HAVE_EVENT_OBJECTS */ +#ifdef HAVE_WAKEUP_OBJECTS +extern void wakeup_init(struct wakeup *w); +extern int wakeup_wait(struct wakeup *w, int timeout); +extern int wakeup_signal(struct wakeup *w); +#endif /* HAVE_WAKEUP_OBJECTS */ + #endif /* _KERNEL_H_ */ |