aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index f74259979cb6..fc595d0db21d 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -2555,6 +2555,58 @@ void spu_switch_log_notify(struct spu *spu, struct spu_context *ctx,
2555 wake_up(&ctx->switch_log->wait); 2555 wake_up(&ctx->switch_log->wait);
2556} 2556}
2557 2557
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
2558struct tree_descr spufs_dir_contents[] = { 2610struct tree_descr spufs_dir_contents[] = {
2559 { "capabilities", &spufs_caps_fops, 0444, }, 2611 { "capabilities", &spufs_caps_fops, 0444, },
2560 { "mem", &spufs_mem_fops, 0666, }, 2612 { "mem", &spufs_mem_fops, 0666, },
@@ -2591,6 +2643,7 @@ struct tree_descr spufs_dir_contents[] = {
2591 { "tid", &spufs_tid_fops, 0444, }, 2643 { "tid", &spufs_tid_fops, 0444, },
2592 { "stat", &spufs_stat_fops, 0444, }, 2644 { "stat", &spufs_stat_fops, 0444, },
2593 { "switch_log", &spufs_switch_log_fops, 0444 }, 2645 { "switch_log", &spufs_switch_log_fops, 0444 },
2646 { ".ctx", &spufs_ctx_fops, 0444, },
2594 {}, 2647 {},
2595}; 2648};
2596 2649
@@ -2616,6 +2669,7 @@ struct tree_descr spufs_dir_nosched_contents[] = {
2616 { "object-id", &spufs_object_id_ops, 0666, }, 2669 { "object-id", &spufs_object_id_ops, 0666, },
2617 { "tid", &spufs_tid_fops, 0444, }, 2670 { "tid", &spufs_tid_fops, 0444, },
2618 { "stat", &spufs_stat_fops, 0444, }, 2671 { "stat", &spufs_stat_fops, 0444, },
2672 { ".ctx", &spufs_ctx_fops, 0444, },
2619 {}, 2673 {},
2620}; 2674};
2621 2675