dfa649c9b95662ea2605ca18dc94207dc5e5e493
[linux-2.6.git] / arch / powerpc / platforms / cell / spufs / file.c
1 /*
2  * SPU file system -- file contents
3  *
4  * (C) Copyright IBM Deutschland Entwicklung GmbH 2005
5  *
6  * Author: Arnd Bergmann <arndb@de.ibm.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */
22
23 #include <linux/fs.h>
24 #include <linux/ioctl.h>
25 #include <linux/module.h>
26 #include <linux/pagemap.h>
27 #include <linux/poll.h>
28 #include <linux/ptrace.h>
29
30 #include <asm/io.h>
31 #include <asm/semaphore.h>
32 #include <asm/spu.h>
33 #include <asm/uaccess.h>
34
35 #include "spufs.h"
36
37
38 static int
39 spufs_mem_open(struct inode *inode, struct file *file)
40 {
41         struct spufs_inode_info *i = SPUFS_I(inode);
42         file->private_data = i->i_ctx;
43         file->f_mapping = i->i_ctx->local_store;
44         return 0;
45 }
46
47 static ssize_t
48 spufs_mem_read(struct file *file, char __user *buffer,
49                                 size_t size, loff_t *pos)
50 {
51         struct spu_context *ctx = file->private_data;
52         char *local_store;
53         int ret;
54
55         spu_acquire(ctx);
56
57         local_store = ctx->ops->get_ls(ctx);
58         ret = simple_read_from_buffer(buffer, size, pos, local_store, LS_SIZE);
59
60         spu_release(ctx);
61         return ret;
62 }
63
64 static ssize_t
65 spufs_mem_write(struct file *file, const char __user *buffer,
66                                         size_t size, loff_t *pos)
67 {
68         struct spu_context *ctx = file->private_data;
69         char *local_store;
70         int ret;
71
72         size = min_t(ssize_t, LS_SIZE - *pos, size);
73         if (size <= 0)
74                 return -EFBIG;
75         *pos += size;
76
77         spu_acquire(ctx);
78
79         local_store = ctx->ops->get_ls(ctx);
80         ret = copy_from_user(local_store + *pos - size,
81                              buffer, size) ? -EFAULT : size;
82
83         spu_release(ctx);
84         return ret;
85 }
86
87 #ifdef CONFIG_SPARSEMEM
88 static struct page *
89 spufs_mem_mmap_nopage(struct vm_area_struct *vma,
90                       unsigned long address, int *type)
91 {
92         struct page *page = NOPAGE_SIGBUS;
93
94         struct spu_context *ctx = vma->vm_file->private_data;
95         unsigned long offset = address - vma->vm_start;
96         offset += vma->vm_pgoff << PAGE_SHIFT;
97
98         spu_acquire(ctx);
99
100         if (ctx->state == SPU_STATE_SAVED)
101                 page = vmalloc_to_page(ctx->csa.lscsa->ls + offset);
102         else
103                 page = pfn_to_page((ctx->spu->local_store_phys + offset)
104                                    >> PAGE_SHIFT);
105
106         spu_release(ctx);
107
108         if (type)
109                 *type = VM_FAULT_MINOR;
110
111         page_cache_get(page);
112         return page;
113 }
114
115 static struct vm_operations_struct spufs_mem_mmap_vmops = {
116         .nopage = spufs_mem_mmap_nopage,
117 };
118
119 static int
120 spufs_mem_mmap(struct file *file, struct vm_area_struct *vma)
121 {
122         if (!(vma->vm_flags & VM_SHARED))
123                 return -EINVAL;
124
125         /* FIXME: */
126         vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
127                                      | _PAGE_NO_CACHE);
128
129         vma->vm_ops = &spufs_mem_mmap_vmops;
130         return 0;
131 }
132 #endif
133
134 static struct file_operations spufs_mem_fops = {
135         .open    = spufs_mem_open,
136         .read    = spufs_mem_read,
137         .write   = spufs_mem_write,
138         .llseek  = generic_file_llseek,
139 #ifdef CONFIG_SPARSEMEM
140         .mmap    = spufs_mem_mmap,
141 #endif
142 };
143
144 static int
145 spufs_regs_open(struct inode *inode, struct file *file)
146 {
147         struct spufs_inode_info *i = SPUFS_I(inode);
148         file->private_data = i->i_ctx;
149         return 0;
150 }
151
152 static ssize_t
153 spufs_regs_read(struct file *file, char __user *buffer,
154                 size_t size, loff_t *pos)
155 {
156         struct spu_context *ctx = file->private_data;
157         struct spu_lscsa *lscsa = ctx->csa.lscsa;
158         int ret;
159
160         spu_acquire_saved(ctx);
161
162         ret = simple_read_from_buffer(buffer, size, pos,
163                                       lscsa->gprs, sizeof lscsa->gprs);
164
165         spu_release(ctx);
166         return ret;
167 }
168
169 static ssize_t
170 spufs_regs_write(struct file *file, const char __user *buffer,
171                  size_t size, loff_t *pos)
172 {
173         struct spu_context *ctx = file->private_data;
174         struct spu_lscsa *lscsa = ctx->csa.lscsa;
175         int ret;
176
177         size = min_t(ssize_t, sizeof lscsa->gprs - *pos, size);
178         if (size <= 0)
179                 return -EFBIG;
180         *pos += size;
181
182         spu_acquire_saved(ctx);
183
184         ret = copy_from_user(lscsa->gprs + *pos - size,
185                              buffer, size) ? -EFAULT : size;
186
187         spu_release(ctx);
188         return ret;
189 }
190
191 static struct file_operations spufs_regs_fops = {
192         .open    = spufs_regs_open,
193         .read    = spufs_regs_read,
194         .write   = spufs_regs_write,
195         .llseek  = generic_file_llseek,
196 };
197
198 static ssize_t
199 spufs_fpcr_read(struct file *file, char __user * buffer,
200                 size_t size, loff_t * pos)
201 {
202         struct spu_context *ctx = file->private_data;
203         struct spu_lscsa *lscsa = ctx->csa.lscsa;
204         int ret;
205
206         spu_acquire_saved(ctx);
207
208         ret = simple_read_from_buffer(buffer, size, pos,
209                                       &lscsa->fpcr, sizeof(lscsa->fpcr));
210
211         spu_release(ctx);
212         return ret;
213 }
214
215 static ssize_t
216 spufs_fpcr_write(struct file *file, const char __user * buffer,
217                  size_t size, loff_t * pos)
218 {
219         struct spu_context *ctx = file->private_data;
220         struct spu_lscsa *lscsa = ctx->csa.lscsa;
221         int ret;
222
223         size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size);
224         if (size <= 0)
225                 return -EFBIG;
226         *pos += size;
227
228         spu_acquire_saved(ctx);
229
230         ret = copy_from_user((char *)&lscsa->fpcr + *pos - size,
231                              buffer, size) ? -EFAULT : size;
232
233         spu_release(ctx);
234         return ret;
235 }
236
237 static struct file_operations spufs_fpcr_fops = {
238         .open = spufs_regs_open,
239         .read = spufs_fpcr_read,
240         .write = spufs_fpcr_write,
241         .llseek = generic_file_llseek,
242 };
243
244 /* generic open function for all pipe-like files */
245 static int spufs_pipe_open(struct inode *inode, struct file *file)
246 {
247         struct spufs_inode_info *i = SPUFS_I(inode);
248         file->private_data = i->i_ctx;
249
250         return nonseekable_open(inode, file);
251 }
252
253 static ssize_t spufs_mbox_read(struct file *file, char __user *buf,
254                         size_t len, loff_t *pos)
255 {
256         struct spu_context *ctx = file->private_data;
257         u32 mbox_data;
258         int ret;
259
260         if (len < 4)
261                 return -EINVAL;
262
263         spu_acquire(ctx);
264         ret = ctx->ops->mbox_read(ctx, &mbox_data);
265         spu_release(ctx);
266
267         if (!ret)
268                 return -EAGAIN;
269
270         if (copy_to_user(buf, &mbox_data, sizeof mbox_data))
271                 return -EFAULT;
272
273         return 4;
274 }
275
276 static struct file_operations spufs_mbox_fops = {
277         .open   = spufs_pipe_open,
278         .read   = spufs_mbox_read,
279 };
280
281 static ssize_t spufs_mbox_stat_read(struct file *file, char __user *buf,
282                         size_t len, loff_t *pos)
283 {
284         struct spu_context *ctx = file->private_data;
285         u32 mbox_stat;
286
287         if (len < 4)
288                 return -EINVAL;
289
290         spu_acquire(ctx);
291
292         mbox_stat = ctx->ops->mbox_stat_read(ctx) & 0xff;
293
294         spu_release(ctx);
295
296         if (copy_to_user(buf, &mbox_stat, sizeof mbox_stat))
297                 return -EFAULT;
298
299         return 4;
300 }
301
302 static struct file_operations spufs_mbox_stat_fops = {
303         .open   = spufs_pipe_open,
304         .read   = spufs_mbox_stat_read,
305 };
306
307 /* low-level ibox access function */
308 size_t spu_ibox_read(struct spu_context *ctx, u32 *data)
309 {
310         return ctx->ops->ibox_read(ctx, data);
311 }
312
313 static int spufs_ibox_fasync(int fd, struct file *file, int on)
314 {
315         struct spu_context *ctx = file->private_data;
316
317         return fasync_helper(fd, file, on, &ctx->ibox_fasync);
318 }
319
320 /* interrupt-level ibox callback function. */
321 void spufs_ibox_callback(struct spu *spu)
322 {
323         struct spu_context *ctx = spu->ctx;
324
325         wake_up_all(&ctx->ibox_wq);
326         kill_fasync(&ctx->ibox_fasync, SIGIO, POLLIN);
327 }
328
329 static ssize_t spufs_ibox_read(struct file *file, char __user *buf,
330                         size_t len, loff_t *pos)
331 {
332         struct spu_context *ctx = file->private_data;
333         u32 ibox_data;
334         ssize_t ret;
335
336         if (len < 4)
337                 return -EINVAL;
338
339         spu_acquire(ctx);
340
341         ret = 0;
342         if (file->f_flags & O_NONBLOCK) {
343                 if (!spu_ibox_read(ctx, &ibox_data))
344                         ret = -EAGAIN;
345         } else {
346                 ret = spufs_wait(ctx->ibox_wq, spu_ibox_read(ctx, &ibox_data));
347         }
348
349         spu_release(ctx);
350
351         if (ret)
352                 return ret;
353
354         ret = 4;
355         if (copy_to_user(buf, &ibox_data, sizeof ibox_data))
356                 ret = -EFAULT;
357
358         return ret;
359 }
360
361 static unsigned int spufs_ibox_poll(struct file *file, poll_table *wait)
362 {
363         struct spu_context *ctx = file->private_data;
364         unsigned int mask;
365
366         poll_wait(file, &ctx->ibox_wq, wait);
367
368         spu_acquire(ctx);
369         mask = ctx->ops->mbox_stat_poll(ctx, POLLIN | POLLRDNORM);
370         spu_release(ctx);
371
372         return mask;
373 }
374
375 static struct file_operations spufs_ibox_fops = {
376         .open   = spufs_pipe_open,
377         .read   = spufs_ibox_read,
378         .poll   = spufs_ibox_poll,
379         .fasync = spufs_ibox_fasync,
380 };
381
382 static ssize_t spufs_ibox_stat_read(struct file *file, char __user *buf,
383                         size_t len, loff_t *pos)
384 {
385         struct spu_context *ctx = file->private_data;
386         u32 ibox_stat;
387
388         if (len < 4)
389                 return -EINVAL;
390
391         spu_acquire(ctx);
392         ibox_stat = (ctx->ops->mbox_stat_read(ctx) >> 16) & 0xff;
393         spu_release(ctx);
394
395         if (copy_to_user(buf, &ibox_stat, sizeof ibox_stat))
396                 return -EFAULT;
397
398         return 4;
399 }
400
401 static struct file_operations spufs_ibox_stat_fops = {
402         .open   = spufs_pipe_open,
403         .read   = spufs_ibox_stat_read,
404 };
405
406 /* low-level mailbox write */
407 size_t spu_wbox_write(struct spu_context *ctx, u32 data)
408 {
409         return ctx->ops->wbox_write(ctx, data);
410 }
411
412 static int spufs_wbox_fasync(int fd, struct file *file, int on)
413 {
414         struct spu_context *ctx = file->private_data;
415         int ret;
416
417         ret = fasync_helper(fd, file, on, &ctx->wbox_fasync);
418
419         return ret;
420 }
421
422 /* interrupt-level wbox callback function. */
423 void spufs_wbox_callback(struct spu *spu)
424 {
425         struct spu_context *ctx = spu->ctx;
426
427         wake_up_all(&ctx->wbox_wq);
428         kill_fasync(&ctx->wbox_fasync, SIGIO, POLLOUT);
429 }
430
431 static ssize_t spufs_wbox_write(struct file *file, const char __user *buf,
432                         size_t len, loff_t *pos)
433 {
434         struct spu_context *ctx = file->private_data;
435         u32 wbox_data;
436         int ret;
437
438         if (len < 4)
439                 return -EINVAL;
440
441         if (copy_from_user(&wbox_data, buf, sizeof wbox_data))
442                 return -EFAULT;
443
444         spu_acquire(ctx);
445
446         ret = 0;
447         if (file->f_flags & O_NONBLOCK) {
448                 if (!spu_wbox_write(ctx, wbox_data))
449                         ret = -EAGAIN;
450         } else {
451                 ret = spufs_wait(ctx->wbox_wq, spu_wbox_write(ctx, wbox_data));
452         }
453
454         spu_release(ctx);
455
456         return ret ? ret : sizeof wbox_data;
457 }
458
459 static unsigned int spufs_wbox_poll(struct file *file, poll_table *wait)
460 {
461         struct spu_context *ctx = file->private_data;
462         unsigned int mask;
463
464         poll_wait(file, &ctx->wbox_wq, wait);
465
466         spu_acquire(ctx);
467         mask = ctx->ops->mbox_stat_poll(ctx, POLLOUT | POLLWRNORM);
468         spu_release(ctx);
469
470         return mask;
471 }
472
473 static struct file_operations spufs_wbox_fops = {
474         .open   = spufs_pipe_open,
475         .write  = spufs_wbox_write,
476         .poll   = spufs_wbox_poll,
477         .fasync = spufs_wbox_fasync,
478 };
479
480 static ssize_t spufs_wbox_stat_read(struct file *file, char __user *buf,
481                         size_t len, loff_t *pos)
482 {
483         struct spu_context *ctx = file->private_data;
484         u32 wbox_stat;
485
486         if (len < 4)
487                 return -EINVAL;
488
489         spu_acquire(ctx);
490         wbox_stat = (ctx->ops->mbox_stat_read(ctx) >> 8) & 0xff;
491         spu_release(ctx);
492
493         if (copy_to_user(buf, &wbox_stat, sizeof wbox_stat))
494                 return -EFAULT;
495
496         return 4;
497 }
498
499 static struct file_operations spufs_wbox_stat_fops = {
500         .open   = spufs_pipe_open,
501         .read   = spufs_wbox_stat_read,
502 };
503
504 static ssize_t spufs_signal1_read(struct file *file, char __user *buf,
505                         size_t len, loff_t *pos)
506 {
507         struct spu_context *ctx = file->private_data;
508         u32 data;
509
510         if (len < 4)
511                 return -EINVAL;
512
513         spu_acquire(ctx);
514         data = ctx->ops->signal1_read(ctx);
515         spu_release(ctx);
516
517         if (copy_to_user(buf, &data, 4))
518                 return -EFAULT;
519
520         return 4;
521 }
522
523 static ssize_t spufs_signal1_write(struct file *file, const char __user *buf,
524                         size_t len, loff_t *pos)
525 {
526         struct spu_context *ctx;
527         u32 data;
528
529         ctx = file->private_data;
530
531         if (len < 4)
532                 return -EINVAL;
533
534         if (copy_from_user(&data, buf, 4))
535                 return -EFAULT;
536
537         spu_acquire(ctx);
538         ctx->ops->signal1_write(ctx, data);
539         spu_release(ctx);
540
541         return 4;
542 }
543
544 static struct file_operations spufs_signal1_fops = {
545         .open = spufs_pipe_open,
546         .read = spufs_signal1_read,
547         .write = spufs_signal1_write,
548 };
549
550 static ssize_t spufs_signal2_read(struct file *file, char __user *buf,
551                         size_t len, loff_t *pos)
552 {
553         struct spu_context *ctx;
554         u32 data;
555
556         ctx = file->private_data;
557
558         if (len < 4)
559                 return -EINVAL;
560
561         spu_acquire(ctx);
562         data = ctx->ops->signal2_read(ctx);
563         spu_release(ctx);
564
565         if (copy_to_user(buf, &data, 4))
566                 return -EFAULT;
567
568         return 4;
569 }
570
571 static ssize_t spufs_signal2_write(struct file *file, const char __user *buf,
572                         size_t len, loff_t *pos)
573 {
574         struct spu_context *ctx;
575         u32 data;
576
577         ctx = file->private_data;
578
579         if (len < 4)
580                 return -EINVAL;
581
582         if (copy_from_user(&data, buf, 4))
583                 return -EFAULT;
584
585         spu_acquire(ctx);
586         ctx->ops->signal2_write(ctx, data);
587         spu_release(ctx);
588
589         return 4;
590 }
591
592 static struct file_operations spufs_signal2_fops = {
593         .open = spufs_pipe_open,
594         .read = spufs_signal2_read,
595         .write = spufs_signal2_write,
596 };
597
598 static void spufs_signal1_type_set(void *data, u64 val)
599 {
600         struct spu_context *ctx = data;
601
602         spu_acquire(ctx);
603         ctx->ops->signal1_type_set(ctx, val);
604         spu_release(ctx);
605 }
606
607 static u64 spufs_signal1_type_get(void *data)
608 {
609         struct spu_context *ctx = data;
610         u64 ret;
611
612         spu_acquire(ctx);
613         ret = ctx->ops->signal1_type_get(ctx);
614         spu_release(ctx);
615
616         return ret;
617 }
618 DEFINE_SIMPLE_ATTRIBUTE(spufs_signal1_type, spufs_signal1_type_get,
619                                         spufs_signal1_type_set, "%llu");
620
621 static void spufs_signal2_type_set(void *data, u64 val)
622 {
623         struct spu_context *ctx = data;
624
625         spu_acquire(ctx);
626         ctx->ops->signal2_type_set(ctx, val);
627         spu_release(ctx);
628 }
629
630 static u64 spufs_signal2_type_get(void *data)
631 {
632         struct spu_context *ctx = data;
633         u64 ret;
634
635         spu_acquire(ctx);
636         ret = ctx->ops->signal2_type_get(ctx);
637         spu_release(ctx);
638
639         return ret;
640 }
641 DEFINE_SIMPLE_ATTRIBUTE(spufs_signal2_type, spufs_signal2_type_get,
642                                         spufs_signal2_type_set, "%llu");
643
644 static void spufs_npc_set(void *data, u64 val)
645 {
646         struct spu_context *ctx = data;
647         spu_acquire(ctx);
648         ctx->ops->npc_write(ctx, val);
649         spu_release(ctx);
650 }
651
652 static u64 spufs_npc_get(void *data)
653 {
654         struct spu_context *ctx = data;
655         u64 ret;
656         spu_acquire(ctx);
657         ret = ctx->ops->npc_read(ctx);
658         spu_release(ctx);
659         return ret;
660 }
661 DEFINE_SIMPLE_ATTRIBUTE(spufs_npc_ops, spufs_npc_get, spufs_npc_set, "%llx\n")
662
663 static void spufs_decr_set(void *data, u64 val)
664 {
665         struct spu_context *ctx = data;
666         struct spu_lscsa *lscsa = ctx->csa.lscsa;
667         spu_acquire_saved(ctx);
668         lscsa->decr.slot[0] = (u32) val;
669         spu_release(ctx);
670 }
671
672 static u64 spufs_decr_get(void *data)
673 {
674         struct spu_context *ctx = data;
675         struct spu_lscsa *lscsa = ctx->csa.lscsa;
676         u64 ret;
677         spu_acquire_saved(ctx);
678         ret = lscsa->decr.slot[0];
679         spu_release(ctx);
680         return ret;
681 }
682 DEFINE_SIMPLE_ATTRIBUTE(spufs_decr_ops, spufs_decr_get, spufs_decr_set,
683                         "%llx\n")
684
685 static void spufs_decr_status_set(void *data, u64 val)
686 {
687         struct spu_context *ctx = data;
688         struct spu_lscsa *lscsa = ctx->csa.lscsa;
689         spu_acquire_saved(ctx);
690         lscsa->decr_status.slot[0] = (u32) val;
691         spu_release(ctx);
692 }
693
694 static u64 spufs_decr_status_get(void *data)
695 {
696         struct spu_context *ctx = data;
697         struct spu_lscsa *lscsa = ctx->csa.lscsa;
698         u64 ret;
699         spu_acquire_saved(ctx);
700         ret = lscsa->decr_status.slot[0];
701         spu_release(ctx);
702         return ret;
703 }
704 DEFINE_SIMPLE_ATTRIBUTE(spufs_decr_status_ops, spufs_decr_status_get,
705                         spufs_decr_status_set, "%llx\n")
706
707 static void spufs_spu_tag_mask_set(void *data, u64 val)
708 {
709         struct spu_context *ctx = data;
710         struct spu_lscsa *lscsa = ctx->csa.lscsa;
711         spu_acquire_saved(ctx);
712         lscsa->tag_mask.slot[0] = (u32) val;
713         spu_release(ctx);
714 }
715
716 static u64 spufs_spu_tag_mask_get(void *data)
717 {
718         struct spu_context *ctx = data;
719         struct spu_lscsa *lscsa = ctx->csa.lscsa;
720         u64 ret;
721         spu_acquire_saved(ctx);
722         ret = lscsa->tag_mask.slot[0];
723         spu_release(ctx);
724         return ret;
725 }
726 DEFINE_SIMPLE_ATTRIBUTE(spufs_spu_tag_mask_ops, spufs_spu_tag_mask_get,
727                         spufs_spu_tag_mask_set, "%llx\n")
728
729 static void spufs_event_mask_set(void *data, u64 val)
730 {
731         struct spu_context *ctx = data;
732         struct spu_lscsa *lscsa = ctx->csa.lscsa;
733         spu_acquire_saved(ctx);
734         lscsa->event_mask.slot[0] = (u32) val;
735         spu_release(ctx);
736 }
737
738 static u64 spufs_event_mask_get(void *data)
739 {
740         struct spu_context *ctx = data;
741         struct spu_lscsa *lscsa = ctx->csa.lscsa;
742         u64 ret;
743         spu_acquire_saved(ctx);
744         ret = lscsa->event_mask.slot[0];
745         spu_release(ctx);
746         return ret;
747 }
748 DEFINE_SIMPLE_ATTRIBUTE(spufs_event_mask_ops, spufs_event_mask_get,
749                         spufs_event_mask_set, "%llx\n")
750
751 static void spufs_srr0_set(void *data, u64 val)
752 {
753         struct spu_context *ctx = data;
754         struct spu_lscsa *lscsa = ctx->csa.lscsa;
755         spu_acquire_saved(ctx);
756         lscsa->srr0.slot[0] = (u32) val;
757         spu_release(ctx);
758 }
759
760 static u64 spufs_srr0_get(void *data)
761 {
762         struct spu_context *ctx = data;
763         struct spu_lscsa *lscsa = ctx->csa.lscsa;
764         u64 ret;
765         spu_acquire_saved(ctx);
766         ret = lscsa->srr0.slot[0];
767         spu_release(ctx);
768         return ret;
769 }
770 DEFINE_SIMPLE_ATTRIBUTE(spufs_srr0_ops, spufs_srr0_get, spufs_srr0_set,
771                         "%llx\n")
772
773 struct tree_descr spufs_dir_contents[] = {
774         { "mem",  &spufs_mem_fops,  0666, },
775         { "regs", &spufs_regs_fops,  0666, },
776         { "mbox", &spufs_mbox_fops, 0444, },
777         { "ibox", &spufs_ibox_fops, 0444, },
778         { "wbox", &spufs_wbox_fops, 0222, },
779         { "mbox_stat", &spufs_mbox_stat_fops, 0444, },
780         { "ibox_stat", &spufs_ibox_stat_fops, 0444, },
781         { "wbox_stat", &spufs_wbox_stat_fops, 0444, },
782         { "signal1", &spufs_signal1_fops, 0666, },
783         { "signal2", &spufs_signal2_fops, 0666, },
784         { "signal1_type", &spufs_signal1_type, 0666, },
785         { "signal2_type", &spufs_signal2_type, 0666, },
786         { "npc", &spufs_npc_ops, 0666, },
787         { "fpcr", &spufs_fpcr_fops, 0666, },
788         { "decr", &spufs_decr_ops, 0666, },
789         { "decr_status", &spufs_decr_status_ops, 0666, },
790         { "spu_tag_mask", &spufs_spu_tag_mask_ops, 0666, },
791         { "event_mask", &spufs_event_mask_ops, 0666, },
792         { "srr0", &spufs_srr0_ops, 0666, },
793         {},
794 };