aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 3bc00913fe18..80c02660e617 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -1328,6 +1328,22 @@ static u64 spufs_srr0_get(void *data)
1328DEFINE_SIMPLE_ATTRIBUTE(spufs_srr0_ops, spufs_srr0_get, spufs_srr0_set, 1328DEFINE_SIMPLE_ATTRIBUTE(spufs_srr0_ops, spufs_srr0_get, spufs_srr0_set,
1329 "%llx\n") 1329 "%llx\n")
1330 1330
1331static u64 spufs_id_get(void *data)
1332{
1333 struct spu_context *ctx = data;
1334 u64 num;
1335
1336 spu_acquire(ctx);
1337 if (ctx->state == SPU_STATE_RUNNABLE)
1338 num = ctx->spu->number;
1339 else
1340 num = (unsigned int)-1;
1341 spu_release(ctx);
1342
1343 return num;
1344}
1345DEFINE_SIMPLE_ATTRIBUTE(spufs_id_ops, spufs_id_get, 0, "0x%llx\n")
1346
1331struct tree_descr spufs_dir_contents[] = { 1347struct tree_descr spufs_dir_contents[] = {
1332 { "mem", &spufs_mem_fops, 0666, }, 1348 { "mem", &spufs_mem_fops, 0666, },
1333 { "regs", &spufs_regs_fops, 0666, }, 1349 { "regs", &spufs_regs_fops, 0666, },
@@ -1351,5 +1367,6 @@ struct tree_descr spufs_dir_contents[] = {
1351 { "spu_tag_mask", &spufs_spu_tag_mask_ops, 0666, }, 1367 { "spu_tag_mask", &spufs_spu_tag_mask_ops, 0666, },
1352 { "event_mask", &spufs_event_mask_ops, 0666, }, 1368 { "event_mask", &spufs_event_mask_ops, 0666, },
1353 { "srr0", &spufs_srr0_ops, 0666, }, 1369 { "srr0", &spufs_srr0_ops, 0666, },
1370 { "phys-id", &spufs_id_ops, 0666, },
1354 {}, 1371 {},
1355}; 1372};