aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/spufs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/file.c')
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c203
1 files changed, 132 insertions, 71 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index c81341ff75b..99c73066b82 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -238,11 +238,13 @@ spufs_mem_write(struct file *file, const char __user *buffer,
238 return size; 238 return size;
239} 239}
240 240
241static unsigned long spufs_mem_mmap_nopfn(struct vm_area_struct *vma, 241static int
242 unsigned long address) 242spufs_mem_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
243{ 243{
244 struct spu_context *ctx = vma->vm_file->private_data; 244 struct spu_context *ctx = vma->vm_file->private_data;
245 unsigned long pfn, offset, addr0 = address; 245 unsigned long address = (unsigned long)vmf->virtual_address;
246 unsigned long pfn, offset;
247
246#ifdef CONFIG_SPU_FS_64K_LS 248#ifdef CONFIG_SPU_FS_64K_LS
247 struct spu_state *csa = &ctx->csa; 249 struct spu_state *csa = &ctx->csa;
248 int psize; 250 int psize;
@@ -260,15 +262,15 @@ static unsigned long spufs_mem_mmap_nopfn(struct vm_area_struct *vma,
260 } 262 }
261#endif /* CONFIG_SPU_FS_64K_LS */ 263#endif /* CONFIG_SPU_FS_64K_LS */
262 264
263 offset = (address - vma->vm_start) + (vma->vm_pgoff << PAGE_SHIFT); 265 offset = vmf->pgoff << PAGE_SHIFT;
264 if (offset >= LS_SIZE) 266 if (offset >= LS_SIZE)
265 return NOPFN_SIGBUS; 267 return VM_FAULT_SIGBUS;
266 268
267 pr_debug("spufs_mem_mmap_nopfn address=0x%lx -> 0x%lx, offset=0x%lx\n", 269 pr_debug("spufs_mem_mmap_fault address=0x%lx, offset=0x%lx\n",
268 addr0, address, offset); 270 address, offset);
269 271
270 if (spu_acquire(ctx)) 272 if (spu_acquire(ctx))
271 return NOPFN_REFAULT; 273 return VM_FAULT_NOPAGE;
272 274
273 if (ctx->state == SPU_STATE_SAVED) { 275 if (ctx->state == SPU_STATE_SAVED) {
274 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot) 276 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
@@ -283,12 +285,12 @@ static unsigned long spufs_mem_mmap_nopfn(struct vm_area_struct *vma,
283 285
284 spu_release(ctx); 286 spu_release(ctx);
285 287
286 return NOPFN_REFAULT; 288 return VM_FAULT_NOPAGE;
287} 289}
288 290
289 291
290static struct vm_operations_struct spufs_mem_mmap_vmops = { 292static struct vm_operations_struct spufs_mem_mmap_vmops = {
291 .nopfn = spufs_mem_mmap_nopfn, 293 .fault = spufs_mem_mmap_fault,
292}; 294};
293 295
294static int spufs_mem_mmap(struct file *file, struct vm_area_struct *vma) 296static int spufs_mem_mmap(struct file *file, struct vm_area_struct *vma)
@@ -351,20 +353,19 @@ static const struct file_operations spufs_mem_fops = {
351#endif 353#endif
352}; 354};
353 355
354static unsigned long spufs_ps_nopfn(struct vm_area_struct *vma, 356static int spufs_ps_fault(struct vm_area_struct *vma,
355 unsigned long address, 357 struct vm_fault *vmf,
356 unsigned long ps_offs, 358 unsigned long ps_offs,
357 unsigned long ps_size) 359 unsigned long ps_size)
358{ 360{
359 struct spu_context *ctx = vma->vm_file->private_data; 361 struct spu_context *ctx = vma->vm_file->private_data;
360 unsigned long area, offset = address - vma->vm_start; 362 unsigned long area, offset = vmf->pgoff << PAGE_SHIFT;
361 int ret = 0; 363 int ret = 0;
362 364
363 spu_context_nospu_trace(spufs_ps_nopfn__enter, ctx); 365 spu_context_nospu_trace(spufs_ps_fault__enter, ctx);
364 366
365 offset += vma->vm_pgoff << PAGE_SHIFT;
366 if (offset >= ps_size) 367 if (offset >= ps_size)
367 return NOPFN_SIGBUS; 368 return VM_FAULT_SIGBUS;
368 369
369 /* 370 /*
370 * Because we release the mmap_sem, the context may be destroyed while 371 * Because we release the mmap_sem, the context may be destroyed while
@@ -378,7 +379,7 @@ static unsigned long spufs_ps_nopfn(struct vm_area_struct *vma,
378 * pages to hand out to the user, but we don't want to wait 379 * pages to hand out to the user, but we don't want to wait
379 * with the mmap_sem held. 380 * with the mmap_sem held.
380 * It is possible to drop the mmap_sem here, but then we need 381 * It is possible to drop the mmap_sem here, but then we need
381 * to return NOPFN_REFAULT because the mappings may have 382 * to return VM_FAULT_NOPAGE because the mappings may have
382 * hanged. 383 * hanged.
383 */ 384 */
384 if (spu_acquire(ctx)) 385 if (spu_acquire(ctx))
@@ -386,14 +387,15 @@ static unsigned long spufs_ps_nopfn(struct vm_area_struct *vma,
386 387
387 if (ctx->state == SPU_STATE_SAVED) { 388 if (ctx->state == SPU_STATE_SAVED) {
388 up_read(&current->mm->mmap_sem); 389 up_read(&current->mm->mmap_sem);
389 spu_context_nospu_trace(spufs_ps_nopfn__sleep, ctx); 390 spu_context_nospu_trace(spufs_ps_fault__sleep, ctx);
390 ret = spufs_wait(ctx->run_wq, ctx->state == SPU_STATE_RUNNABLE); 391 ret = spufs_wait(ctx->run_wq, ctx->state == SPU_STATE_RUNNABLE);
391 spu_context_trace(spufs_ps_nopfn__wake, ctx, ctx->spu); 392 spu_context_trace(spufs_ps_fault__wake, ctx, ctx->spu);
392 down_read(&current->mm->mmap_sem); 393 down_read(&current->mm->mmap_sem);
393 } else { 394 } else {
394 area = ctx->spu->problem_phys + ps_offs; 395 area = ctx->spu->problem_phys + ps_offs;
395 vm_insert_pfn(vma, address, (area + offset) >> PAGE_SHIFT); 396 vm_insert_pfn(vma, (unsigned long)vmf->virtual_address,
396 spu_context_trace(spufs_ps_nopfn__insert, ctx, ctx->spu); 397 (area + offset) >> PAGE_SHIFT);
398 spu_context_trace(spufs_ps_fault__insert, ctx, ctx->spu);
397 } 399 }
398 400
399 if (!ret) 401 if (!ret)
@@ -401,18 +403,18 @@ static unsigned long spufs_ps_nopfn(struct vm_area_struct *vma,
401 403
402refault: 404refault:
403 put_spu_context(ctx); 405 put_spu_context(ctx);
404 return NOPFN_REFAULT; 406 return VM_FAULT_NOPAGE;
405} 407}
406 408
407#if SPUFS_MMAP_4K 409#if SPUFS_MMAP_4K
408static unsigned long spufs_cntl_mmap_nopfn(struct vm_area_struct *vma, 410static int spufs_cntl_mmap_fault(struct vm_area_struct *vma,
409 unsigned long address) 411 struct vm_fault *vmf)
410{ 412{
411 return spufs_ps_nopfn(vma, address, 0x4000, 0x1000); 413 return spufs_ps_fault(vma, vmf, 0x4000, SPUFS_CNTL_MAP_SIZE);
412} 414}
413 415
414static struct vm_operations_struct spufs_cntl_mmap_vmops = { 416static struct vm_operations_struct spufs_cntl_mmap_vmops = {
415 .nopfn = spufs_cntl_mmap_nopfn, 417 .fault = spufs_cntl_mmap_fault,
416}; 418};
417 419
418/* 420/*
@@ -1097,23 +1099,23 @@ static ssize_t spufs_signal1_write(struct file *file, const char __user *buf,
1097 return 4; 1099 return 4;
1098} 1100}
1099 1101
1100static unsigned long spufs_signal1_mmap_nopfn(struct vm_area_struct *vma, 1102static int
1101 unsigned long address) 1103spufs_signal1_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
1102{ 1104{
1103#if PAGE_SIZE == 0x1000 1105#if SPUFS_SIGNAL_MAP_SIZE == 0x1000
1104 return spufs_ps_nopfn(vma, address, 0x14000, 0x1000); 1106 return spufs_ps_fault(vma, vmf, 0x14000, SPUFS_SIGNAL_MAP_SIZE);
1105#elif PAGE_SIZE == 0x10000 1107#elif SPUFS_SIGNAL_MAP_SIZE == 0x10000
1106 /* For 64k pages, both signal1 and signal2 can be used to mmap the whole 1108 /* For 64k pages, both signal1 and signal2 can be used to mmap the whole
1107 * signal 1 and 2 area 1109 * signal 1 and 2 area
1108 */ 1110 */
1109 return spufs_ps_nopfn(vma, address, 0x10000, 0x10000); 1111 return spufs_ps_fault(vma, vmf, 0x10000, SPUFS_SIGNAL_MAP_SIZE);
1110#else 1112#else
1111#error unsupported page size 1113#error unsupported page size
1112#endif 1114#endif
1113} 1115}
1114 1116
1115static struct vm_operations_struct spufs_signal1_mmap_vmops = { 1117static struct vm_operations_struct spufs_signal1_mmap_vmops = {
1116 .nopfn = spufs_signal1_mmap_nopfn, 1118 .fault = spufs_signal1_mmap_fault,
1117}; 1119};
1118 1120
1119static int spufs_signal1_mmap(struct file *file, struct vm_area_struct *vma) 1121static int spufs_signal1_mmap(struct file *file, struct vm_area_struct *vma)
@@ -1234,23 +1236,23 @@ static ssize_t spufs_signal2_write(struct file *file, const char __user *buf,
1234} 1236}
1235 1237
1236#if SPUFS_MMAP_4K 1238#if SPUFS_MMAP_4K
1237static unsigned long spufs_signal2_mmap_nopfn(struct vm_area_struct *vma, 1239static int
1238 unsigned long address) 1240spufs_signal2_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
1239{ 1241{
1240#if PAGE_SIZE == 0x1000 1242#if SPUFS_SIGNAL_MAP_SIZE == 0x1000
1241 return spufs_ps_nopfn(vma, address, 0x1c000, 0x1000); 1243 return spufs_ps_fault(vma, vmf, 0x1c000, SPUFS_SIGNAL_MAP_SIZE);
1242#elif PAGE_SIZE == 0x10000 1244#elif SPUFS_SIGNAL_MAP_SIZE == 0x10000
1243 /* For 64k pages, both signal1 and signal2 can be used to mmap the whole 1245 /* For 64k pages, both signal1 and signal2 can be used to mmap the whole
1244 * signal 1 and 2 area 1246 * signal 1 and 2 area
1245 */ 1247 */
1246 return spufs_ps_nopfn(vma, address, 0x10000, 0x10000); 1248 return spufs_ps_fault(vma, vmf, 0x10000, SPUFS_SIGNAL_MAP_SIZE);
1247#else 1249#else
1248#error unsupported page size 1250#error unsupported page size
1249#endif 1251#endif
1250} 1252}
1251 1253
1252static struct vm_operations_struct spufs_signal2_mmap_vmops = { 1254static struct vm_operations_struct spufs_signal2_mmap_vmops = {
1253 .nopfn = spufs_signal2_mmap_nopfn, 1255 .fault = spufs_signal2_mmap_fault,
1254}; 1256};
1255 1257
1256static int spufs_signal2_mmap(struct file *file, struct vm_area_struct *vma) 1258static int spufs_signal2_mmap(struct file *file, struct vm_area_struct *vma)
@@ -1362,14 +1364,14 @@ DEFINE_SPUFS_ATTRIBUTE(spufs_signal2_type, spufs_signal2_type_get,
1362 spufs_signal2_type_set, "%llu\n", SPU_ATTR_ACQUIRE); 1364 spufs_signal2_type_set, "%llu\n", SPU_ATTR_ACQUIRE);
1363 1365
1364#if SPUFS_MMAP_4K 1366#if SPUFS_MMAP_4K
1365static unsigned long spufs_mss_mmap_nopfn(struct vm_area_struct *vma, 1367static int
1366 unsigned long address) 1368spufs_mss_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
1367{ 1369{
1368 return spufs_ps_nopfn(vma, address, 0x0000, 0x1000); 1370 return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_MSS_MAP_SIZE);
1369} 1371}
1370 1372
1371static struct vm_operations_struct spufs_mss_mmap_vmops = { 1373static struct vm_operations_struct spufs_mss_mmap_vmops = {
1372 .nopfn = spufs_mss_mmap_nopfn, 1374 .fault = spufs_mss_mmap_fault,
1373}; 1375};
1374 1376
1375/* 1377/*
@@ -1424,14 +1426,14 @@ static const struct file_operations spufs_mss_fops = {
1424 .mmap = spufs_mss_mmap, 1426 .mmap = spufs_mss_mmap,
1425}; 1427};
1426 1428
1427static unsigned long spufs_psmap_mmap_nopfn(struct vm_area_struct *vma, 1429static int
1428 unsigned long address) 1430spufs_psmap_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
1429{ 1431{
1430 return spufs_ps_nopfn(vma, address, 0x0000, 0x20000); 1432 return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_PS_MAP_SIZE);
1431} 1433}
1432 1434
1433static struct vm_operations_struct spufs_psmap_mmap_vmops = { 1435static struct vm_operations_struct spufs_psmap_mmap_vmops = {
1434 .nopfn = spufs_psmap_mmap_nopfn, 1436 .fault = spufs_psmap_mmap_fault,
1435}; 1437};
1436 1438
1437/* 1439/*
@@ -1484,14 +1486,14 @@ static const struct file_operations spufs_psmap_fops = {
1484 1486
1485 1487
1486#if SPUFS_MMAP_4K 1488#if SPUFS_MMAP_4K
1487static unsigned long spufs_mfc_mmap_nopfn(struct vm_area_struct *vma, 1489static int
1488 unsigned long address) 1490spufs_mfc_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
1489{ 1491{
1490 return spufs_ps_nopfn(vma, address, 0x3000, 0x1000); 1492 return spufs_ps_fault(vma, vmf, 0x3000, SPUFS_MFC_MAP_SIZE);
1491} 1493}
1492 1494
1493static struct vm_operations_struct spufs_mfc_mmap_vmops = { 1495static struct vm_operations_struct spufs_mfc_mmap_vmops = {
1494 .nopfn = spufs_mfc_mmap_nopfn, 1496 .fault = spufs_mfc_mmap_fault,
1495}; 1497};
1496 1498
1497/* 1499/*
@@ -2553,22 +2555,74 @@ void spu_switch_log_notify(struct spu *spu, struct spu_context *ctx,
2553 wake_up(&ctx->switch_log->wait); 2555 wake_up(&ctx->switch_log->wait);
2554} 2556}
2555 2557
2556struct tree_descr spufs_dir_contents[] = { 2558static int spufs_show_ctx(struct seq_file *s, void *private)
2559{
2560 struct spu_context *ctx = s->private;
2561 u64 mfc_control_RW;
2562
2563 mutex_lock(&ctx->state_mutex);
2564 if (ctx->spu) {
2565 struct spu *spu = ctx->spu;
2566 struct spu_priv2 __iomem *priv2 = spu->priv2;
2567
2568 spin_lock_irq(&spu->register_lock);
2569 mfc_control_RW = in_be64(&priv2->mfc_control_RW);
2570 spin_unlock_irq(&spu->register_lock);
2571 } else {
2572 struct spu_state *csa = &ctx->csa;
2573
2574 mfc_control_RW = csa->priv2.mfc_control_RW;
2575 }
2576
2577 seq_printf(s, "%c flgs(%lx) sflgs(%lx) pri(%d) ts(%d) spu(%02d)"
2578 " %c %lx %lx %lx %lx %x %x\n",
2579 ctx->state == SPU_STATE_SAVED ? 'S' : 'R',
2580 ctx->flags,
2581 ctx->sched_flags,
2582 ctx->prio,
2583 ctx->time_slice,
2584 ctx->spu ? ctx->spu->number : -1,
2585 !list_empty(&ctx->rq) ? 'q' : ' ',
2586 ctx->csa.class_0_pending,
2587 ctx->csa.class_0_dar,
2588 ctx->csa.class_1_dsisr,
2589 mfc_control_RW,
2590 ctx->ops->runcntl_read(ctx),
2591 ctx->ops->status_read(ctx));
2592
2593 mutex_unlock(&ctx->state_mutex);
2594
2595 return 0;
2596}
2597
2598static int spufs_ctx_open(struct inode *inode, struct file *file)
2599{
2600 return single_open(file, spufs_show_ctx, SPUFS_I(inode)->i_ctx);
2601}
2602
2603static const struct file_operations spufs_ctx_fops = {
2604 .open = spufs_ctx_open,
2605 .read = seq_read,
2606 .llseek = seq_lseek,
2607 .release = single_release,
2608};
2609
2610struct spufs_tree_descr spufs_dir_contents[] = {
2557 { "capabilities", &spufs_caps_fops, 0444, }, 2611 { "capabilities", &spufs_caps_fops, 0444, },
2558 { "mem", &spufs_mem_fops, 0666, }, 2612 { "mem", &spufs_mem_fops, 0666, LS_SIZE, },
2559 { "regs", &spufs_regs_fops, 0666, }, 2613 { "regs", &spufs_regs_fops, 0666, sizeof(struct spu_reg128[128]), },
2560 { "mbox", &spufs_mbox_fops, 0444, }, 2614 { "mbox", &spufs_mbox_fops, 0444, },
2561 { "ibox", &spufs_ibox_fops, 0444, }, 2615 { "ibox", &spufs_ibox_fops, 0444, },
2562 { "wbox", &spufs_wbox_fops, 0222, }, 2616 { "wbox", &spufs_wbox_fops, 0222, },
2563 { "mbox_stat", &spufs_mbox_stat_fops, 0444, }, 2617 { "mbox_stat", &spufs_mbox_stat_fops, 0444, sizeof(u32), },
2564 { "ibox_stat", &spufs_ibox_stat_fops, 0444, }, 2618 { "ibox_stat", &spufs_ibox_stat_fops, 0444, sizeof(u32), },
2565 { "wbox_stat", &spufs_wbox_stat_fops, 0444, }, 2619 { "wbox_stat", &spufs_wbox_stat_fops, 0444, sizeof(u32), },
2566 { "signal1", &spufs_signal1_fops, 0666, }, 2620 { "signal1", &spufs_signal1_fops, 0666, },
2567 { "signal2", &spufs_signal2_fops, 0666, }, 2621 { "signal2", &spufs_signal2_fops, 0666, },
2568 { "signal1_type", &spufs_signal1_type, 0666, }, 2622 { "signal1_type", &spufs_signal1_type, 0666, },
2569 { "signal2_type", &spufs_signal2_type, 0666, }, 2623 { "signal2_type", &spufs_signal2_type, 0666, },
2570 { "cntl", &spufs_cntl_fops, 0666, }, 2624 { "cntl", &spufs_cntl_fops, 0666, },
2571 { "fpcr", &spufs_fpcr_fops, 0666, }, 2625 { "fpcr", &spufs_fpcr_fops, 0666, sizeof(struct spu_reg128), },
2572 { "lslr", &spufs_lslr_ops, 0444, }, 2626 { "lslr", &spufs_lslr_ops, 0444, },
2573 { "mfc", &spufs_mfc_fops, 0666, }, 2627 { "mfc", &spufs_mfc_fops, 0666, },
2574 { "mss", &spufs_mss_fops, 0666, }, 2628 { "mss", &spufs_mss_fops, 0666, },
@@ -2578,29 +2632,31 @@ struct tree_descr spufs_dir_contents[] = {
2578 { "decr_status", &spufs_decr_status_ops, 0666, }, 2632 { "decr_status", &spufs_decr_status_ops, 0666, },
2579 { "event_mask", &spufs_event_mask_ops, 0666, }, 2633 { "event_mask", &spufs_event_mask_ops, 0666, },
2580 { "event_status", &spufs_event_status_ops, 0444, }, 2634 { "event_status", &spufs_event_status_ops, 0444, },
2581 { "psmap", &spufs_psmap_fops, 0666, }, 2635 { "psmap", &spufs_psmap_fops, 0666, SPUFS_PS_MAP_SIZE, },
2582 { "phys-id", &spufs_id_ops, 0666, }, 2636 { "phys-id", &spufs_id_ops, 0666, },
2583 { "object-id", &spufs_object_id_ops, 0666, }, 2637 { "object-id", &spufs_object_id_ops, 0666, },
2584 { "mbox_info", &spufs_mbox_info_fops, 0444, }, 2638 { "mbox_info", &spufs_mbox_info_fops, 0444, sizeof(u32), },
2585 { "ibox_info", &spufs_ibox_info_fops, 0444, }, 2639 { "ibox_info", &spufs_ibox_info_fops, 0444, sizeof(u32), },
2586 { "wbox_info", &spufs_wbox_info_fops, 0444, }, 2640 { "wbox_info", &spufs_wbox_info_fops, 0444, sizeof(u32), },
2587 { "dma_info", &spufs_dma_info_fops, 0444, }, 2641 { "dma_info", &spufs_dma_info_fops, 0444,
2588 { "proxydma_info", &spufs_proxydma_info_fops, 0444, }, 2642 sizeof(struct spu_dma_info), },
2643 { "proxydma_info", &spufs_proxydma_info_fops, 0444,
2644 sizeof(struct spu_proxydma_info)},
2589 { "tid", &spufs_tid_fops, 0444, }, 2645 { "tid", &spufs_tid_fops, 0444, },
2590 { "stat", &spufs_stat_fops, 0444, }, 2646 { "stat", &spufs_stat_fops, 0444, },
2591 { "switch_log", &spufs_switch_log_fops, 0444 }, 2647 { "switch_log", &spufs_switch_log_fops, 0444 },
2592 {}, 2648 {},
2593}; 2649};
2594 2650
2595struct tree_descr spufs_dir_nosched_contents[] = { 2651struct spufs_tree_descr spufs_dir_nosched_contents[] = {
2596 { "capabilities", &spufs_caps_fops, 0444, }, 2652 { "capabilities", &spufs_caps_fops, 0444, },
2597 { "mem", &spufs_mem_fops, 0666, }, 2653 { "mem", &spufs_mem_fops, 0666, LS_SIZE, },
2598 { "mbox", &spufs_mbox_fops, 0444, }, 2654 { "mbox", &spufs_mbox_fops, 0444, },
2599 { "ibox", &spufs_ibox_fops, 0444, }, 2655 { "ibox", &spufs_ibox_fops, 0444, },
2600 { "wbox", &spufs_wbox_fops, 0222, }, 2656 { "wbox", &spufs_wbox_fops, 0222, },
2601 { "mbox_stat", &spufs_mbox_stat_fops, 0444, }, 2657 { "mbox_stat", &spufs_mbox_stat_fops, 0444, sizeof(u32), },
2602 { "ibox_stat", &spufs_ibox_stat_fops, 0444, }, 2658 { "ibox_stat", &spufs_ibox_stat_fops, 0444, sizeof(u32), },
2603 { "wbox_stat", &spufs_wbox_stat_fops, 0444, }, 2659 { "wbox_stat", &spufs_wbox_stat_fops, 0444, sizeof(u32), },
2604 { "signal1", &spufs_signal1_nosched_fops, 0222, }, 2660 { "signal1", &spufs_signal1_nosched_fops, 0222, },
2605 { "signal2", &spufs_signal2_nosched_fops, 0222, }, 2661 { "signal2", &spufs_signal2_nosched_fops, 0222, },
2606 { "signal1_type", &spufs_signal1_type, 0666, }, 2662 { "signal1_type", &spufs_signal1_type, 0666, },
@@ -2609,7 +2665,7 @@ struct tree_descr spufs_dir_nosched_contents[] = {
2609 { "mfc", &spufs_mfc_fops, 0666, }, 2665 { "mfc", &spufs_mfc_fops, 0666, },
2610 { "cntl", &spufs_cntl_fops, 0666, }, 2666 { "cntl", &spufs_cntl_fops, 0666, },
2611 { "npc", &spufs_npc_ops, 0666, }, 2667 { "npc", &spufs_npc_ops, 0666, },
2612 { "psmap", &spufs_psmap_fops, 0666, }, 2668 { "psmap", &spufs_psmap_fops, 0666, SPUFS_PS_MAP_SIZE, },
2613 { "phys-id", &spufs_id_ops, 0666, }, 2669 { "phys-id", &spufs_id_ops, 0666, },
2614 { "object-id", &spufs_object_id_ops, 0666, }, 2670 { "object-id", &spufs_object_id_ops, 0666, },
2615 { "tid", &spufs_tid_fops, 0444, }, 2671 { "tid", &spufs_tid_fops, 0444, },
@@ -2617,6 +2673,11 @@ struct tree_descr spufs_dir_nosched_contents[] = {
2617 {}, 2673 {},
2618}; 2674};
2619 2675
2676struct spufs_tree_descr spufs_dir_debug_contents[] = {
2677 { ".ctx", &spufs_ctx_fops, 0444, },
2678 {},
2679};
2680
2620struct spufs_coredump_reader spufs_coredump_read[] = { 2681struct spufs_coredump_reader spufs_coredump_read[] = {
2621 { "regs", __spufs_regs_read, NULL, sizeof(struct spu_reg128[128])}, 2682 { "regs", __spufs_regs_read, NULL, sizeof(struct spu_reg128[128])},
2622 { "fpcr", __spufs_fpcr_read, NULL, sizeof(struct spu_reg128) }, 2683 { "fpcr", __spufs_fpcr_read, NULL, sizeof(struct spu_reg128) },