Lines Matching refs:file

56 static int spufs_attr_open(struct inode *inode, struct file *file,  in spufs_attr_open()  argument
71 file->private_data = attr; in spufs_attr_open()
73 return nonseekable_open(inode, file); in spufs_attr_open()
76 static int spufs_attr_release(struct inode *inode, struct file *file) in spufs_attr_release() argument
78 kfree(file->private_data); in spufs_attr_release()
82 static ssize_t spufs_attr_read(struct file *file, char __user *buf, in spufs_attr_read() argument
89 attr = file->private_data; in spufs_attr_read()
115 static ssize_t spufs_attr_write(struct file *file, const char __user *buf, in spufs_attr_write() argument
123 attr = file->private_data; in spufs_attr_write()
146 static int __fops ## _open(struct inode *inode, struct file *file) \
149 return spufs_attr_open(inode, file, __get, __set, __fmt); \
161 spufs_mem_open(struct inode *inode, struct file *file) in spufs_mem_open() argument
167 file->private_data = ctx; in spufs_mem_open()
175 spufs_mem_release(struct inode *inode, struct file *file) in spufs_mem_release() argument
197 spufs_mem_read(struct file *file, char __user *buffer, in spufs_mem_read() argument
200 struct spu_context *ctx = file->private_data; in spufs_mem_read()
213 spufs_mem_write(struct file *file, const char __user *buffer, in spufs_mem_write() argument
216 struct spu_context *ctx = file->private_data; in spufs_mem_write()
311 static int spufs_mem_mmap(struct file *file, struct vm_area_struct *vma) in spufs_mem_mmap() argument
314 struct spu_context *ctx = file->private_data; in spufs_mem_mmap()
340 static unsigned long spufs_get_unmapped_area(struct file *file, in spufs_get_unmapped_area() argument
344 struct spu_context *ctx = file->private_data; in spufs_get_unmapped_area()
349 return current->mm->get_unmapped_area(file, addr, len, in spufs_get_unmapped_area()
440 static int spufs_cntl_mmap(struct file *file, struct vm_area_struct *vma) in spufs_cntl_mmap() argument
483 static int spufs_cntl_open(struct inode *inode, struct file *file) in spufs_cntl_open() argument
489 file->private_data = ctx; in spufs_cntl_open()
493 return simple_attr_open(inode, file, spufs_cntl_get, in spufs_cntl_open()
498 spufs_cntl_release(struct inode *inode, struct file *file) in spufs_cntl_release() argument
503 simple_attr_release(inode, file); in spufs_cntl_release()
522 spufs_regs_open(struct inode *inode, struct file *file) in spufs_regs_open() argument
525 file->private_data = i->i_ctx; in spufs_regs_open()
539 spufs_regs_read(struct file *file, char __user *buffer, in spufs_regs_read() argument
543 struct spu_context *ctx = file->private_data; in spufs_regs_read()
559 spufs_regs_write(struct file *file, const char __user *buffer, in spufs_regs_write() argument
562 struct spu_context *ctx = file->private_data; in spufs_regs_write()
597 spufs_fpcr_read(struct file *file, char __user * buffer, in spufs_fpcr_read() argument
601 struct spu_context *ctx = file->private_data; in spufs_fpcr_read()
612 spufs_fpcr_write(struct file *file, const char __user * buffer, in spufs_fpcr_write() argument
615 struct spu_context *ctx = file->private_data; in spufs_fpcr_write()
641 static int spufs_pipe_open(struct inode *inode, struct file *file) in spufs_pipe_open() argument
644 file->private_data = i->i_ctx; in spufs_pipe_open()
646 return nonseekable_open(inode, file); in spufs_pipe_open()
657 static ssize_t spufs_mbox_read(struct file *file, char __user *buf, in spufs_mbox_read() argument
660 struct spu_context *ctx = file->private_data; in spufs_mbox_read()
708 static ssize_t spufs_mbox_stat_read(struct file *file, char __user *buf, in spufs_mbox_stat_read() argument
711 struct spu_context *ctx = file->private_data; in spufs_mbox_stat_read()
744 static int spufs_ibox_fasync(int fd, struct file *file, int on) in spufs_ibox_fasync() argument
746 struct spu_context *ctx = file->private_data; in spufs_ibox_fasync()
748 return fasync_helper(fd, file, on, &ctx->ibox_fasync); in spufs_ibox_fasync()
775 static ssize_t spufs_ibox_read(struct file *file, char __user *buf, in spufs_ibox_read() argument
778 struct spu_context *ctx = file->private_data; in spufs_ibox_read()
796 if (file->f_flags & O_NONBLOCK) { in spufs_ibox_read()
833 static unsigned int spufs_ibox_poll(struct file *file, poll_table *wait) in spufs_ibox_poll() argument
835 struct spu_context *ctx = file->private_data; in spufs_ibox_poll()
838 poll_wait(file, &ctx->ibox_wq, wait); in spufs_ibox_poll()
859 static ssize_t spufs_ibox_stat_read(struct file *file, char __user *buf, in spufs_ibox_stat_read() argument
862 struct spu_context *ctx = file->private_data; in spufs_ibox_stat_read()
893 static int spufs_wbox_fasync(int fd, struct file *file, int on) in spufs_wbox_fasync() argument
895 struct spu_context *ctx = file->private_data; in spufs_wbox_fasync()
898 ret = fasync_helper(fd, file, on, &ctx->wbox_fasync); in spufs_wbox_fasync()
927 static ssize_t spufs_wbox_write(struct file *file, const char __user *buf, in spufs_wbox_write() argument
930 struct spu_context *ctx = file->private_data; in spufs_wbox_write()
953 if (file->f_flags & O_NONBLOCK) { in spufs_wbox_write()
983 static unsigned int spufs_wbox_poll(struct file *file, poll_table *wait) in spufs_wbox_poll() argument
985 struct spu_context *ctx = file->private_data; in spufs_wbox_poll()
988 poll_wait(file, &ctx->wbox_wq, wait); in spufs_wbox_poll()
1009 static ssize_t spufs_wbox_stat_read(struct file *file, char __user *buf, in spufs_wbox_stat_read() argument
1012 struct spu_context *ctx = file->private_data; in spufs_wbox_stat_read()
1037 static int spufs_signal1_open(struct inode *inode, struct file *file) in spufs_signal1_open() argument
1043 file->private_data = ctx; in spufs_signal1_open()
1047 return nonseekable_open(inode, file); in spufs_signal1_open()
1051 spufs_signal1_release(struct inode *inode, struct file *file) in spufs_signal1_release() argument
1087 static ssize_t spufs_signal1_read(struct file *file, char __user *buf, in spufs_signal1_read() argument
1091 struct spu_context *ctx = file->private_data; in spufs_signal1_read()
1102 static ssize_t spufs_signal1_write(struct file *file, const char __user *buf, in spufs_signal1_write() argument
1109 ctx = file->private_data; in spufs_signal1_write()
1145 static int spufs_signal1_mmap(struct file *file, struct vm_area_struct *vma) in spufs_signal1_mmap() argument
1174 static int spufs_signal2_open(struct inode *inode, struct file *file) in spufs_signal2_open() argument
1180 file->private_data = ctx; in spufs_signal2_open()
1184 return nonseekable_open(inode, file); in spufs_signal2_open()
1188 spufs_signal2_release(struct inode *inode, struct file *file) in spufs_signal2_release() argument
1224 static ssize_t spufs_signal2_read(struct file *file, char __user *buf, in spufs_signal2_read() argument
1227 struct spu_context *ctx = file->private_data; in spufs_signal2_read()
1239 static ssize_t spufs_signal2_write(struct file *file, const char __user *buf, in spufs_signal2_write() argument
1246 ctx = file->private_data; in spufs_signal2_write()
1283 static int spufs_signal2_mmap(struct file *file, struct vm_area_struct *vma) in spufs_signal2_mmap() argument
1406 static int spufs_mss_mmap(struct file *file, struct vm_area_struct *vma) in spufs_mss_mmap() argument
1421 static int spufs_mss_open(struct inode *inode, struct file *file) in spufs_mss_open() argument
1426 file->private_data = i->i_ctx; in spufs_mss_open()
1432 return nonseekable_open(inode, file); in spufs_mss_open()
1436 spufs_mss_release(struct inode *inode, struct file *file) in spufs_mss_release() argument
1468 static int spufs_psmap_mmap(struct file *file, struct vm_area_struct *vma) in spufs_psmap_mmap() argument
1480 static int spufs_psmap_open(struct inode *inode, struct file *file) in spufs_psmap_open() argument
1486 file->private_data = i->i_ctx; in spufs_psmap_open()
1490 return nonseekable_open(inode, file); in spufs_psmap_open()
1494 spufs_psmap_release(struct inode *inode, struct file *file) in spufs_psmap_release() argument
1528 static int spufs_mfc_mmap(struct file *file, struct vm_area_struct *vma) in spufs_mfc_mmap() argument
1543 static int spufs_mfc_open(struct inode *inode, struct file *file) in spufs_mfc_open() argument
1556 file->private_data = ctx; in spufs_mfc_open()
1560 return nonseekable_open(inode, file); in spufs_mfc_open()
1564 spufs_mfc_release(struct inode *inode, struct file *file) in spufs_mfc_release() argument
1620 static ssize_t spufs_mfc_read(struct file *file, char __user *buffer, in spufs_mfc_read() argument
1623 struct spu_context *ctx = file->private_data; in spufs_mfc_read()
1635 if (file->f_flags & O_NONBLOCK) { in spufs_mfc_read()
1746 static ssize_t spufs_mfc_write(struct file *file, const char __user *buffer, in spufs_mfc_write() argument
1749 struct spu_context *ctx = file->private_data; in spufs_mfc_write()
1772 if (file->f_flags & O_NONBLOCK) { in spufs_mfc_write()
1796 static unsigned int spufs_mfc_poll(struct file *file,poll_table *wait) in spufs_mfc_poll() argument
1798 struct spu_context *ctx = file->private_data; in spufs_mfc_poll()
1802 poll_wait(file, &ctx->mfc_wq, wait); in spufs_mfc_poll()
1826 static int spufs_mfc_flush(struct file *file, fl_owner_t id) in spufs_mfc_flush() argument
1828 struct spu_context *ctx = file->private_data; in spufs_mfc_flush()
1852 static int spufs_mfc_fsync(struct file *file, loff_t start, loff_t end, int datasync) in spufs_mfc_fsync() argument
1854 struct inode *inode = file_inode(file); in spufs_mfc_fsync()
1858 err = spufs_mfc_flush(file, NULL); in spufs_mfc_fsync()
1864 static int spufs_mfc_fasync(int fd, struct file *file, int on) in spufs_mfc_fasync() argument
1866 struct spu_context *ctx = file->private_data; in spufs_mfc_fasync()
1868 return fasync_helper(fd, file, on, &ctx->mfc_fasync); in spufs_mfc_fasync()
2054 static int spufs_info_open(struct inode *inode, struct file *file) in spufs_info_open() argument
2058 file->private_data = ctx; in spufs_info_open()
2073 static int spufs_caps_open(struct inode *inode, struct file *file) in spufs_caps_open() argument
2075 return single_open(file, spufs_caps_show, SPUFS_I(inode)->i_ctx); in spufs_caps_open()
2099 static ssize_t spufs_mbox_info_read(struct file *file, char __user *buf, in spufs_mbox_info_read() argument
2103 struct spu_context *ctx = file->private_data; in spufs_mbox_info_read()
2139 static ssize_t spufs_ibox_info_read(struct file *file, char __user *buf, in spufs_ibox_info_read() argument
2142 struct spu_context *ctx = file->private_data; in spufs_ibox_info_read()
2182 static ssize_t spufs_wbox_info_read(struct file *file, char __user *buf, in spufs_wbox_info_read() argument
2185 struct spu_context *ctx = file->private_data; in spufs_wbox_info_read()
2234 static ssize_t spufs_dma_info_read(struct file *file, char __user *buf, in spufs_dma_info_read() argument
2237 struct spu_context *ctx = file->private_data; in spufs_dma_info_read()
2291 static ssize_t spufs_proxydma_info_read(struct file *file, char __user *buf, in spufs_proxydma_info_read() argument
2294 struct spu_context *ctx = file->private_data; in spufs_proxydma_info_read()
2322 static int spufs_tid_open(struct inode *inode, struct file *file) in spufs_tid_open() argument
2324 return single_open(file, spufs_show_tid, SPUFS_I(inode)->i_ctx); in spufs_tid_open()
2412 static int spufs_stat_open(struct inode *inode, struct file *file) in spufs_stat_open() argument
2414 return single_open(file, spufs_show_stat, SPUFS_I(inode)->i_ctx); in spufs_stat_open()
2435 static int spufs_switch_log_open(struct inode *inode, struct file *file) in spufs_switch_log_open() argument
2467 static int spufs_switch_log_release(struct inode *inode, struct file *file) in spufs_switch_log_release() argument
2498 static ssize_t spufs_switch_log_read(struct file *file, char __user *buf, in spufs_switch_log_read() argument
2501 struct inode *inode = file_inode(file); in spufs_switch_log_read()
2522 } else if (file->f_flags & O_NONBLOCK) { in spufs_switch_log_read()
2569 static unsigned int spufs_switch_log_poll(struct file *file, poll_table *wait) in spufs_switch_log_poll() argument
2571 struct inode *inode = file_inode(file); in spufs_switch_log_poll()
2576 poll_wait(file, &ctx->switch_log->wait, wait); in spufs_switch_log_poll()
2666 static int spufs_ctx_open(struct inode *inode, struct file *file) in spufs_ctx_open() argument
2668 return single_open(file, spufs_show_ctx, SPUFS_I(inode)->i_ctx); in spufs_ctx_open()