aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/spufs/spufs.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/spufs.h')
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h34
1 files changed, 19 insertions, 15 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 5c4e47d69d..0a947fd7de 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -41,7 +41,7 @@ struct spu_gang;
41 41
42/* ctx->sched_flags */ 42/* ctx->sched_flags */
43enum { 43enum {
44 SPU_SCHED_WAKE = 0, /* currently unused */ 44 SPU_SCHED_EXITING = 0,
45}; 45};
46 46
47struct spu_context { 47struct spu_context {
@@ -50,16 +50,17 @@ struct spu_context {
50 spinlock_t mmio_lock; /* protects mmio access */ 50 spinlock_t mmio_lock; /* protects mmio access */
51 struct address_space *local_store; /* local store mapping. */ 51 struct address_space *local_store; /* local store mapping. */
52 struct address_space *mfc; /* 'mfc' area mappings. */ 52 struct address_space *mfc; /* 'mfc' area mappings. */
53 struct address_space *cntl; /* 'control' area mappings. */ 53 struct address_space *cntl; /* 'control' area mappings. */
54 struct address_space *signal1; /* 'signal1' area mappings. */ 54 struct address_space *signal1; /* 'signal1' area mappings. */
55 struct address_space *signal2; /* 'signal2' area mappings. */ 55 struct address_space *signal2; /* 'signal2' area mappings. */
56 struct address_space *mss; /* 'mss' area mappings. */ 56 struct address_space *mss; /* 'mss' area mappings. */
57 struct address_space *psmap; /* 'psmap' area mappings. */ 57 struct address_space *psmap; /* 'psmap' area mappings. */
58 spinlock_t mapping_lock;
58 u64 object_id; /* user space pointer for oprofile */ 59 u64 object_id; /* user space pointer for oprofile */
59 60
60 enum { SPU_STATE_RUNNABLE, SPU_STATE_SAVED } state; 61 enum { SPU_STATE_RUNNABLE, SPU_STATE_SAVED } state;
61 struct mutex state_mutex; 62 struct mutex state_mutex;
62 struct semaphore run_sema; 63 struct mutex run_mutex;
63 64
64 struct mm_struct *owner; 65 struct mm_struct *owner;
65 66
@@ -140,6 +141,7 @@ struct spu_context_ops {
140 struct spu_dma_info * info); 141 struct spu_dma_info * info);
141 void (*proxydma_info_read) (struct spu_context * ctx, 142 void (*proxydma_info_read) (struct spu_context * ctx,
142 struct spu_proxydma_info * info); 143 struct spu_proxydma_info * info);
144 void (*restart_dma)(struct spu_context *ctx);
143}; 145};
144 146
145extern struct spu_context_ops spu_hw_ops; 147extern struct spu_context_ops spu_hw_ops;
@@ -149,6 +151,7 @@ struct spufs_inode_info {
149 struct spu_context *i_ctx; 151 struct spu_context *i_ctx;
150 struct spu_gang *i_gang; 152 struct spu_gang *i_gang;
151 struct inode vfs_inode; 153 struct inode vfs_inode;
154 int i_openers;
152}; 155};
153#define SPUFS_I(inode) \ 156#define SPUFS_I(inode) \
154 container_of(inode, struct spufs_inode_info, vfs_inode) 157 container_of(inode, struct spufs_inode_info, vfs_inode)
@@ -170,6 +173,9 @@ int put_spu_gang(struct spu_gang *gang);
170void spu_gang_remove_ctx(struct spu_gang *gang, struct spu_context *ctx); 173void spu_gang_remove_ctx(struct spu_gang *gang, struct spu_context *ctx);
171void spu_gang_add_ctx(struct spu_gang *gang, struct spu_context *ctx); 174void spu_gang_add_ctx(struct spu_gang *gang, struct spu_context *ctx);
172 175
176/* fault handling */
177int spufs_handle_class1(struct spu_context *ctx);
178
173/* context management */ 179/* context management */
174static inline void spu_acquire(struct spu_context *ctx) 180static inline void spu_acquire(struct spu_context *ctx)
175{ 181{
@@ -190,7 +196,6 @@ void spu_unmap_mappings(struct spu_context *ctx);
190void spu_forget(struct spu_context *ctx); 196void spu_forget(struct spu_context *ctx);
191int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags); 197int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags);
192void spu_acquire_saved(struct spu_context *ctx); 198void spu_acquire_saved(struct spu_context *ctx);
193int spu_acquire_exclusive(struct spu_context *ctx);
194 199
195int spu_activate(struct spu_context *ctx, unsigned long flags); 200int spu_activate(struct spu_context *ctx, unsigned long flags);
196void spu_deactivate(struct spu_context *ctx); 201void spu_deactivate(struct spu_context *ctx);
@@ -218,14 +223,13 @@ extern char *isolated_loader;
218 prepare_to_wait(&(wq), &__wait, TASK_INTERRUPTIBLE); \ 223 prepare_to_wait(&(wq), &__wait, TASK_INTERRUPTIBLE); \
219 if (condition) \ 224 if (condition) \
220 break; \ 225 break; \
221 if (!signal_pending(current)) { \ 226 if (signal_pending(current)) { \
222 spu_release(ctx); \ 227 __ret = -ERESTARTSYS; \
223 schedule(); \ 228 break; \
224 spu_acquire(ctx); \
225 continue; \
226 } \ 229 } \
227 __ret = -ERESTARTSYS; \ 230 spu_release(ctx); \
228 break; \ 231 schedule(); \
232 spu_acquire(ctx); \
229 } \ 233 } \
230 finish_wait(&(wq), &__wait); \ 234 finish_wait(&(wq), &__wait); \
231 __ret; \ 235 __ret; \