vma->vm_flags |= VM_RESERVED;
vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
- | _PAGE_NO_CACHE | _PAGE_GUARDED);
+ | _PAGE_NO_CACHE);
vma->vm_ops = &spufs_cntl_mmap_vmops;
return 0;
vma->vm_flags |= VM_RESERVED;
vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
- | _PAGE_NO_CACHE | _PAGE_GUARDED);
+ | _PAGE_NO_CACHE);
vma->vm_ops = &spufs_signal1_mmap_vmops;
return 0;
/* FIXME: */
vma->vm_flags |= VM_RESERVED;
vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
- | _PAGE_NO_CACHE | _PAGE_GUARDED);
+ | _PAGE_NO_CACHE);
vma->vm_ops = &spufs_signal2_mmap_vmops;
return 0;
DEFINE_SIMPLE_ATTRIBUTE(spufs_signal2_type, spufs_signal2_type_get,
spufs_signal2_type_set, "%llu");
-#ifdef CONFIG_SPUFS_MMAP
-static struct page *spufs_mss_mmap_nopage(struct vm_area_struct *vma,
- unsigned long address, int *type)
-{
- return spufs_ps_nopage(vma, address, type, 0x0000);
-}
-
-static struct vm_operations_struct spufs_mss_mmap_vmops = {
- .nopage = spufs_mss_mmap_nopage,
-};
-
-/*
- * mmap support for problem state MFC DMA area [0x0000 - 0x0fff].
- * Mapping this area requires that the application have CAP_SYS_RAWIO,
- * as these registers require special care when read/writing.
- */
-static int spufs_mss_mmap(struct file *file, struct vm_area_struct *vma)
-{
- if (!(vma->vm_flags & VM_SHARED))
- return -EINVAL;
-
- if (!capable(CAP_SYS_RAWIO))
- return -EPERM;
-
- vma->vm_flags |= VM_RESERVED;
- vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
- | _PAGE_NO_CACHE | _PAGE_GUARDED);
-
- vma->vm_ops = &spufs_mss_mmap_vmops;
- return 0;
-}
-#endif
-
-static int spufs_mss_open(struct inode *inode, struct file *file)
-{
- struct spufs_inode_info *i = SPUFS_I(inode);
-
- file->private_data = i->i_ctx;
- return nonseekable_open(inode, file);
-}
-
-static struct file_operations spufs_mss_fops = {
- .open = spufs_mss_open,
-#ifdef CONFIG_SPUFS_MMAP
- .mmap = spufs_mss_mmap,
-#endif
-};
-
-
#ifdef CONFIG_SPUFS_MMAP
static struct page *spufs_mfc_mmap_nopage(struct vm_area_struct *vma,
unsigned long address, int *type)
vma->vm_flags |= VM_RESERVED;
vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
- | _PAGE_NO_CACHE | _PAGE_GUARDED);
+ | _PAGE_NO_CACHE);
vma->vm_ops = &spufs_mfc_mmap_vmops;
return 0;
return mask;
}
-static int spufs_mfc_flush(struct file *file, fl_owner_t id)
+static int spufs_mfc_flush(struct file *file)
{
struct spu_context *ctx = file->private_data;
int ret;
static int spufs_mfc_fsync(struct file *file, struct dentry *dentry,
int datasync)
{
- return spufs_mfc_flush(file, NULL);
+ return spufs_mfc_flush(file);
}
static int spufs_mfc_fasync(int fd, struct file *file, int on)
DEFINE_SIMPLE_ATTRIBUTE(spufs_srr0_ops, spufs_srr0_get, spufs_srr0_set,
"%llx\n")
-static u64 spufs_id_get(void *data)
-{
- struct spu_context *ctx = data;
- u64 num;
-
- spu_acquire(ctx);
- if (ctx->state == SPU_STATE_RUNNABLE)
- num = ctx->spu->number;
- else
- num = (unsigned int)-1;
- spu_release(ctx);
-
- return num;
-}
-DEFINE_SIMPLE_ATTRIBUTE(spufs_id_ops, spufs_id_get, 0, "0x%llx\n")
-
struct tree_descr spufs_dir_contents[] = {
{ "mem", &spufs_mem_fops, 0666, },
{ "regs", &spufs_regs_fops, 0666, },
{ "signal2", &spufs_signal2_fops, 0666, },
{ "signal1_type", &spufs_signal1_type, 0666, },
{ "signal2_type", &spufs_signal2_type, 0666, },
- { "mss", &spufs_mss_fops, 0666, },
{ "mfc", &spufs_mfc_fops, 0666, },
{ "cntl", &spufs_cntl_fops, 0666, },
{ "npc", &spufs_npc_ops, 0666, },
{ "spu_tag_mask", &spufs_spu_tag_mask_ops, 0666, },
{ "event_mask", &spufs_event_mask_ops, 0666, },
{ "srr0", &spufs_srr0_ops, 0666, },
- { "phys-id", &spufs_id_ops, 0666, },
{},
};