Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cbe709c1683dd54a2ec2981c9e8415cb3176f4e0
Commit:     cbe709c1683dd54a2ec2981c9e8415cb3176f4e0
Parent:     05169237b55058a3993fb4804d00b65dfa3e4a0c
Author:     Benjamin Herrenschmidt <[EMAIL PROTECTED]>
AuthorDate: Mon Jun 4 15:15:38 2007 +1000
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Thu Jun 14 22:29:56 2007 +1000

    [POWERPC] spufs: Add a "capabilities" file to spu contexts
    
    This adds a "capabilities" file to spu contexts consisting of a
    list of linefeed separated capability names. The current exposed
    capabilities are "sched" (the context is scheduleable) and
    "step" (the context supports single stepping).
    
    Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
    Acked-by: Jeremy Kerr <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/cell/spufs/file.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/file.c 
b/arch/powerpc/platforms/cell/spufs/file.c
index b1e7e2f..f1cecaa 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -28,6 +28,7 @@
 #include <linux/pagemap.h>
 #include <linux/poll.h>
 #include <linux/ptrace.h>
+#include <linux/seq_file.h>
 
 #include <asm/io.h>
 #include <asm/semaphore.h>
@@ -39,6 +40,7 @@
 
 #define SPUFS_MMAP_4K (PAGE_SIZE == 0x1000)
 
+
 static int
 spufs_mem_open(struct inode *inode, struct file *file)
 {
@@ -1797,6 +1799,29 @@ static int spufs_info_open(struct inode *inode, struct 
file *file)
        return 0;
 }
 
+static int spufs_caps_show(struct seq_file *s, void *private)
+{
+       struct spu_context *ctx = s->private;
+
+       if (!(ctx->flags & SPU_CREATE_NOSCHED))
+               seq_puts(s, "sched\n");
+       if (!(ctx->flags & SPU_CREATE_ISOLATE))
+               seq_puts(s, "step\n");
+       return 0;
+}
+
+static int spufs_caps_open(struct inode *inode, struct file *file)
+{
+       return single_open(file, spufs_caps_show, SPUFS_I(inode)->i_ctx);
+}
+
+static const struct file_operations spufs_caps_fops = {
+       .open           = spufs_caps_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = single_release,
+};
+
 static ssize_t __spufs_mbox_info_read(struct spu_context *ctx,
                        char __user *buf, size_t len, loff_t *pos)
 {
@@ -2015,6 +2040,7 @@ static const struct file_operations 
spufs_proxydma_info_fops = {
 };
 
 struct tree_descr spufs_dir_contents[] = {
+       { "capabilities", &spufs_caps_fops, 0444, },
        { "mem",  &spufs_mem_fops,  0666, },
        { "regs", &spufs_regs_fops,  0666, },
        { "mbox", &spufs_mbox_fops, 0444, },
@@ -2050,6 +2076,7 @@ struct tree_descr spufs_dir_contents[] = {
 };
 
 struct tree_descr spufs_dir_nosched_contents[] = {
+       { "capabilities", &spufs_caps_fops, 0444, },
        { "mem",  &spufs_mem_fops,  0666, },
        { "mbox", &spufs_mbox_fops, 0444, },
        { "ibox", &spufs_ibox_fops, 0444, },
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to