aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/spufs
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-09-19 00:38:12 -0400
committerPaul Mackerras <paulus@samba.org>2007-09-19 01:12:19 -0400
commit48cad41f7ee7b8a9a8317a4abbdaf09bc68b4773 (patch)
tree9e31facfe272abed3aa34be36c7e5a70b7da095a /arch/powerpc/platforms/cell/spufs
parent78810ff6723f20015373b1ba8dd981f24c62f680 (diff)
[POWERPC] spufs: Combine spufs_coredump_calls with spufs_calls
Because spufs might be built as a module, we can't have other parts of the kernel calling directly into it, we need stub routines that check first if the module is loaded. Currently we have two structures which hold callbacks for these stubs, the syscalls are in spufs_calls and the coredump calls are in spufs_coredump_calls. In both cases the logic for registering/unregistering is essentially the same, so we can simplify things by combining the two. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs')
-rw-r--r--arch/powerpc/platforms/cell/spufs/coredump.c10
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c6
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h4
-rw-r--r--arch/powerpc/platforms/cell/spufs/syscalls.c2
4 files changed, 8 insertions, 14 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index fc988fd1ffb..6c20e44dba6 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -122,7 +122,7 @@ static struct spu_context *coredump_next_context(int *fd)
122 return ctx; 122 return ctx;
123} 123}
124 124
125static int spufs_arch_notes_size(void) 125int spufs_coredump_extra_notes_size(void)
126{ 126{
127 struct spu_context *ctx; 127 struct spu_context *ctx;
128 int size = 0, rc, fd; 128 int size = 0, rc, fd;
@@ -185,7 +185,7 @@ out:
185 free_page((unsigned long)buf); 185 free_page((unsigned long)buf);
186} 186}
187 187
188static void spufs_arch_write_notes(struct file *file) 188void spufs_coredump_extra_notes_write(struct file *file)
189{ 189{
190 struct spu_context *ctx; 190 struct spu_context *ctx;
191 int fd, j; 191 int fd, j;
@@ -200,9 +200,3 @@ static void spufs_arch_write_notes(struct file *file)
200 spu_release_saved(ctx); 200 spu_release_saved(ctx);
201 } 201 }
202} 202}
203
204struct spu_coredump_calls spufs_coredump_calls = {
205 .arch_notes_size = spufs_arch_notes_size,
206 .arch_write_notes = spufs_arch_write_notes,
207 .owner = THIS_MODULE,
208};
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index e210a4b259f..11098747d09 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -790,16 +790,11 @@ static int __init spufs_init(void)
790 ret = register_spu_syscalls(&spufs_calls); 790 ret = register_spu_syscalls(&spufs_calls);
791 if (ret) 791 if (ret)
792 goto out_fs; 792 goto out_fs;
793 ret = register_arch_coredump_calls(&spufs_coredump_calls);
794 if (ret)
795 goto out_syscalls;
796 793
797 spufs_init_isolated_loader(); 794 spufs_init_isolated_loader();
798 795
799 return 0; 796 return 0;
800 797
801out_syscalls:
802 unregister_spu_syscalls(&spufs_calls);
803out_fs: 798out_fs:
804 unregister_filesystem(&spufs_type); 799 unregister_filesystem(&spufs_type);
805out_sched: 800out_sched:
@@ -815,7 +810,6 @@ static void __exit spufs_exit(void)
815{ 810{
816 spu_sched_exit(); 811 spu_sched_exit();
817 spufs_exit_isolated_loader(); 812 spufs_exit_isolated_loader();
818 unregister_arch_coredump_calls(&spufs_coredump_calls);
819 unregister_spu_syscalls(&spufs_calls); 813 unregister_spu_syscalls(&spufs_calls);
820 unregister_filesystem(&spufs_type); 814 unregister_filesystem(&spufs_type);
821 kmem_cache_destroy(spufs_inode_cache); 815 kmem_cache_destroy(spufs_inode_cache);
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index f869a4b488b..c7b4e035de4 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -204,6 +204,10 @@ extern struct spufs_calls spufs_calls;
204long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status); 204long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status);
205long spufs_create(struct nameidata *nd, unsigned int flags, 205long spufs_create(struct nameidata *nd, unsigned int flags,
206 mode_t mode, struct file *filp); 206 mode_t mode, struct file *filp);
207/* ELF coredump callbacks for writing SPU ELF notes */
208extern int spufs_coredump_extra_notes_size(void);
209extern void spufs_coredump_extra_notes_write(struct file *file);
210
207extern const struct file_operations spufs_context_fops; 211extern const struct file_operations spufs_context_fops;
208 212
209/* gang management */ 213/* gang management */
diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c
index 22b138dc335..2c34f717019 100644
--- a/arch/powerpc/platforms/cell/spufs/syscalls.c
+++ b/arch/powerpc/platforms/cell/spufs/syscalls.c
@@ -84,5 +84,7 @@ static long do_spu_create(const char __user *pathname, unsigned int flags,
84struct spufs_calls spufs_calls = { 84struct spufs_calls spufs_calls = {
85 .create_thread = do_spu_create, 85 .create_thread = do_spu_create,
86 .spu_run = do_spu_run, 86 .spu_run = do_spu_run,
87 .coredump_extra_notes_size = spufs_coredump_extra_notes_size,
88 .coredump_extra_notes_write = spufs_coredump_extra_notes_write,
87 .owner = THIS_MODULE, 89 .owner = THIS_MODULE,
88}; 90};