aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/spu.h
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2007-09-19 00:38:12 -0400
committerPaul Mackerras <paulus@samba.org>2007-09-19 01:12:16 -0400
commit98f06978ffebbec16abdea58489f217229580859 (patch)
tree4c0cad43f6bc59083e00a20c423864ac579cdf32 /include/asm-powerpc/spu.h
parent36ddbb1380f282b4280c57efdb646dd8647a789f (diff)
[POWERPC] cell: Unify spufs syscall path
At present, a built-in spufs will not use the spufs_calls callbacks, but directly call sys_spu_create. This saves us an indirect branch, but means we have duplicated functions - one for CONFIG_SPU_FS=y and one for =m. This change unifies the spufs syscall path, and provides access to the spufs_calls structure through a get/put pair. At present, the only user of the spufs_calls structure is spu_syscalls.c, but this will facilitate adding the coredump calls later. Everyone likes numbers, right? Here's a before/after comparison with CONFIG_SPU_FS=y, doing spu_create(); close(); 64k times. Before: [jk@cell ~]$ time ./spu_create performing 65536 spu_create calls real 0m24.075s user 0m0.146s sys 0m23.925s After: [jk@cell ~]$ time ./spu_create performing 65536 spu_create calls real 0m24.777s user 0m0.141s sys 0m24.631s So, we're adding around 11us per syscall, at the benefit of having only one syscall path. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/spu.h')
-rw-r--r--include/asm-powerpc/spu.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index 5bde3980bf49..383ecfdf7eb0 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -238,14 +238,14 @@ extern long spu_sys_callback(struct spu_syscall_block *s);
238 238
239/* syscalls implemented in spufs */ 239/* syscalls implemented in spufs */
240struct file; 240struct file;
241extern struct spufs_calls { 241struct spufs_calls {
242 asmlinkage long (*create_thread)(const char __user *name, 242 asmlinkage long (*create_thread)(const char __user *name,
243 unsigned int flags, mode_t mode, 243 unsigned int flags, mode_t mode,
244 struct file *neighbor); 244 struct file *neighbor);
245 asmlinkage long (*spu_run)(struct file *filp, __u32 __user *unpc, 245 asmlinkage long (*spu_run)(struct file *filp, __u32 __user *unpc,
246 __u32 __user *ustatus); 246 __u32 __user *ustatus);
247 struct module *owner; 247 struct module *owner;
248} spufs_calls; 248};
249 249
250/* coredump calls implemented in spufs */ 250/* coredump calls implemented in spufs */
251struct spu_coredump_calls { 251struct spu_coredump_calls {
@@ -274,18 +274,8 @@ struct spu_coredump_calls {
274#define SPU_CREATE_FLAG_ALL 0x003f /* mask of all valid flags */ 274#define SPU_CREATE_FLAG_ALL 0x003f /* mask of all valid flags */
275 275
276 276
277#ifdef CONFIG_SPU_FS_MODULE
278int register_spu_syscalls(struct spufs_calls *calls); 277int register_spu_syscalls(struct spufs_calls *calls);
279void unregister_spu_syscalls(struct spufs_calls *calls); 278void unregister_spu_syscalls(struct spufs_calls *calls);
280#else
281static inline int register_spu_syscalls(struct spufs_calls *calls)
282{
283 return 0;
284}
285static inline void unregister_spu_syscalls(struct spufs_calls *calls)
286{
287}
288#endif /* MODULE */
289 279
290int register_arch_coredump_calls(struct spu_coredump_calls *calls); 280int register_arch_coredump_calls(struct spu_coredump_calls *calls);
291void unregister_arch_coredump_calls(struct spu_coredump_calls *calls); 281void unregister_arch_coredump_calls(struct spu_coredump_calls *calls);