diff options
| author | Michael Sevakis <jethead71@rockbox.org> | 2011-03-02 08:49:38 +0000 |
|---|---|---|
| committer | Michael Sevakis <jethead71@rockbox.org> | 2011-03-02 08:49:38 +0000 |
| commit | 12375d1d3aa41f7d277a9af584c7b810b636ec95 (patch) | |
| tree | fc9ce8029a6910a8dac71b3bf60c71155a01eea4 /firmware/export/kernel.h | |
| parent | 05e180a1308a095d51d51d0e047fcd44425ea88f (diff) | |
| download | rockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.zip rockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.tar.gz rockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.tar.bz2 rockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.tar.xz | |
Merge functionality of wakeups and semaphores-- fewer APIs and object types. semaphore_wait takes a timeout now so codecs and plugins have to be made incompatible. Don't make semaphores for targets not using them.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29492 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/kernel.h')
| -rw-r--r-- | firmware/export/kernel.h | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h index 20743c5..6aaf11d 100644 --- a/firmware/export/kernel.h +++ b/firmware/export/kernel.h @@ -160,22 +160,12 @@ struct mutex struct semaphore { struct thread_entry *queue; /* Waiter list */ - int count; /* # of waits remaining before unsignaled */ + int volatile count; /* # of waits remaining before unsignaled */ int max; /* maximum # of waits to remain signaled */ IF_COP( struct corelock cl; ) /* multiprocessor sync */ }; #endif -#ifdef HAVE_WAKEUP_OBJECTS -struct wakeup -{ - struct thread_entry *queue; /* waiter list */ - bool volatile signalled; /* signalled status */ - IF_COP( struct corelock cl; ) /* multiprocessor sync */ -}; -#endif - - /* global tick variable */ #if defined(CPU_PP) && defined(BOOTLOADER) && \ !defined(HAVE_BOOTLOADER_USB_MODE) @@ -280,14 +270,8 @@ static inline bool mutex_test(const struct mutex *m) #ifdef HAVE_SEMAPHORE_OBJECTS extern void semaphore_init(struct semaphore *s, int max, int start); -extern void semaphore_wait(struct semaphore *s); +extern int semaphore_wait(struct semaphore *s, int timeout); extern void semaphore_release(struct semaphore *s); #endif /* HAVE_SEMAPHORE_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_ */ |