diff options
author | Arnd Bergmann <arnd@arndb.de> | 2007-07-20 15:39:47 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@klappe.arndb.de> | 2007-07-20 15:42:15 -0400 |
commit | 8e68e2f248332a9c3fd4f08258f488c209bd3e0c (patch) | |
tree | 3001a5a8ce652ffdea97b2f89569447830b9059a /arch/powerpc/platforms/cell/spufs/syscalls.c | |
parent | 3ad216cae837d90415c605e1149e6fd88f51c973 (diff) |
[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/syscalls.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/syscalls.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c index 13a383c67cae..43f0fb88abbc 100644 --- a/arch/powerpc/platforms/cell/spufs/syscalls.c +++ b/arch/powerpc/platforms/cell/spufs/syscalls.c | |||
@@ -76,8 +76,8 @@ asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus) | |||
76 | } | 76 | } |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | asmlinkage long sys_spu_create(const char __user *pathname, | 79 | asmlinkage long do_spu_create(const char __user *pathname, unsigned int flags, |
80 | unsigned int flags, mode_t mode) | 80 | mode_t mode, struct file *neighbor) |
81 | { | 81 | { |
82 | char *tmp; | 82 | char *tmp; |
83 | int ret; | 83 | int ret; |
@@ -90,7 +90,7 @@ asmlinkage long sys_spu_create(const char __user *pathname, | |||
90 | ret = path_lookup(tmp, LOOKUP_PARENT| | 90 | ret = path_lookup(tmp, LOOKUP_PARENT| |
91 | LOOKUP_OPEN|LOOKUP_CREATE, &nd); | 91 | LOOKUP_OPEN|LOOKUP_CREATE, &nd); |
92 | if (!ret) { | 92 | if (!ret) { |
93 | ret = spufs_create(&nd, flags, mode); | 93 | ret = spufs_create(&nd, flags, mode, neighbor); |
94 | path_release(&nd); | 94 | path_release(&nd); |
95 | } | 95 | } |
96 | putname(tmp); | 96 | putname(tmp); |
@@ -99,8 +99,32 @@ asmlinkage long sys_spu_create(const char __user *pathname, | |||
99 | return ret; | 99 | return ret; |
100 | } | 100 | } |
101 | 101 | ||
102 | #ifndef MODULE | ||
103 | asmlinkage long sys_spu_create(const char __user *pathname, unsigned int flags, | ||
104 | mode_t mode, int neighbor_fd) | ||
105 | { | ||
106 | int fput_needed; | ||
107 | struct file *neighbor; | ||
108 | long ret; | ||
109 | |||
110 | if (flags & SPU_CREATE_AFFINITY_SPU) { | ||
111 | ret = -EBADF; | ||
112 | neighbor = fget_light(neighbor_fd, &fput_needed); | ||
113 | if (neighbor) { | ||
114 | ret = do_spu_create(pathname, flags, mode, neighbor); | ||
115 | fput_light(neighbor, fput_needed); | ||
116 | } | ||
117 | } | ||
118 | else { | ||
119 | ret = do_spu_create(pathname, flags, mode, NULL); | ||
120 | } | ||
121 | |||
122 | return ret; | ||
123 | } | ||
124 | #endif | ||
125 | |||
102 | struct spufs_calls spufs_calls = { | 126 | struct spufs_calls spufs_calls = { |
103 | .create_thread = sys_spu_create, | 127 | .create_thread = do_spu_create, |
104 | .spu_run = do_spu_run, | 128 | .spu_run = do_spu_run, |
105 | .owner = THIS_MODULE, | 129 | .owner = THIS_MODULE, |
106 | }; | 130 | }; |