Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101759
b: refs/heads/master
c: 87ff609
h: refs/heads/master
i:
  101757: 48de79a
  101755: b4a3a9c
  101751: 7430bc1
  101743: c8d243c
  101727: 63464f0
  101695: a88e8af
  101631: ce916a4
v: v3
  • Loading branch information
Jeremy Kerr committed Jul 9, 2008
1 parent a6bc46c commit 6e09871
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2442a8ba5abe2c27c572bc522da1c33df98c6ec7
refs/heads/master: 87ff6090bfe416c71730654ab53cd4ecffdd675e
12 changes: 6 additions & 6 deletions trunk/arch/powerpc/platforms/cell/spufs/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@ void spu_unmap_mappings(struct spu_context *ctx)
if (ctx->local_store)
unmap_mapping_range(ctx->local_store, 0, LS_SIZE, 1);
if (ctx->mfc)
unmap_mapping_range(ctx->mfc, 0, 0x1000, 1);
unmap_mapping_range(ctx->mfc, 0, SPUFS_MFC_MAP_SIZE, 1);
if (ctx->cntl)
unmap_mapping_range(ctx->cntl, 0, 0x1000, 1);
unmap_mapping_range(ctx->cntl, 0, SPUFS_CNTL_MAP_SIZE, 1);
if (ctx->signal1)
unmap_mapping_range(ctx->signal1, 0, PAGE_SIZE, 1);
unmap_mapping_range(ctx->signal1, 0, SPUFS_SIGNAL_MAP_SIZE, 1);
if (ctx->signal2)
unmap_mapping_range(ctx->signal2, 0, PAGE_SIZE, 1);
unmap_mapping_range(ctx->signal2, 0, SPUFS_SIGNAL_MAP_SIZE, 1);
if (ctx->mss)
unmap_mapping_range(ctx->mss, 0, 0x1000, 1);
unmap_mapping_range(ctx->mss, 0, SPUFS_MSS_MAP_SIZE, 1);
if (ctx->psmap)
unmap_mapping_range(ctx->psmap, 0, 0x20000, 1);
unmap_mapping_range(ctx->psmap, 0, SPUFS_PS_MAP_SIZE, 1);
mutex_unlock(&ctx->mapping_lock);
}

Expand Down
24 changes: 12 additions & 12 deletions trunk/arch/powerpc/platforms/cell/spufs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ static int spufs_ps_fault(struct vm_area_struct *vma,
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 = {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand Down
7 changes: 7 additions & 0 deletions trunk/arch/powerpc/platforms/cell/spufs/spufs.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
#include <asm/spu_csa.h>
#include <asm/spu_info.h>

#define SPUFS_PS_MAP_SIZE 0x20000
#define SPUFS_MFC_MAP_SIZE 0x1000
#define SPUFS_CNTL_MAP_SIZE 0x1000
#define SPUFS_CNTL_MAP_SIZE 0x1000
#define SPUFS_SIGNAL_MAP_SIZE PAGE_SIZE
#define SPUFS_MSS_MAP_SIZE 0x1000

/* The magic number for our file system */
enum {
SPUFS_MAGIC = 0x23c9b64e,
Expand Down

0 comments on commit 6e09871

Please sign in to comment.