arnd@arndb.de | 0afacde | 2006-10-24 18:31:18 +0200 | [diff] [blame] | 1 | #define DEBUG |
| 2 | |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 3 | #include <linux/wait.h> |
| 4 | #include <linux/ptrace.h> |
| 5 | |
| 6 | #include <asm/spu.h> |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 7 | #include <asm/spu_priv1.h> |
| 8 | #include <asm/io.h> |
Dave Jones | cfff5b2 | 2006-03-31 23:53:09 -0500 | [diff] [blame] | 9 | #include <asm/unistd.h> |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 10 | |
| 11 | #include "spufs.h" |
| 12 | |
| 13 | /* interrupt-level stop callback function. */ |
| 14 | void spufs_stop_callback(struct spu *spu) |
| 15 | { |
| 16 | struct spu_context *ctx = spu->ctx; |
| 17 | |
| 18 | wake_up_all(&ctx->stop_wq); |
| 19 | } |
| 20 | |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 21 | void spufs_dma_callback(struct spu *spu, int type) |
| 22 | { |
| 23 | struct spu_context *ctx = spu->ctx; |
| 24 | |
| 25 | if (ctx->flags & SPU_CREATE_EVENTS_ENABLED) { |
| 26 | ctx->event_return |= type; |
| 27 | wake_up_all(&ctx->stop_wq); |
| 28 | } else { |
| 29 | switch (type) { |
| 30 | case SPE_EVENT_DMA_ALIGNMENT: |
Arnd Bergmann | 453d9f7 | 2006-11-20 18:45:03 +0100 | [diff] [blame] | 31 | case SPE_EVENT_SPE_DATA_STORAGE: |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 32 | case SPE_EVENT_INVALID_DMA: |
| 33 | force_sig(SIGBUS, /* info, */ current); |
| 34 | break; |
| 35 | case SPE_EVENT_SPE_ERROR: |
| 36 | force_sig(SIGILL, /* info */ current); |
| 37 | break; |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 42 | static inline int spu_stopped(struct spu_context *ctx, u32 * stat) |
| 43 | { |
| 44 | struct spu *spu; |
| 45 | u64 pte_fault; |
| 46 | |
| 47 | *stat = ctx->ops->status_read(ctx); |
| 48 | if (ctx->state != SPU_STATE_RUNNABLE) |
| 49 | return 1; |
| 50 | spu = ctx->spu; |
| 51 | pte_fault = spu->dsisr & |
| 52 | (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED); |
| 53 | return (!(*stat & 0x1) || pte_fault || spu->class_0_pending) ? 1 : 0; |
| 54 | } |
| 55 | |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 56 | static int spu_setup_isolated(struct spu_context *ctx) |
| 57 | { |
| 58 | int ret; |
| 59 | u64 __iomem *mfc_cntl; |
| 60 | u64 sr1; |
| 61 | u32 status; |
| 62 | unsigned long timeout; |
| 63 | const u32 status_loading = SPU_STATUS_RUNNING |
| 64 | | SPU_STATUS_ISOLATED_STATE | SPU_STATUS_ISOLATED_LOAD_STATUS; |
| 65 | |
Christoph Hellwig | 7ec18ab | 2007-04-23 21:08:12 +0200 | [diff] [blame^] | 66 | ret = -ENODEV; |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 67 | if (!isolated_loader) |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 68 | goto out; |
| 69 | |
Christoph Hellwig | 7ec18ab | 2007-04-23 21:08:12 +0200 | [diff] [blame^] | 70 | /* |
| 71 | * We need to exclude userspace access to the context. |
| 72 | * |
| 73 | * To protect against memory access we invalidate all ptes |
| 74 | * and make sure the pagefault handlers block on the mutex. |
| 75 | */ |
| 76 | spu_unmap_mappings(ctx); |
| 77 | |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 78 | mfc_cntl = &ctx->spu->priv2->mfc_control_RW; |
| 79 | |
| 80 | /* purge the MFC DMA queue to ensure no spurious accesses before we |
| 81 | * enter kernel mode */ |
| 82 | timeout = jiffies + HZ; |
| 83 | out_be64(mfc_cntl, MFC_CNTL_PURGE_DMA_REQUEST); |
| 84 | while ((in_be64(mfc_cntl) & MFC_CNTL_PURGE_DMA_STATUS_MASK) |
| 85 | != MFC_CNTL_PURGE_DMA_COMPLETE) { |
| 86 | if (time_after(jiffies, timeout)) { |
| 87 | printk(KERN_ERR "%s: timeout flushing MFC DMA queue\n", |
| 88 | __FUNCTION__); |
| 89 | ret = -EIO; |
Christoph Hellwig | 7ec18ab | 2007-04-23 21:08:12 +0200 | [diff] [blame^] | 90 | goto out; |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 91 | } |
| 92 | cond_resched(); |
| 93 | } |
| 94 | |
| 95 | /* put the SPE in kernel mode to allow access to the loader */ |
| 96 | sr1 = spu_mfc_sr1_get(ctx->spu); |
| 97 | sr1 &= ~MFC_STATE1_PROBLEM_STATE_MASK; |
| 98 | spu_mfc_sr1_set(ctx->spu, sr1); |
| 99 | |
| 100 | /* start the loader */ |
| 101 | ctx->ops->signal1_write(ctx, (unsigned long)isolated_loader >> 32); |
| 102 | ctx->ops->signal2_write(ctx, |
| 103 | (unsigned long)isolated_loader & 0xffffffff); |
| 104 | |
| 105 | ctx->ops->runcntl_write(ctx, |
| 106 | SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE); |
| 107 | |
| 108 | ret = 0; |
| 109 | timeout = jiffies + HZ; |
| 110 | while (((status = ctx->ops->status_read(ctx)) & status_loading) == |
| 111 | status_loading) { |
| 112 | if (time_after(jiffies, timeout)) { |
| 113 | printk(KERN_ERR "%s: timeout waiting for loader\n", |
| 114 | __FUNCTION__); |
| 115 | ret = -EIO; |
| 116 | goto out_drop_priv; |
| 117 | } |
| 118 | cond_resched(); |
| 119 | } |
| 120 | |
| 121 | if (!(status & SPU_STATUS_RUNNING)) { |
| 122 | /* If isolated LOAD has failed: run SPU, we will get a stop-and |
| 123 | * signal later. */ |
| 124 | pr_debug("%s: isolated LOAD failed\n", __FUNCTION__); |
| 125 | ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE); |
| 126 | ret = -EACCES; |
Christoph Hellwig | 7ec18ab | 2007-04-23 21:08:12 +0200 | [diff] [blame^] | 127 | goto out_drop_priv; |
| 128 | } |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 129 | |
Christoph Hellwig | 7ec18ab | 2007-04-23 21:08:12 +0200 | [diff] [blame^] | 130 | if (!(status & SPU_STATUS_ISOLATED_STATE)) { |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 131 | /* This isn't allowed by the CBEA, but check anyway */ |
| 132 | pr_debug("%s: SPU fell out of isolated mode?\n", __FUNCTION__); |
| 133 | ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_STOP); |
| 134 | ret = -EINVAL; |
Christoph Hellwig | 7ec18ab | 2007-04-23 21:08:12 +0200 | [diff] [blame^] | 135 | goto out_drop_priv; |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | out_drop_priv: |
| 139 | /* Finished accessing the loader. Drop kernel mode */ |
| 140 | sr1 |= MFC_STATE1_PROBLEM_STATE_MASK; |
| 141 | spu_mfc_sr1_set(ctx->spu, sr1); |
| 142 | |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 143 | out: |
| 144 | return ret; |
| 145 | } |
| 146 | |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 147 | static inline int spu_run_init(struct spu_context *ctx, u32 * npc) |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 148 | { |
| 149 | int ret; |
Mark Nutter | 5737edd | 2006-10-24 18:31:16 +0200 | [diff] [blame] | 150 | unsigned long runcntl = SPU_RUNCNTL_RUNNABLE; |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 151 | |
Christoph Hellwig | 50b520d | 2007-03-10 00:05:36 +0100 | [diff] [blame] | 152 | ret = spu_acquire_runnable(ctx, 0); |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 153 | if (ret) |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 154 | return ret; |
Mark Nutter | 5737edd | 2006-10-24 18:31:16 +0200 | [diff] [blame] | 155 | |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 156 | if (ctx->flags & SPU_CREATE_ISOLATE) { |
| 157 | if (!(ctx->ops->status_read(ctx) & SPU_STATUS_ISOLATED_STATE)) { |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 158 | ret = spu_setup_isolated(ctx); |
Christoph Hellwig | 7ec18ab | 2007-04-23 21:08:12 +0200 | [diff] [blame^] | 159 | if (ret) |
| 160 | spu_release(ctx); |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | /* if userspace has set the runcntrl register (eg, to issue an |
| 164 | * isolated exit), we need to re-set it here */ |
| 165 | runcntl = ctx->ops->runcntl_read(ctx) & |
| 166 | (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE); |
| 167 | if (runcntl == 0) |
| 168 | runcntl = SPU_RUNCNTL_RUNNABLE; |
Christoph Hellwig | 2eb1b12 | 2007-02-13 21:54:29 +0100 | [diff] [blame] | 169 | } else { |
| 170 | spu_start_tick(ctx); |
Mark Nutter | 5737edd | 2006-10-24 18:31:16 +0200 | [diff] [blame] | 171 | ctx->ops->npc_write(ctx, *npc); |
Christoph Hellwig | 2eb1b12 | 2007-02-13 21:54:29 +0100 | [diff] [blame] | 172 | } |
Jeremy Kerr | c6730ed | 2006-11-20 18:45:10 +0100 | [diff] [blame] | 173 | |
| 174 | ctx->ops->runcntl_write(ctx, runcntl); |
| 175 | return ret; |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | static inline int spu_run_fini(struct spu_context *ctx, u32 * npc, |
| 179 | u32 * status) |
| 180 | { |
| 181 | int ret = 0; |
| 182 | |
Christoph Hellwig | 2eb1b12 | 2007-02-13 21:54:29 +0100 | [diff] [blame] | 183 | spu_stop_tick(ctx); |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 184 | *status = ctx->ops->status_read(ctx); |
| 185 | *npc = ctx->ops->npc_read(ctx); |
| 186 | spu_release(ctx); |
| 187 | |
| 188 | if (signal_pending(current)) |
| 189 | ret = -ERESTARTSYS; |
Masato Noguchi | 2ebb247 | 2006-11-20 18:45:04 +0100 | [diff] [blame] | 190 | |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 191 | return ret; |
| 192 | } |
| 193 | |
| 194 | static inline int spu_reacquire_runnable(struct spu_context *ctx, u32 *npc, |
| 195 | u32 *status) |
| 196 | { |
| 197 | int ret; |
| 198 | |
| 199 | if ((ret = spu_run_fini(ctx, npc, status)) != 0) |
| 200 | return ret; |
| 201 | if (*status & (SPU_STATUS_STOPPED_BY_STOP | |
| 202 | SPU_STATUS_STOPPED_BY_HALT)) { |
| 203 | return *status; |
| 204 | } |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 205 | if ((ret = spu_run_init(ctx, npc)) != 0) |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 206 | return ret; |
| 207 | return 0; |
| 208 | } |
| 209 | |
Arnd Bergmann | 2dd1493 | 2006-03-23 00:00:09 +0100 | [diff] [blame] | 210 | /* |
| 211 | * SPU syscall restarting is tricky because we violate the basic |
| 212 | * assumption that the signal handler is running on the interrupted |
| 213 | * thread. Here instead, the handler runs on PowerPC user space code, |
| 214 | * while the syscall was called from the SPU. |
| 215 | * This means we can only do a very rough approximation of POSIX |
| 216 | * signal semantics. |
| 217 | */ |
| 218 | int spu_handle_restartsys(struct spu_context *ctx, long *spu_ret, |
| 219 | unsigned int *npc) |
| 220 | { |
| 221 | int ret; |
| 222 | |
| 223 | switch (*spu_ret) { |
| 224 | case -ERESTARTSYS: |
| 225 | case -ERESTARTNOINTR: |
| 226 | /* |
| 227 | * Enter the regular syscall restarting for |
| 228 | * sys_spu_run, then restart the SPU syscall |
| 229 | * callback. |
| 230 | */ |
| 231 | *npc -= 8; |
| 232 | ret = -ERESTARTSYS; |
| 233 | break; |
| 234 | case -ERESTARTNOHAND: |
| 235 | case -ERESTART_RESTARTBLOCK: |
| 236 | /* |
| 237 | * Restart block is too hard for now, just return -EINTR |
| 238 | * to the SPU. |
| 239 | * ERESTARTNOHAND comes from sys_pause, we also return |
| 240 | * -EINTR from there. |
| 241 | * Assume that we need to be restarted ourselves though. |
| 242 | */ |
| 243 | *spu_ret = -EINTR; |
| 244 | ret = -ERESTARTSYS; |
| 245 | break; |
| 246 | default: |
| 247 | printk(KERN_WARNING "%s: unexpected return code %ld\n", |
| 248 | __FUNCTION__, *spu_ret); |
| 249 | ret = 0; |
| 250 | } |
| 251 | return ret; |
| 252 | } |
| 253 | |
| 254 | int spu_process_callback(struct spu_context *ctx) |
| 255 | { |
| 256 | struct spu_syscall_block s; |
| 257 | u32 ls_pointer, npc; |
| 258 | char *ls; |
| 259 | long spu_ret; |
| 260 | int ret; |
| 261 | |
| 262 | /* get syscall block from local store */ |
| 263 | npc = ctx->ops->npc_read(ctx); |
| 264 | ls = ctx->ops->get_ls(ctx); |
| 265 | ls_pointer = *(u32*)(ls + npc); |
| 266 | if (ls_pointer > (LS_SIZE - sizeof(s))) |
| 267 | return -EFAULT; |
| 268 | memcpy(&s, ls + ls_pointer, sizeof (s)); |
| 269 | |
| 270 | /* do actual syscall without pinning the spu */ |
| 271 | ret = 0; |
| 272 | spu_ret = -ENOSYS; |
| 273 | npc += 4; |
| 274 | |
| 275 | if (s.nr_ret < __NR_syscalls) { |
| 276 | spu_release(ctx); |
| 277 | /* do actual system call from here */ |
| 278 | spu_ret = spu_sys_callback(&s); |
| 279 | if (spu_ret <= -ERESTARTSYS) { |
| 280 | ret = spu_handle_restartsys(ctx, &spu_ret, &npc); |
| 281 | } |
| 282 | spu_acquire(ctx); |
| 283 | if (ret == -ERESTARTSYS) |
| 284 | return ret; |
| 285 | } |
| 286 | |
| 287 | /* write result, jump over indirect pointer */ |
| 288 | memcpy(ls + ls_pointer, &spu_ret, sizeof (spu_ret)); |
| 289 | ctx->ops->npc_write(ctx, npc); |
| 290 | ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE); |
| 291 | return ret; |
| 292 | } |
| 293 | |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 294 | static inline int spu_process_events(struct spu_context *ctx) |
| 295 | { |
| 296 | struct spu *spu = ctx->spu; |
| 297 | u64 pte_fault = MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED; |
| 298 | int ret = 0; |
| 299 | |
| 300 | if (spu->dsisr & pte_fault) |
| 301 | ret = spu_irq_class_1_bottom(spu); |
| 302 | if (spu->class_0_pending) |
| 303 | ret = spu_irq_class_0_bottom(spu); |
| 304 | if (!ret && signal_pending(current)) |
| 305 | ret = -ERESTARTSYS; |
| 306 | return ret; |
| 307 | } |
| 308 | |
| 309 | long spufs_run_spu(struct file *file, struct spu_context *ctx, |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 310 | u32 *npc, u32 *event) |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 311 | { |
| 312 | int ret; |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 313 | u32 status; |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 314 | |
| 315 | if (down_interruptible(&ctx->run_sema)) |
| 316 | return -ERESTARTSYS; |
| 317 | |
Arnd Bergmann | ee2d734 | 2006-11-20 18:45:08 +0100 | [diff] [blame] | 318 | ctx->ops->master_start(ctx); |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 319 | ctx->event_return = 0; |
| 320 | ret = spu_run_init(ctx, npc); |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 321 | if (ret) |
| 322 | goto out; |
| 323 | |
| 324 | do { |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 325 | ret = spufs_wait(ctx->stop_wq, spu_stopped(ctx, &status)); |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 326 | if (unlikely(ret)) |
| 327 | break; |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 328 | if ((status & SPU_STATUS_STOPPED_BY_STOP) && |
| 329 | (status >> SPU_STOP_STATUS_SHIFT == 0x2104)) { |
Arnd Bergmann | 2dd1493 | 2006-03-23 00:00:09 +0100 | [diff] [blame] | 330 | ret = spu_process_callback(ctx); |
| 331 | if (ret) |
| 332 | break; |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 333 | status &= ~SPU_STATUS_STOPPED_BY_STOP; |
Arnd Bergmann | 2dd1493 | 2006-03-23 00:00:09 +0100 | [diff] [blame] | 334 | } |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 335 | if (unlikely(ctx->state != SPU_STATE_RUNNABLE)) { |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 336 | ret = spu_reacquire_runnable(ctx, npc, &status); |
Christoph Hellwig | 2eb1b12 | 2007-02-13 21:54:29 +0100 | [diff] [blame] | 337 | if (ret) { |
| 338 | spu_stop_tick(ctx); |
Masato Noguchi | 2ebb247 | 2006-11-20 18:45:04 +0100 | [diff] [blame] | 339 | goto out2; |
Christoph Hellwig | 2eb1b12 | 2007-02-13 21:54:29 +0100 | [diff] [blame] | 340 | } |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 341 | continue; |
| 342 | } |
| 343 | ret = spu_process_events(ctx); |
| 344 | |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 345 | } while (!ret && !(status & (SPU_STATUS_STOPPED_BY_STOP | |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 346 | SPU_STATUS_STOPPED_BY_HALT))); |
| 347 | |
Arnd Bergmann | ee2d734 | 2006-11-20 18:45:08 +0100 | [diff] [blame] | 348 | ctx->ops->master_stop(ctx); |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 349 | ret = spu_run_fini(ctx, npc, &status); |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 350 | spu_yield(ctx); |
| 351 | |
Masato Noguchi | 2ebb247 | 2006-11-20 18:45:04 +0100 | [diff] [blame] | 352 | out2: |
| 353 | if ((ret == 0) || |
| 354 | ((ret == -ERESTARTSYS) && |
| 355 | ((status & SPU_STATUS_STOPPED_BY_HALT) || |
| 356 | ((status & SPU_STATUS_STOPPED_BY_STOP) && |
| 357 | (status >> SPU_STOP_STATUS_SHIFT != 0x2104))))) |
| 358 | ret = status; |
| 359 | |
Arnd Bergmann | c2b2226 | 2006-11-27 19:18:53 +0100 | [diff] [blame] | 360 | if ((status & SPU_STATUS_STOPPED_BY_STOP) |
| 361 | && (status >> SPU_STOP_STATUS_SHIFT) == 0x3fff) { |
| 362 | force_sig(SIGTRAP, current); |
| 363 | ret = -ERESTARTSYS; |
Masato Noguchi | 2ebb247 | 2006-11-20 18:45:04 +0100 | [diff] [blame] | 364 | } |
| 365 | |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 366 | out: |
Arnd Bergmann | 9add11d | 2006-10-04 17:26:14 +0200 | [diff] [blame] | 367 | *event = ctx->event_return; |
Arnd Bergmann | ce8ab85 | 2006-01-04 20:31:29 +0100 | [diff] [blame] | 368 | up(&ctx->run_sema); |
| 369 | return ret; |
| 370 | } |