aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2007-07-20 15:39:31 -0400
committerArnd Bergmann <arnd@klappe.arndb.de>2007-07-20 15:41:48 -0400
commitd054b36ffd302ec65aabec16a0c60ddd9e6b5a62 (patch)
tree8e19f833d7751f74a08cb8dd888c8f4a6e70f830 /arch/powerpc/platforms
parent49776d30aea903fb2f9966c8e9b6f23ae5f7c937 (diff)
[CELL] 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> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'arch/powerpc/platforms')
-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 c2814ea96af2..fe164112b3d0 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -934,6 +934,13 @@ static const struct file_operations spufs_signal1_fops = {
934 .mmap = spufs_signal1_mmap, 934 .mmap = spufs_signal1_mmap,
935}; 935};
936 936
937static const struct file_operations spufs_signal1_nosched_fops = {
938 .open = spufs_signal1_open,
939 .release = spufs_signal1_release,
940 .write = spufs_signal1_write,
941 .mmap = spufs_signal1_mmap,
942};
943
937static int spufs_signal2_open(struct inode *inode, struct file *file) 944static int spufs_signal2_open(struct inode *inode, struct file *file)
938{ 945{
939 struct spufs_inode_info *i = SPUFS_I(inode); 946 struct spufs_inode_info *i = SPUFS_I(inode);
@@ -1062,6 +1069,13 @@ static const struct file_operations spufs_signal2_fops = {
1062 .mmap = spufs_signal2_mmap, 1069 .mmap = spufs_signal2_mmap,
1063}; 1070};
1064 1071
1072static const struct file_operations spufs_signal2_nosched_fops = {
1073 .open = spufs_signal2_open,
1074 .release = spufs_signal2_release,
1075 .write = spufs_signal2_write,
1076 .mmap = spufs_signal2_mmap,
1077};
1078
1065static void spufs_signal1_type_set(void *data, u64 val) 1079static void spufs_signal1_type_set(void *data, u64 val)
1066{ 1080{
1067 struct spu_context *ctx = data; 1081 struct spu_context *ctx = data;
@@ -2184,8 +2198,8 @@ struct tree_descr spufs_dir_nosched_contents[] = {
2184 { "mbox_stat", &spufs_mbox_stat_fops, 0444, }, 2198 { "mbox_stat", &spufs_mbox_stat_fops, 0444, },
2185 { "ibox_stat", &spufs_ibox_stat_fops, 0444, }, 2199 { "ibox_stat", &spufs_ibox_stat_fops, 0444, },
2186 { "wbox_stat", &spufs_wbox_stat_fops, 0444, }, 2200 { "wbox_stat", &spufs_wbox_stat_fops, 0444, },
2187 { "signal1", &spufs_signal1_fops, 0666, }, 2201 { "signal1", &spufs_signal1_nosched_fops, 0222, },
2188 { "signal2", &spufs_signal2_fops, 0666, }, 2202 { "signal2", &spufs_signal2_nosched_fops, 0222, },
2189 { "signal1_type", &spufs_signal1_type, 0666, }, 2203 { "signal1_type", &spufs_signal1_type, 0666, },
2190 { "signal2_type", &spufs_signal2_type, 0666, }, 2204 { "signal2_type", &spufs_signal2_type, 0666, },
2191 { "mss", &spufs_mss_fops, 0666, }, 2205 { "mss", &spufs_mss_fops, 0666, },