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.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.h | 20 |
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 | |||
160 | struct semaphore | 160 | struct 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 | ||
170 | struct 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 |
282 | extern void semaphore_init(struct semaphore *s, int max, int start); | 272 | extern void semaphore_init(struct semaphore *s, int max, int start); |
283 | extern void semaphore_wait(struct semaphore *s); | 273 | extern int semaphore_wait(struct semaphore *s, int timeout); |
284 | extern void semaphore_release(struct semaphore *s); | 274 | extern void semaphore_release(struct semaphore *s); |
285 | #endif /* HAVE_SEMAPHORE_OBJECTS */ | 275 | #endif /* HAVE_SEMAPHORE_OBJECTS */ |
286 | 276 | ||
287 | #ifdef HAVE_WAKEUP_OBJECTS | ||
288 | extern void wakeup_init(struct wakeup *w); | ||
289 | extern int wakeup_wait(struct wakeup *w, int timeout); | ||
290 | extern int wakeup_signal(struct wakeup *w); | ||
291 | #endif /* HAVE_WAKEUP_OBJECTS */ | ||
292 | |||
293 | #endif /* _KERNEL_H_ */ | 277 | #endif /* _KERNEL_H_ */ |