]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/cell/spu_manage.c
Merge branch 'for-2.6.28' of git://git.marvell.com/mv643xx_eth into upstream-next
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / cell / spu_manage.c
index 9979197ff4098388b7f017ab18b3eb671274de4e..4c506c1463cd28a1bc5c8e3604f0738ea36df688 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/firmware.h>
 #include <asm/prom.h>
 
+#include "spufs/spufs.h"
 #include "interrupt.h"
 
 struct device_node *spu_devnode(struct spu *spu)
@@ -91,7 +92,7 @@ static int __init spu_map_interrupts_old(struct spu *spu,
 
        tmp = of_get_property(np->parent->parent, "node-id", NULL);
        if (!tmp) {
-               printk(KERN_WARNING "%s: can't find node-id\n", __FUNCTION__);
+               printk(KERN_WARNING "%s: can't find node-id\n", __func__);
                nid = spu->node;
        } else
                nid = tmp[0];
@@ -295,7 +296,7 @@ static int __init of_enumerate_spus(int (*fn)(void *data))
                ret = fn(node);
                if (ret) {
                        printk(KERN_WARNING "%s: Error initializing %s\n",
-                               __FUNCTION__, node->name);
+                               __func__, node->name);
                        break;
                }
                n++;
@@ -326,7 +327,7 @@ static int __init of_create_spu(struct spu *spu, void *data)
                if (!legacy_map) {
                        legacy_map = 1;
                        printk(KERN_WARNING "%s: Legacy device tree found, "
-                               "trying to map old style\n", __FUNCTION__);
+                               "trying to map old style\n", __func__);
                }
                ret = spu_map_device_old(spu);
                if (ret) {
@@ -341,7 +342,7 @@ static int __init of_create_spu(struct spu *spu, void *data)
                if (!legacy_irq) {
                        legacy_irq = 1;
                        printk(KERN_WARNING "%s: Legacy device tree found, "
-                               "trying old style irq\n", __FUNCTION__);
+                               "trying old style irq\n", __func__);
                }
                ret = spu_map_interrupts_old(spu, spe);
                if (ret) {
@@ -369,6 +370,16 @@ static int of_destroy_spu(struct spu *spu)
        return 0;
 }
 
+static void enable_spu_by_master_run(struct spu_context *ctx)
+{
+       ctx->ops->master_start(ctx);
+}
+
+static void disable_spu_by_master_run(struct spu_context *ctx)
+{
+       ctx->ops->master_stop(ctx);
+}
+
 /* Hardcoded affinity idxs for qs20 */
 #define QS20_SPES_PER_BE 8
 static int qs20_reg_idxs[QS20_SPES_PER_BE] =   { 0, 2, 4, 6, 7, 5, 3, 1 };
@@ -540,5 +551,7 @@ const struct spu_management_ops spu_management_of_ops = {
        .enumerate_spus = of_enumerate_spus,
        .create_spu = of_create_spu,
        .destroy_spu = of_destroy_spu,
+       .enable_spu = enable_spu_by_master_run,
+       .disable_spu = disable_spu_by_master_run,
        .init_affinity = init_affinity,
 };