diff options
author | Christoph Hellwig <hch@lst.de> | 2007-12-20 02:39:59 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-21 03:46:21 -0500 |
commit | c9101bdb1b0c56a75a4618542d368fe5013946b9 (patch) | |
tree | 93c131fd8239bf537e383c29c2eb90d7346e426f /arch/powerpc/platforms/cell/spufs/spufs.h | |
parent | 197b1a8263bf365d2ca8aba532352036ff95e04d (diff) |
[POWERPC] spufs: make state_mutex interruptible
Make most places that use spu_acquire/spu_acquire_saved interruptible,
this allows getting out of the spufs code when e.g. pressing ctrl+c.
There are a few places where we get called e.g. from spufs teardown
routines were we can't simply err out so these are left with a comment.
For now I've also not touched the poll routines because it's open what
libspe would expect in terms of interrupted system calls.
Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/spufs.h')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/spufs.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h index 412de58f5b0f..0e114038ea6f 100644 --- a/arch/powerpc/platforms/cell/spufs/spufs.h +++ b/arch/powerpc/platforms/cell/spufs/spufs.h | |||
@@ -229,9 +229,9 @@ struct spu *affinity_check(struct spu_context *ctx); | |||
229 | 229 | ||
230 | /* context management */ | 230 | /* context management */ |
231 | extern atomic_t nr_spu_contexts; | 231 | extern atomic_t nr_spu_contexts; |
232 | static inline void spu_acquire(struct spu_context *ctx) | 232 | static inline int __must_check spu_acquire(struct spu_context *ctx) |
233 | { | 233 | { |
234 | mutex_lock(&ctx->state_mutex); | 234 | return mutex_lock_interruptible(&ctx->state_mutex); |
235 | } | 235 | } |
236 | 236 | ||
237 | static inline void spu_release(struct spu_context *ctx) | 237 | static inline void spu_release(struct spu_context *ctx) |
@@ -246,7 +246,7 @@ int put_spu_context(struct spu_context *ctx); | |||
246 | void spu_unmap_mappings(struct spu_context *ctx); | 246 | void spu_unmap_mappings(struct spu_context *ctx); |
247 | 247 | ||
248 | void spu_forget(struct spu_context *ctx); | 248 | void spu_forget(struct spu_context *ctx); |
249 | void spu_acquire_saved(struct spu_context *ctx); | 249 | int __must_check spu_acquire_saved(struct spu_context *ctx); |
250 | void spu_release_saved(struct spu_context *ctx); | 250 | void spu_release_saved(struct spu_context *ctx); |
251 | 251 | ||
252 | int spu_stopped(struct spu_context *ctx, u32 * stat); | 252 | int spu_stopped(struct spu_context *ctx, u32 * stat); |
@@ -284,7 +284,9 @@ extern char *isolated_loader; | |||
284 | } \ | 284 | } \ |
285 | spu_release(ctx); \ | 285 | spu_release(ctx); \ |
286 | schedule(); \ | 286 | schedule(); \ |
287 | spu_acquire(ctx); \ | 287 | __ret = spu_acquire(ctx); \ |
288 | if (__ret) \ | ||
289 | break; \ | ||
288 | } \ | 290 | } \ |
289 | finish_wait(&(wq), &__wait); \ | 291 | finish_wait(&(wq), &__wait); \ |
290 | __ret; \ | 292 | __ret; \ |