diff options
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/spufs.h')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/spufs.h | 34 |
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 */ |
43 | enum { | 43 | enum { |
44 | SPU_SCHED_WAKE = 0, /* currently unused */ | 44 | SPU_SCHED_EXITING = 0, |
45 | }; | 45 | }; |
46 | 46 | ||
47 | struct spu_context { | 47 | struct 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 | ||
145 | extern struct spu_context_ops spu_hw_ops; | 147 | extern 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); | |||
170 | void spu_gang_remove_ctx(struct spu_gang *gang, struct spu_context *ctx); | 173 | void spu_gang_remove_ctx(struct spu_gang *gang, struct spu_context *ctx); |
171 | void spu_gang_add_ctx(struct spu_gang *gang, struct spu_context *ctx); | 174 | void spu_gang_add_ctx(struct spu_gang *gang, struct spu_context *ctx); |
172 | 175 | ||
176 | /* fault handling */ | ||
177 | int spufs_handle_class1(struct spu_context *ctx); | ||
178 | |||
173 | /* context management */ | 179 | /* context management */ |
174 | static inline void spu_acquire(struct spu_context *ctx) | 180 | static inline void spu_acquire(struct spu_context *ctx) |
175 | { | 181 | { |
@@ -190,7 +196,6 @@ void spu_unmap_mappings(struct spu_context *ctx); | |||
190 | void spu_forget(struct spu_context *ctx); | 196 | void spu_forget(struct spu_context *ctx); |
191 | int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags); | 197 | int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags); |
192 | void spu_acquire_saved(struct spu_context *ctx); | 198 | void spu_acquire_saved(struct spu_context *ctx); |
193 | int spu_acquire_exclusive(struct spu_context *ctx); | ||
194 | 199 | ||
195 | int spu_activate(struct spu_context *ctx, unsigned long flags); | 200 | int spu_activate(struct spu_context *ctx, unsigned long flags); |
196 | void spu_deactivate(struct spu_context *ctx); | 201 | void 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; \ |