summaryrefslogtreecommitdiff
path: root/firmware/export/kernel.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-03-02 08:49:38 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-03-02 08:49:38 +0000
commit12375d1d3aa41f7d277a9af584c7b810b636ec95 (patch)
treefc9ce8029a6910a8dac71b3bf60c71155a01eea4 /firmware/export/kernel.h
parent05e180a1308a095d51d51d0e047fcd44425ea88f (diff)
downloadrockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.tar.gz
rockbox-12375d1d3aa41f7d277a9af584c7b810b636ec95.zip
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.h20
1 files changed, 2 insertions, 18 deletions
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h
index 20743c554b..6aaf11ddb9 100644
--- a/firmware/export/kernel.h
+++ b/firmware/export/kernel.h
@@ -160,22 +160,12 @@ struct mutex
160struct semaphore 160struct semaphore
161{ 161{
162 struct thread_entry *queue; /* Waiter list */ 162 struct thread_entry *queue; /* Waiter list */
163 int count; /* # of waits remaining before unsignaled */ 163 int volatile count; /* # of waits remaining before unsignaled */
164 int max; /* maximum # of waits to remain signaled */ 164 int max; /* maximum # of waits to remain signaled */
165 IF_COP( struct corelock cl; ) /* multiprocessor sync */ 165 IF_COP( struct corelock cl; ) /* multiprocessor sync */
166}; 166};
167#endif 167#endif
168 168
169#ifdef HAVE_WAKEUP_OBJECTS
170struct wakeup
171{
172 struct thread_entry *queue; /* waiter list */
173 bool volatile signalled; /* signalled status */
174 IF_COP( struct corelock cl; ) /* multiprocessor sync */
175};
176#endif
177
178
179/* global tick variable */ 169/* global tick variable */
180#if defined(CPU_PP) && defined(BOOTLOADER) && \ 170#if defined(CPU_PP) && defined(BOOTLOADER) && \
181 !defined(HAVE_BOOTLOADER_USB_MODE) 171 !defined(HAVE_BOOTLOADER_USB_MODE)
@@ -280,14 +270,8 @@ static inline bool mutex_test(const struct mutex *m)
280 270
281#ifdef HAVE_SEMAPHORE_OBJECTS 271#ifdef HAVE_SEMAPHORE_OBJECTS
282extern void semaphore_init(struct semaphore *s, int max, int start); 272extern void semaphore_init(struct semaphore *s, int max, int start);
283extern void semaphore_wait(struct semaphore *s); 273extern int semaphore_wait(struct semaphore *s, int timeout);
284extern void semaphore_release(struct semaphore *s); 274extern void semaphore_release(struct semaphore *s);
285#endif /* HAVE_SEMAPHORE_OBJECTS */ 275#endif /* HAVE_SEMAPHORE_OBJECTS */
286 276
287#ifdef HAVE_WAKEUP_OBJECTS
288extern void wakeup_init(struct wakeup *w);
289extern int wakeup_wait(struct wakeup *w, int timeout);
290extern int wakeup_signal(struct wakeup *w);
291#endif /* HAVE_WAKEUP_OBJECTS */
292
293#endif /* _KERNEL_H_ */ 277#endif /* _KERNEL_H_ */