diff options
author | Arnd Bergmann <arnd@arndb.de> | 2007-07-20 21:39:47 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@klappe.arndb.de> | 2007-07-20 21:42:15 +0200 |
commit | 8e68e2f248332a9c3fd4f08258f488c209bd3e0c (patch) | |
tree | 3001a5a8ce652ffdea97b2f89569447830b9059a /arch/powerpc/platforms/cell/spufs/gang.c | |
parent | 3ad216cae837d90415c605e1149e6fd88f51c973 (diff) | |
download | op-kernel-dev-8e68e2f248332a9c3fd4f08258f488c209bd3e0c.zip op-kernel-dev-8e68e2f248332a9c3fd4f08258f488c209bd3e0c.tar.gz |
[CELL] spufs: extension of spu_create to support affinity definition
This patch adds support for additional flags at spu_create, which relate
to the establishment of affinity between contexts and contexts to memory.
A fourth, optional, parameter is supported. This parameter represent
a affinity neighbor of the context being created, and is used when defining
SPU-SPU affinity.
Affinity is represented as a doubly linked list of spu_contexts.
Signed-off-by: Andre Detsch <adetsch@br.ibm.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/gang.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/gang.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/gang.c b/arch/powerpc/platforms/cell/spufs/gang.c index 212ea78..0a752ce 100644 --- a/arch/powerpc/platforms/cell/spufs/gang.c +++ b/arch/powerpc/platforms/cell/spufs/gang.c @@ -35,7 +35,9 @@ struct spu_gang *alloc_spu_gang(void) kref_init(&gang->kref); mutex_init(&gang->mutex); + mutex_init(&gang->aff_mutex); INIT_LIST_HEAD(&gang->list); + INIT_LIST_HEAD(&gang->aff_list_head); out: return gang; @@ -73,6 +75,8 @@ void spu_gang_remove_ctx(struct spu_gang *gang, struct spu_context *ctx) { mutex_lock(&gang->mutex); WARN_ON(ctx->gang != gang); + if (!list_empty(&ctx->aff_list)) + list_del_init(&ctx->aff_list); list_del_init(&ctx->gang_list); gang->contexts--; mutex_unlock(&gang->mutex); |