diff options
author | arnd@arndb.de <arnd@arndb.de> | 2006-10-24 12:31:18 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-10-25 00:20:21 -0400 |
commit | 0afacde3df4c9980f505d9afd7cb0058389732ca (patch) | |
tree | 0007cbb88b2ed7ba604fd11ca269f24617d2bb61 /arch/powerpc/platforms/cell/spufs/run.c | |
parent | eb758ce5b0d84e13cb643b6cc7cb429f6fa28258 (diff) |
[POWERPC] spufs: allow isolated mode apps by starting the SPE loader
This patch adds general support for isolated mode SPE apps.
Isolated apps are started indirectly, by a dedicated loader "kernel".
This patch starts the loader when spe_create is invoked with the
ISOLATE flag. We do this at spe_create time to allow libspe to pass the
isolated app in before calling spe_run.
The loader is read from the device tree, at the location
"/spu-isolation/loader". If the loader is not present, an attempt to
start an isolated SPE binary will fail with -ENODEV.
Update: loader needs to be correctly aligned - copy to a kmalloced buf.
Update: remove workaround for systemsim/spurom 'L-bit' bug, which has
been fixed.
Update: don't write to runcntl on spu_run_init: SPU is already running.
Update: do spu_setup_isolated earlier
Tested on systemsim.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/run.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/run.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c index 0c03a04b6a30..a4a0080c2233 100644 --- a/arch/powerpc/platforms/cell/spufs/run.c +++ b/arch/powerpc/platforms/cell/spufs/run.c | |||
@@ -1,3 +1,5 @@ | |||
1 | #define DEBUG | ||
2 | |||
1 | #include <linux/wait.h> | 3 | #include <linux/wait.h> |
2 | #include <linux/ptrace.h> | 4 | #include <linux/ptrace.h> |
3 | 5 | ||
@@ -56,12 +58,12 @@ static inline int spu_run_init(struct spu_context *ctx, u32 * npc) | |||
56 | if ((ret = spu_acquire_runnable(ctx)) != 0) | 58 | if ((ret = spu_acquire_runnable(ctx)) != 0) |
57 | return ret; | 59 | return ret; |
58 | 60 | ||
59 | if (ctx->flags & SPU_CREATE_ISOLATE) | 61 | /* if we're in isolated mode, we would have started the SPU |
60 | runcntl |= SPU_RUNCNTL_ISOLATE; | 62 | * earlier, so don't do it again now. */ |
61 | else | 63 | if (!(ctx->flags & SPU_CREATE_ISOLATE)) { |
62 | ctx->ops->npc_write(ctx, *npc); | 64 | ctx->ops->npc_write(ctx, *npc); |
63 | 65 | ctx->ops->runcntl_write(ctx, runcntl); | |
64 | ctx->ops->runcntl_write(ctx, runcntl); | 66 | } |
65 | return 0; | 67 | return 0; |
66 | } | 68 | } |
67 | 69 | ||