aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2007-07-21 07:37:51 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-21 20:49:16 -0400
commit8b6f50ef1d5cc86b278eb42bc91630fad455fb10 (patch)
tree363762c8b3775ffd48cb469e09161cb6743fbe67 /arch
parentcfd13af6270c25e8089e9c5b59ffb55d39ae74a0 (diff)
spufs: make signal-notification files readonly for NOSCHED contexts
Reading from the signal{1,2} files requires a spu_acquire_saved, so make these files write-only for contexts created with SPU_CREATE_NOSCHED. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 7de4e919687b..c2aaec5289dc 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -941,6 +941,13 @@ static const struct file_operations spufs_signal1_nosched_fops = {
941 .mmap = spufs_signal1_mmap, 941 .mmap = spufs_signal1_mmap,
942}; 942};
943 943
944static const struct file_operations spufs_signal1_nosched_fops = {
945 .open = spufs_signal1_open,
946 .release = spufs_signal1_release,
947 .write = spufs_signal1_write,
948 .mmap = spufs_signal1_mmap,
949};
950
944static int spufs_signal2_open(struct inode *inode, struct file *file) 951static int spufs_signal2_open(struct inode *inode, struct file *file)
945{ 952{
946 struct spufs_inode_info *i = SPUFS_I(inode); 953 struct spufs_inode_info *i = SPUFS_I(inode);
@@ -1076,6 +1083,13 @@ static const struct file_operations spufs_signal2_nosched_fops = {
1076 .mmap = spufs_signal2_mmap, 1083 .mmap = spufs_signal2_mmap,
1077}; 1084};
1078 1085
1086static const struct file_operations spufs_signal2_nosched_fops = {
1087 .open = spufs_signal2_open,
1088 .release = spufs_signal2_release,
1089 .write = spufs_signal2_write,
1090 .mmap = spufs_signal2_mmap,
1091};
1092
1079static void spufs_signal1_type_set(void *data, u64 val) 1093static void spufs_signal1_type_set(void *data, u64 val)
1080{ 1094{
1081 struct spu_context *ctx = data; 1095 struct spu_context *ctx = data;
@@ -2177,8 +2191,8 @@ struct tree_descr spufs_dir_contents[] = {
2177 { "mbox_stat", &spufs_mbox_stat_fops, 0444, }, 2191 { "mbox_stat", &spufs_mbox_stat_fops, 0444, },
2178 { "ibox_stat", &spufs_ibox_stat_fops, 0444, }, 2192 { "ibox_stat", &spufs_ibox_stat_fops, 0444, },
2179 { "wbox_stat", &spufs_wbox_stat_fops, 0444, }, 2193 { "wbox_stat", &spufs_wbox_stat_fops, 0444, },
2180 { "signal1", &spufs_signal1_fops, 0666, }, 2194 { "signal1", &spufs_signal1_nosched_fops, 0222, },
2181 { "signal2", &spufs_signal2_fops, 0666, }, 2195 { "signal2", &spufs_signal2_nosched_fops, 0222, },
2182 { "signal1_type", &spufs_signal1_type, 0666, }, 2196 { "signal1_type", &spufs_signal1_type, 0666, },
2183 { "signal2_type", &spufs_signal2_type, 0666, }, 2197 { "signal2_type", &spufs_signal2_type, 0666, },
2184 { "cntl", &spufs_cntl_fops, 0666, }, 2198 { "cntl", &spufs_cntl_fops, 0666, },