~ubuntu-branches/ubuntu/lucid/linux-rt/lucid

« back to all changes in this revision

Viewing changes to arch/powerpc/platforms/cell/spufs/file.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-08-05 23:00:52 UTC
  • Revision ID: james.westby@ubuntu.com-20090805230052-7xedvqcyk9dnnxb2
Tags: 2.6.31-1.1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
568
568
        struct spu_lscsa *lscsa = ctx->csa.lscsa;
569
569
        int ret;
570
570
 
571
 
        size = min_t(ssize_t, sizeof lscsa->gprs - *pos, size);
572
 
        if (size <= 0)
 
571
        if (*pos >= sizeof(lscsa->gprs))
573
572
                return -EFBIG;
 
573
 
 
574
        size = min_t(ssize_t, sizeof(lscsa->gprs) - *pos, size);
574
575
        *pos += size;
575
576
 
576
577
        ret = spu_acquire_saved(ctx);
577
578
        if (ret)
578
579
                return ret;
579
580
 
580
 
        ret = copy_from_user(lscsa->gprs + *pos - size,
 
581
        ret = copy_from_user((char *)lscsa->gprs + *pos - size,
581
582
                             buffer, size) ? -EFAULT : size;
582
583
 
583
584
        spu_release_saved(ctx);
623
624
        struct spu_lscsa *lscsa = ctx->csa.lscsa;
624
625
        int ret;
625
626
 
 
627
        if (*pos >= sizeof(lscsa->fpcr))
 
628
                return -EFBIG;
 
629
 
626
630
        size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size);
627
 
        if (size <= 0)
628
 
                return -EFBIG;
629
631
 
630
632
        ret = spu_acquire_saved(ctx);
631
633
        if (ret)
2665
2667
        .release        = single_release,
2666
2668
};
2667
2669
 
2668
 
struct spufs_tree_descr spufs_dir_contents[] = {
 
2670
const struct spufs_tree_descr spufs_dir_contents[] = {
2669
2671
        { "capabilities", &spufs_caps_fops, 0444, },
2670
2672
        { "mem",  &spufs_mem_fops,  0666, LS_SIZE, },
2671
2673
        { "regs", &spufs_regs_fops,  0666, sizeof(struct spu_reg128[128]), },
2706
2708
        {},
2707
2709
};
2708
2710
 
2709
 
struct spufs_tree_descr spufs_dir_nosched_contents[] = {
 
2711
const struct spufs_tree_descr spufs_dir_nosched_contents[] = {
2710
2712
        { "capabilities", &spufs_caps_fops, 0444, },
2711
2713
        { "mem",  &spufs_mem_fops,  0666, LS_SIZE, },
2712
2714
        { "mbox", &spufs_mbox_fops, 0444, },
2731
2733
        {},
2732
2734
};
2733
2735
 
2734
 
struct spufs_tree_descr spufs_dir_debug_contents[] = {
 
2736
const struct spufs_tree_descr spufs_dir_debug_contents[] = {
2735
2737
        { ".ctx", &spufs_ctx_fops, 0444, },
2736
2738
        {},
2737
2739
};
2738
2740
 
2739
 
struct spufs_coredump_reader spufs_coredump_read[] = {
 
2741
const struct spufs_coredump_reader spufs_coredump_read[] = {
2740
2742
        { "regs", __spufs_regs_read, NULL, sizeof(struct spu_reg128[128])},
2741
2743
        { "fpcr", __spufs_fpcr_read, NULL, sizeof(struct spu_reg128) },
2742
2744
        { "lslr", NULL, spufs_lslr_get, 19 },