Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
[pandora-kernel.git] / arch / powerpc / platforms / cell / spufs / file.c
index fc595d0..99c7306 100644 (file)
@@ -410,7 +410,7 @@ refault:
 static int spufs_cntl_mmap_fault(struct vm_area_struct *vma,
                                           struct vm_fault *vmf)
 {
-       return spufs_ps_fault(vma, vmf, 0x4000, 0x1000);
+       return spufs_ps_fault(vma, vmf, 0x4000, SPUFS_CNTL_MAP_SIZE);
 }
 
 static struct vm_operations_struct spufs_cntl_mmap_vmops = {
@@ -1102,13 +1102,13 @@ static ssize_t spufs_signal1_write(struct file *file, const char __user *buf,
 static int
 spufs_signal1_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
-#if PAGE_SIZE == 0x1000
-       return spufs_ps_fault(vma, vmf, 0x14000, 0x1000);
-#elif PAGE_SIZE == 0x10000
+#if SPUFS_SIGNAL_MAP_SIZE == 0x1000
+       return spufs_ps_fault(vma, vmf, 0x14000, SPUFS_SIGNAL_MAP_SIZE);
+#elif SPUFS_SIGNAL_MAP_SIZE == 0x10000
        /* For 64k pages, both signal1 and signal2 can be used to mmap the whole
         * signal 1 and 2 area
         */
-       return spufs_ps_fault(vma, vmf, 0x10000, 0x10000);
+       return spufs_ps_fault(vma, vmf, 0x10000, SPUFS_SIGNAL_MAP_SIZE);
 #else
 #error unsupported page size
 #endif
@@ -1239,13 +1239,13 @@ static ssize_t spufs_signal2_write(struct file *file, const char __user *buf,
 static int
 spufs_signal2_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
-#if PAGE_SIZE == 0x1000
-       return spufs_ps_fault(vma, vmf, 0x1c000, 0x1000);
-#elif PAGE_SIZE == 0x10000
+#if SPUFS_SIGNAL_MAP_SIZE == 0x1000
+       return spufs_ps_fault(vma, vmf, 0x1c000, SPUFS_SIGNAL_MAP_SIZE);
+#elif SPUFS_SIGNAL_MAP_SIZE == 0x10000
        /* For 64k pages, both signal1 and signal2 can be used to mmap the whole
         * signal 1 and 2 area
         */
-       return spufs_ps_fault(vma, vmf, 0x10000, 0x10000);
+       return spufs_ps_fault(vma, vmf, 0x10000, SPUFS_SIGNAL_MAP_SIZE);
 #else
 #error unsupported page size
 #endif
@@ -1367,7 +1367,7 @@ DEFINE_SPUFS_ATTRIBUTE(spufs_signal2_type, spufs_signal2_type_get,
 static int
 spufs_mss_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
-       return spufs_ps_fault(vma, vmf, 0x0000, 0x1000);
+       return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_MSS_MAP_SIZE);
 }
 
 static struct vm_operations_struct spufs_mss_mmap_vmops = {
@@ -1429,7 +1429,7 @@ static const struct file_operations spufs_mss_fops = {
 static int
 spufs_psmap_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
-       return spufs_ps_fault(vma, vmf, 0x0000, 0x20000);
+       return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_PS_MAP_SIZE);
 }
 
 static struct vm_operations_struct spufs_psmap_mmap_vmops = {
@@ -1489,7 +1489,7 @@ static const struct file_operations spufs_psmap_fops = {
 static int
 spufs_mfc_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
-       return spufs_ps_fault(vma, vmf, 0x3000, 0x1000);
+       return spufs_ps_fault(vma, vmf, 0x3000, SPUFS_MFC_MAP_SIZE);
 }
 
 static struct vm_operations_struct spufs_mfc_mmap_vmops = {
@@ -2607,22 +2607,22 @@ static const struct file_operations spufs_ctx_fops = {
        .release        = single_release,
 };
 
-struct tree_descr spufs_dir_contents[] = {
+struct spufs_tree_descr spufs_dir_contents[] = {
        { "capabilities", &spufs_caps_fops, 0444, },
-       { "mem",  &spufs_mem_fops,  0666, },
-       { "regs", &spufs_regs_fops,  0666, },
+       { "mem",  &spufs_mem_fops,  0666, LS_SIZE, },
+       { "regs", &spufs_regs_fops,  0666, sizeof(struct spu_reg128[128]), },
        { "mbox", &spufs_mbox_fops, 0444, },
        { "ibox", &spufs_ibox_fops, 0444, },
        { "wbox", &spufs_wbox_fops, 0222, },
-       { "mbox_stat", &spufs_mbox_stat_fops, 0444, },
-       { "ibox_stat", &spufs_ibox_stat_fops, 0444, },
-       { "wbox_stat", &spufs_wbox_stat_fops, 0444, },
+       { "mbox_stat", &spufs_mbox_stat_fops, 0444, sizeof(u32), },
+       { "ibox_stat", &spufs_ibox_stat_fops, 0444, sizeof(u32), },
+       { "wbox_stat", &spufs_wbox_stat_fops, 0444, sizeof(u32), },
        { "signal1", &spufs_signal1_fops, 0666, },
        { "signal2", &spufs_signal2_fops, 0666, },
        { "signal1_type", &spufs_signal1_type, 0666, },
        { "signal2_type", &spufs_signal2_type, 0666, },
        { "cntl", &spufs_cntl_fops,  0666, },
-       { "fpcr", &spufs_fpcr_fops, 0666, },
+       { "fpcr", &spufs_fpcr_fops, 0666, sizeof(struct spu_reg128), },
        { "lslr", &spufs_lslr_ops, 0444, },
        { "mfc", &spufs_mfc_fops, 0666, },
        { "mss", &spufs_mss_fops, 0666, },
@@ -2632,30 +2632,31 @@ struct tree_descr spufs_dir_contents[] = {
        { "decr_status", &spufs_decr_status_ops, 0666, },
        { "event_mask", &spufs_event_mask_ops, 0666, },
        { "event_status", &spufs_event_status_ops, 0444, },
-       { "psmap", &spufs_psmap_fops, 0666, },
+       { "psmap", &spufs_psmap_fops, 0666, SPUFS_PS_MAP_SIZE, },
        { "phys-id", &spufs_id_ops, 0666, },
        { "object-id", &spufs_object_id_ops, 0666, },
-       { "mbox_info", &spufs_mbox_info_fops, 0444, },
-       { "ibox_info", &spufs_ibox_info_fops, 0444, },
-       { "wbox_info", &spufs_wbox_info_fops, 0444, },
-       { "dma_info", &spufs_dma_info_fops, 0444, },
-       { "proxydma_info", &spufs_proxydma_info_fops, 0444, },
+       { "mbox_info", &spufs_mbox_info_fops, 0444, sizeof(u32), },
+       { "ibox_info", &spufs_ibox_info_fops, 0444, sizeof(u32), },
+       { "wbox_info", &spufs_wbox_info_fops, 0444, sizeof(u32), },
+       { "dma_info", &spufs_dma_info_fops, 0444,
+               sizeof(struct spu_dma_info), },
+       { "proxydma_info", &spufs_proxydma_info_fops, 0444,
+               sizeof(struct spu_proxydma_info)},
        { "tid", &spufs_tid_fops, 0444, },
        { "stat", &spufs_stat_fops, 0444, },
        { "switch_log", &spufs_switch_log_fops, 0444 },
-       { ".ctx", &spufs_ctx_fops, 0444, },
        {},
 };
 
-struct tree_descr spufs_dir_nosched_contents[] = {
+struct spufs_tree_descr spufs_dir_nosched_contents[] = {
        { "capabilities", &spufs_caps_fops, 0444, },
-       { "mem",  &spufs_mem_fops,  0666, },
+       { "mem",  &spufs_mem_fops,  0666, LS_SIZE, },
        { "mbox", &spufs_mbox_fops, 0444, },
        { "ibox", &spufs_ibox_fops, 0444, },
        { "wbox", &spufs_wbox_fops, 0222, },
-       { "mbox_stat", &spufs_mbox_stat_fops, 0444, },
-       { "ibox_stat", &spufs_ibox_stat_fops, 0444, },
-       { "wbox_stat", &spufs_wbox_stat_fops, 0444, },
+       { "mbox_stat", &spufs_mbox_stat_fops, 0444, sizeof(u32), },
+       { "ibox_stat", &spufs_ibox_stat_fops, 0444, sizeof(u32), },
+       { "wbox_stat", &spufs_wbox_stat_fops, 0444, sizeof(u32), },
        { "signal1", &spufs_signal1_nosched_fops, 0222, },
        { "signal2", &spufs_signal2_nosched_fops, 0222, },
        { "signal1_type", &spufs_signal1_type, 0666, },
@@ -2664,11 +2665,15 @@ struct tree_descr spufs_dir_nosched_contents[] = {
        { "mfc", &spufs_mfc_fops, 0666, },
        { "cntl", &spufs_cntl_fops,  0666, },
        { "npc", &spufs_npc_ops, 0666, },
-       { "psmap", &spufs_psmap_fops, 0666, },
+       { "psmap", &spufs_psmap_fops, 0666, SPUFS_PS_MAP_SIZE, },
        { "phys-id", &spufs_id_ops, 0666, },
        { "object-id", &spufs_object_id_ops, 0666, },
        { "tid", &spufs_tid_fops, 0444, },
        { "stat", &spufs_stat_fops, 0444, },
+       {},
+};
+
+struct spufs_tree_descr spufs_dir_debug_contents[] = {
        { ".ctx", &spufs_ctx_fops, 0444, },
        {},
 };