Lines Matching refs:file
44 static int spufs_attr_open(struct inode *inode, struct file *file, in spufs_attr_open() argument
59 file->private_data = attr; in spufs_attr_open()
61 return nonseekable_open(inode, file); in spufs_attr_open()
64 static int spufs_attr_release(struct inode *inode, struct file *file) in spufs_attr_release() argument
66 kfree(file->private_data); in spufs_attr_release()
70 static ssize_t spufs_attr_read(struct file *file, char __user *buf, in spufs_attr_read() argument
77 attr = file->private_data; in spufs_attr_read()
103 static ssize_t spufs_attr_write(struct file *file, const char __user *buf, in spufs_attr_write() argument
111 attr = file->private_data; in spufs_attr_write()
142 static int __fops ## _open(struct inode *inode, struct file *file) \
145 return spufs_attr_open(inode, file, __get, __set, __fmt); \
157 spufs_mem_open(struct inode *inode, struct file *file) in spufs_mem_open() argument
163 file->private_data = ctx; in spufs_mem_open()
171 spufs_mem_release(struct inode *inode, struct file *file) in spufs_mem_release() argument
190 spufs_mem_read(struct file *file, char __user *buffer, in spufs_mem_read() argument
193 struct spu_context *ctx = file->private_data; in spufs_mem_read()
207 spufs_mem_write(struct file *file, const char __user *buffer, in spufs_mem_write() argument
210 struct spu_context *ctx = file->private_data; in spufs_mem_write()
289 static int spufs_mem_mmap(struct file *file, struct vm_area_struct *vma) in spufs_mem_mmap() argument
379 static int spufs_cntl_mmap(struct file *file, struct vm_area_struct *vma) in spufs_cntl_mmap() argument
422 static int spufs_cntl_open(struct inode *inode, struct file *file) in spufs_cntl_open() argument
428 file->private_data = ctx; in spufs_cntl_open()
432 return simple_attr_open(inode, file, spufs_cntl_get, in spufs_cntl_open()
437 spufs_cntl_release(struct inode *inode, struct file *file) in spufs_cntl_release() argument
442 simple_attr_release(inode, file); in spufs_cntl_release()
460 spufs_regs_open(struct inode *inode, struct file *file) in spufs_regs_open() argument
463 file->private_data = i->i_ctx; in spufs_regs_open()
475 spufs_regs_read(struct file *file, char __user *buffer, in spufs_regs_read() argument
479 struct spu_context *ctx = file->private_data; in spufs_regs_read()
496 spufs_regs_write(struct file *file, const char __user *buffer, in spufs_regs_write() argument
499 struct spu_context *ctx = file->private_data; in spufs_regs_write()
532 spufs_fpcr_read(struct file *file, char __user * buffer, in spufs_fpcr_read() argument
536 struct spu_context *ctx = file->private_data; in spufs_fpcr_read()
548 spufs_fpcr_write(struct file *file, const char __user * buffer, in spufs_fpcr_write() argument
551 struct spu_context *ctx = file->private_data; in spufs_fpcr_write()
577 static int spufs_pipe_open(struct inode *inode, struct file *file) in spufs_pipe_open() argument
580 file->private_data = i->i_ctx; in spufs_pipe_open()
582 return stream_open(inode, file); in spufs_pipe_open()
593 static ssize_t spufs_mbox_read(struct file *file, char __user *buf, in spufs_mbox_read() argument
596 struct spu_context *ctx = file->private_data; in spufs_mbox_read()
638 static ssize_t spufs_mbox_stat_read(struct file *file, char __user *buf, in spufs_mbox_stat_read() argument
641 struct spu_context *ctx = file->private_data; in spufs_mbox_stat_read()
694 static ssize_t spufs_ibox_read(struct file *file, char __user *buf, in spufs_ibox_read() argument
697 struct spu_context *ctx = file->private_data; in spufs_ibox_read()
710 if (file->f_flags & O_NONBLOCK) { in spufs_ibox_read()
747 static __poll_t spufs_ibox_poll(struct file *file, poll_table *wait) in spufs_ibox_poll() argument
749 struct spu_context *ctx = file->private_data; in spufs_ibox_poll()
752 poll_wait(file, &ctx->ibox_wq, wait); in spufs_ibox_poll()
771 static ssize_t spufs_ibox_stat_read(struct file *file, char __user *buf, in spufs_ibox_stat_read() argument
774 struct spu_context *ctx = file->private_data; in spufs_ibox_stat_read()
825 static ssize_t spufs_wbox_write(struct file *file, const char __user *buf, in spufs_wbox_write() argument
828 struct spu_context *ctx = file->private_data; in spufs_wbox_write()
847 if (file->f_flags & O_NONBLOCK) { in spufs_wbox_write()
877 static __poll_t spufs_wbox_poll(struct file *file, poll_table *wait) in spufs_wbox_poll() argument
879 struct spu_context *ctx = file->private_data; in spufs_wbox_poll()
882 poll_wait(file, &ctx->wbox_wq, wait); in spufs_wbox_poll()
901 static ssize_t spufs_wbox_stat_read(struct file *file, char __user *buf, in spufs_wbox_stat_read() argument
904 struct spu_context *ctx = file->private_data; in spufs_wbox_stat_read()
928 static int spufs_signal1_open(struct inode *inode, struct file *file) in spufs_signal1_open() argument
934 file->private_data = ctx; in spufs_signal1_open()
938 return nonseekable_open(inode, file); in spufs_signal1_open()
942 spufs_signal1_release(struct inode *inode, struct file *file) in spufs_signal1_release() argument
976 static ssize_t spufs_signal1_read(struct file *file, char __user *buf, in spufs_signal1_read() argument
980 struct spu_context *ctx = file->private_data; in spufs_signal1_read()
991 static ssize_t spufs_signal1_write(struct file *file, const char __user *buf, in spufs_signal1_write() argument
998 ctx = file->private_data; in spufs_signal1_write()
1034 static int spufs_signal1_mmap(struct file *file, struct vm_area_struct *vma) in spufs_signal1_mmap() argument
1061 static int spufs_signal2_open(struct inode *inode, struct file *file) in spufs_signal2_open() argument
1067 file->private_data = ctx; in spufs_signal2_open()
1071 return nonseekable_open(inode, file); in spufs_signal2_open()
1075 spufs_signal2_release(struct inode *inode, struct file *file) in spufs_signal2_release() argument
1109 static ssize_t spufs_signal2_read(struct file *file, char __user *buf, in spufs_signal2_read() argument
1112 struct spu_context *ctx = file->private_data; in spufs_signal2_read()
1124 static ssize_t spufs_signal2_write(struct file *file, const char __user *buf, in spufs_signal2_write() argument
1131 ctx = file->private_data; in spufs_signal2_write()
1168 static int spufs_signal2_mmap(struct file *file, struct vm_area_struct *vma) in spufs_signal2_mmap() argument
1289 static int spufs_mss_mmap(struct file *file, struct vm_area_struct *vma) in spufs_mss_mmap() argument
1304 static int spufs_mss_open(struct inode *inode, struct file *file) in spufs_mss_open() argument
1309 file->private_data = i->i_ctx; in spufs_mss_open()
1315 return nonseekable_open(inode, file); in spufs_mss_open()
1319 spufs_mss_release(struct inode *inode, struct file *file) in spufs_mss_release() argument
1350 static int spufs_psmap_mmap(struct file *file, struct vm_area_struct *vma) in spufs_psmap_mmap() argument
1362 static int spufs_psmap_open(struct inode *inode, struct file *file) in spufs_psmap_open() argument
1368 file->private_data = i->i_ctx; in spufs_psmap_open()
1372 return nonseekable_open(inode, file); in spufs_psmap_open()
1376 spufs_psmap_release(struct inode *inode, struct file *file) in spufs_psmap_release() argument
1409 static int spufs_mfc_mmap(struct file *file, struct vm_area_struct *vma) in spufs_mfc_mmap() argument
1424 static int spufs_mfc_open(struct inode *inode, struct file *file) in spufs_mfc_open() argument
1437 file->private_data = ctx; in spufs_mfc_open()
1441 return nonseekable_open(inode, file); in spufs_mfc_open()
1445 spufs_mfc_release(struct inode *inode, struct file *file) in spufs_mfc_release() argument
1481 static ssize_t spufs_mfc_read(struct file *file, char __user *buffer, in spufs_mfc_read() argument
1484 struct spu_context *ctx = file->private_data; in spufs_mfc_read()
1496 if (file->f_flags & O_NONBLOCK) { in spufs_mfc_read()
1607 static ssize_t spufs_mfc_write(struct file *file, const char __user *buffer, in spufs_mfc_write() argument
1610 struct spu_context *ctx = file->private_data; in spufs_mfc_write()
1633 if (file->f_flags & O_NONBLOCK) { in spufs_mfc_write()
1657 static __poll_t spufs_mfc_poll(struct file *file,poll_table *wait) in spufs_mfc_poll() argument
1659 struct spu_context *ctx = file->private_data; in spufs_mfc_poll()
1663 poll_wait(file, &ctx->mfc_wq, wait); in spufs_mfc_poll()
1687 static int spufs_mfc_flush(struct file *file, fl_owner_t id) in spufs_mfc_flush() argument
1689 struct spu_context *ctx = file->private_data; in spufs_mfc_flush()
1701 static int spufs_mfc_fsync(struct file *file, loff_t start, loff_t end, int datasync) in spufs_mfc_fsync() argument
1703 struct inode *inode = file_inode(file); in spufs_mfc_fsync()
1704 int err = file_write_and_wait_range(file, start, end); in spufs_mfc_fsync()
1707 err = spufs_mfc_flush(file, NULL); in spufs_mfc_fsync()
1894 static int spufs_info_open(struct inode *inode, struct file *file) in spufs_info_open() argument
1898 file->private_data = ctx; in spufs_info_open()
1913 static int spufs_caps_open(struct inode *inode, struct file *file) in spufs_caps_open() argument
1915 return single_open(file, spufs_caps_show, SPUFS_I(inode)->i_ctx); in spufs_caps_open()
1934 static ssize_t spufs_mbox_info_read(struct file *file, char __user *buf, in spufs_mbox_info_read() argument
1937 struct spu_context *ctx = file->private_data; in spufs_mbox_info_read()
1972 static ssize_t spufs_ibox_info_read(struct file *file, char __user *buf, in spufs_ibox_info_read() argument
1975 struct spu_context *ctx = file->private_data; in spufs_ibox_info_read()
2013 static ssize_t spufs_wbox_info_read(struct file *file, char __user *buf, in spufs_wbox_info_read() argument
2016 struct spu_context *ctx = file->private_data; in spufs_wbox_info_read()
2069 static ssize_t spufs_dma_info_read(struct file *file, char __user *buf, in spufs_dma_info_read() argument
2072 struct spu_context *ctx = file->private_data; in spufs_dma_info_read()
2122 static ssize_t spufs_proxydma_info_read(struct file *file, char __user *buf, in spufs_proxydma_info_read() argument
2125 struct spu_context *ctx = file->private_data; in spufs_proxydma_info_read()
2157 static int spufs_tid_open(struct inode *inode, struct file *file) in spufs_tid_open() argument
2159 return single_open(file, spufs_show_tid, SPUFS_I(inode)->i_ctx); in spufs_tid_open()
2247 static int spufs_stat_open(struct inode *inode, struct file *file) in spufs_stat_open() argument
2249 return single_open(file, spufs_show_stat, SPUFS_I(inode)->i_ctx); in spufs_stat_open()
2270 static int spufs_switch_log_open(struct inode *inode, struct file *file) in spufs_switch_log_open() argument
2301 static int spufs_switch_log_release(struct inode *inode, struct file *file) in spufs_switch_log_release() argument
2332 static ssize_t spufs_switch_log_read(struct file *file, char __user *buf, in spufs_switch_log_read() argument
2335 struct inode *inode = file_inode(file); in spufs_switch_log_read()
2356 } else if (file->f_flags & O_NONBLOCK) { in spufs_switch_log_read()
2403 static __poll_t spufs_switch_log_poll(struct file *file, poll_table *wait) in spufs_switch_log_poll() argument
2405 struct inode *inode = file_inode(file); in spufs_switch_log_poll()
2410 poll_wait(file, &ctx->switch_log->wait, wait); in spufs_switch_log_poll()
2499 static int spufs_ctx_open(struct inode *inode, struct file *file) in spufs_ctx_open() argument
2501 return single_open(file, spufs_show_ctx, SPUFS_I(inode)->i_ctx); in spufs_ctx_open()