Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48226
b: refs/heads/master
c: 17e0e27
h: refs/heads/master
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Feb 13, 2007
1 parent 5748641 commit 9bfbf24
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 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: 44430e0d3916ab6aaf0451fdb811f4f1803b741e
refs/heads/master: 17e0e27020d028a790d97699aff85a43af5be472
12 changes: 8 additions & 4 deletions trunk/arch/powerpc/platforms/cell/spufs/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,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, 0x4000, 1);
unmap_mapping_range(ctx->mfc, 0, 0x1000, 1);
if (ctx->cntl)
unmap_mapping_range(ctx->cntl, 0, 0x4000, 1);
unmap_mapping_range(ctx->cntl, 0, 0x1000, 1);
if (ctx->signal1)
unmap_mapping_range(ctx->signal1, 0, 0x4000, 1);
unmap_mapping_range(ctx->signal1, 0, PAGE_SIZE, 1);
if (ctx->signal2)
unmap_mapping_range(ctx->signal2, 0, 0x4000, 1);
unmap_mapping_range(ctx->signal2, 0, PAGE_SIZE, 1);
if (ctx->mss)
unmap_mapping_range(ctx->mss, 0, 0x1000, 1);
if (ctx->psmap)
unmap_mapping_range(ctx->psmap, 0, 0x20000, 1);
}

int spu_acquire_exclusive(struct spu_context *ctx)
Expand Down
16 changes: 12 additions & 4 deletions trunk/arch/powerpc/platforms/cell/spufs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ spufs_mem_open(struct inode *inode, struct file *file)
struct spufs_inode_info *i = SPUFS_I(inode);
struct spu_context *ctx = i->i_ctx;
file->private_data = ctx;
file->f_mapping = inode->i_mapping;
ctx->local_store = inode->i_mapping;
smp_wmb();
return 0;
}

Expand Down Expand Up @@ -232,8 +232,8 @@ static int spufs_cntl_open(struct inode *inode, struct file *file)
struct spu_context *ctx = i->i_ctx;

file->private_data = ctx;
file->f_mapping = inode->i_mapping;
ctx->cntl = inode->i_mapping;
smp_wmb();
return simple_attr_open(inode, file, spufs_cntl_get,
spufs_cntl_set, "0x%08lx");
}
Expand Down Expand Up @@ -717,8 +717,8 @@ static int spufs_signal1_open(struct inode *inode, struct file *file)
struct spufs_inode_info *i = SPUFS_I(inode);
struct spu_context *ctx = i->i_ctx;
file->private_data = ctx;
file->f_mapping = inode->i_mapping;
ctx->signal1 = inode->i_mapping;
smp_wmb();
return nonseekable_open(inode, file);
}

Expand Down Expand Up @@ -824,8 +824,8 @@ static int spufs_signal2_open(struct inode *inode, struct file *file)
struct spufs_inode_info *i = SPUFS_I(inode);
struct spu_context *ctx = i->i_ctx;
file->private_data = ctx;
file->f_mapping = inode->i_mapping;
ctx->signal2 = inode->i_mapping;
smp_wmb();
return nonseekable_open(inode, file);
}

Expand Down Expand Up @@ -1021,8 +1021,11 @@ static int spufs_mss_mmap(struct file *file, struct vm_area_struct *vma)
static int spufs_mss_open(struct inode *inode, struct file *file)
{
struct spufs_inode_info *i = SPUFS_I(inode);
struct spu_context *ctx = i->i_ctx;

file->private_data = i->i_ctx;
ctx->mss = inode->i_mapping;
smp_wmb();
return nonseekable_open(inode, file);
}

Expand Down Expand Up @@ -1060,8 +1063,11 @@ static int spufs_psmap_mmap(struct file *file, struct vm_area_struct *vma)
static int spufs_psmap_open(struct inode *inode, struct file *file)
{
struct spufs_inode_info *i = SPUFS_I(inode);
struct spu_context *ctx = i->i_ctx;

file->private_data = i->i_ctx;
ctx->psmap = inode->i_mapping;
smp_wmb();
return nonseekable_open(inode, file);
}

Expand Down Expand Up @@ -1114,6 +1120,8 @@ static int spufs_mfc_open(struct inode *inode, struct file *file)
return -EBUSY;

file->private_data = ctx;
ctx->mfc = inode->i_mapping;
smp_wmb();
return nonseekable_open(inode, file);
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/platforms/cell/spufs/spufs.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ struct spu_context {
struct address_space *cntl; /* 'control' area mappings. */
struct address_space *signal1; /* 'signal1' area mappings. */
struct address_space *signal2; /* 'signal2' area mappings. */
struct address_space *mss; /* 'mss' area mappings. */
struct address_space *psmap; /* 'psmap' area mappings. */
u64 object_id; /* user space pointer for oprofile */

enum { SPU_STATE_RUNNABLE, SPU_STATE_SAVED } state;
Expand Down

0 comments on commit 9bfbf24

Please sign in to comment.