aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c40
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h2
2 files changed, 17 insertions, 25 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 6095fb18dbb5..4cd34e53acaa 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -1085,9 +1085,8 @@ static void spufs_signal1_type_set(void *data, u64 val)
1085 spu_release(ctx); 1085 spu_release(ctx);
1086} 1086}
1087 1087
1088static u64 __spufs_signal1_type_get(void *data) 1088static u64 __spufs_signal1_type_get(struct spu_context *ctx)
1089{ 1089{
1090 struct spu_context *ctx = data;
1091 return ctx->ops->signal1_type_get(ctx); 1090 return ctx->ops->signal1_type_get(ctx);
1092} 1091}
1093 1092
@@ -1097,7 +1096,7 @@ static u64 spufs_signal1_type_get(void *data)
1097 u64 ret; 1096 u64 ret;
1098 1097
1099 spu_acquire(ctx); 1098 spu_acquire(ctx);
1100 ret = __spufs_signal1_type_get(data); 1099 ret = __spufs_signal1_type_get(ctx);
1101 spu_release(ctx); 1100 spu_release(ctx);
1102 1101
1103 return ret; 1102 return ret;
@@ -1114,9 +1113,8 @@ static void spufs_signal2_type_set(void *data, u64 val)
1114 spu_release(ctx); 1113 spu_release(ctx);
1115} 1114}
1116 1115
1117static u64 __spufs_signal2_type_get(void *data) 1116static u64 __spufs_signal2_type_get(struct spu_context *ctx)
1118{ 1117{
1119 struct spu_context *ctx = data;
1120 return ctx->ops->signal2_type_get(ctx); 1118 return ctx->ops->signal2_type_get(ctx);
1121} 1119}
1122 1120
@@ -1126,7 +1124,7 @@ static u64 spufs_signal2_type_get(void *data)
1126 u64 ret; 1124 u64 ret;
1127 1125
1128 spu_acquire(ctx); 1126 spu_acquire(ctx);
1129 ret = __spufs_signal2_type_get(data); 1127 ret = __spufs_signal2_type_get(ctx);
1130 spu_release(ctx); 1128 spu_release(ctx);
1131 1129
1132 return ret; 1130 return ret;
@@ -1629,9 +1627,8 @@ static void spufs_decr_set(void *data, u64 val)
1629 spu_release_saved(ctx); 1627 spu_release_saved(ctx);
1630} 1628}
1631 1629
1632static u64 __spufs_decr_get(void *data) 1630static u64 __spufs_decr_get(struct spu_context *ctx)
1633{ 1631{
1634 struct spu_context *ctx = data;
1635 struct spu_lscsa *lscsa = ctx->csa.lscsa; 1632 struct spu_lscsa *lscsa = ctx->csa.lscsa;
1636 return lscsa->decr.slot[0]; 1633 return lscsa->decr.slot[0];
1637} 1634}
@@ -1641,7 +1638,7 @@ static u64 spufs_decr_get(void *data)
1641 struct spu_context *ctx = data; 1638 struct spu_context *ctx = data;
1642 u64 ret; 1639 u64 ret;
1643 spu_acquire_saved(ctx); 1640 spu_acquire_saved(ctx);
1644 ret = __spufs_decr_get(data); 1641 ret = __spufs_decr_get(ctx);
1645 spu_release_saved(ctx); 1642 spu_release_saved(ctx);
1646 return ret; 1643 return ret;
1647} 1644}
@@ -1659,9 +1656,8 @@ static void spufs_decr_status_set(void *data, u64 val)
1659 spu_release_saved(ctx); 1656 spu_release_saved(ctx);
1660} 1657}
1661 1658
1662static u64 __spufs_decr_status_get(void *data) 1659static u64 __spufs_decr_status_get(struct spu_context *ctx)
1663{ 1660{
1664 struct spu_context *ctx = data;
1665 if (ctx->csa.priv2.mfc_control_RW & MFC_CNTL_DECREMENTER_RUNNING) 1661 if (ctx->csa.priv2.mfc_control_RW & MFC_CNTL_DECREMENTER_RUNNING)
1666 return SPU_DECR_STATUS_RUNNING; 1662 return SPU_DECR_STATUS_RUNNING;
1667 else 1663 else
@@ -1673,7 +1669,7 @@ static u64 spufs_decr_status_get(void *data)
1673 struct spu_context *ctx = data; 1669 struct spu_context *ctx = data;
1674 u64 ret; 1670 u64 ret;
1675 spu_acquire_saved(ctx); 1671 spu_acquire_saved(ctx);
1676 ret = __spufs_decr_status_get(data); 1672 ret = __spufs_decr_status_get(ctx);
1677 spu_release_saved(ctx); 1673 spu_release_saved(ctx);
1678 return ret; 1674 return ret;
1679} 1675}
@@ -1689,9 +1685,8 @@ static void spufs_event_mask_set(void *data, u64 val)
1689 spu_release_saved(ctx); 1685 spu_release_saved(ctx);
1690} 1686}
1691 1687
1692static u64 __spufs_event_mask_get(void *data) 1688static u64 __spufs_event_mask_get(struct spu_context *ctx)
1693{ 1689{
1694 struct spu_context *ctx = data;
1695 struct spu_lscsa *lscsa = ctx->csa.lscsa; 1690 struct spu_lscsa *lscsa = ctx->csa.lscsa;
1696 return lscsa->event_mask.slot[0]; 1691 return lscsa->event_mask.slot[0];
1697} 1692}
@@ -1701,16 +1696,15 @@ static u64 spufs_event_mask_get(void *data)
1701 struct spu_context *ctx = data; 1696 struct spu_context *ctx = data;
1702 u64 ret; 1697 u64 ret;
1703 spu_acquire_saved(ctx); 1698 spu_acquire_saved(ctx);
1704 ret = __spufs_event_mask_get(data); 1699 ret = __spufs_event_mask_get(ctx);
1705 spu_release_saved(ctx); 1700 spu_release_saved(ctx);
1706 return ret; 1701 return ret;
1707} 1702}
1708DEFINE_SIMPLE_ATTRIBUTE(spufs_event_mask_ops, spufs_event_mask_get, 1703DEFINE_SIMPLE_ATTRIBUTE(spufs_event_mask_ops, spufs_event_mask_get,
1709 spufs_event_mask_set, "0x%llx\n") 1704 spufs_event_mask_set, "0x%llx\n")
1710 1705
1711static u64 __spufs_event_status_get(void *data) 1706static u64 __spufs_event_status_get(struct spu_context *ctx)
1712{ 1707{
1713 struct spu_context *ctx = data;
1714 struct spu_state *state = &ctx->csa; 1708 struct spu_state *state = &ctx->csa;
1715 u64 stat; 1709 u64 stat;
1716 stat = state->spu_chnlcnt_RW[0]; 1710 stat = state->spu_chnlcnt_RW[0];
@@ -1725,7 +1719,7 @@ static u64 spufs_event_status_get(void *data)
1725 u64 ret = 0; 1719 u64 ret = 0;
1726 1720
1727 spu_acquire_saved(ctx); 1721 spu_acquire_saved(ctx);
1728 ret = __spufs_event_status_get(data); 1722 ret = __spufs_event_status_get(ctx);
1729 spu_release_saved(ctx); 1723 spu_release_saved(ctx);
1730 return ret; 1724 return ret;
1731} 1725}
@@ -1770,16 +1764,15 @@ static u64 spufs_id_get(void *data)
1770} 1764}
1771DEFINE_SIMPLE_ATTRIBUTE(spufs_id_ops, spufs_id_get, NULL, "0x%llx\n") 1765DEFINE_SIMPLE_ATTRIBUTE(spufs_id_ops, spufs_id_get, NULL, "0x%llx\n")
1772 1766
1773static u64 __spufs_object_id_get(void *data) 1767static u64 __spufs_object_id_get(struct spu_context *ctx)
1774{ 1768{
1775 struct spu_context *ctx = data;
1776 return ctx->object_id; 1769 return ctx->object_id;
1777} 1770}
1778 1771
1779static u64 spufs_object_id_get(void *data) 1772static u64 spufs_object_id_get(void *data)
1780{ 1773{
1781 /* FIXME: Should there really be no locking here? */ 1774 /* FIXME: Should there really be no locking here? */
1782 return __spufs_object_id_get(data); 1775 return __spufs_object_id_get((struct spu_context *)data);
1783} 1776}
1784 1777
1785static void spufs_object_id_set(void *data, u64 id) 1778static void spufs_object_id_set(void *data, u64 id)
@@ -1791,9 +1784,8 @@ static void spufs_object_id_set(void *data, u64 id)
1791DEFINE_SIMPLE_ATTRIBUTE(spufs_object_id_ops, spufs_object_id_get, 1784DEFINE_SIMPLE_ATTRIBUTE(spufs_object_id_ops, spufs_object_id_get,
1792 spufs_object_id_set, "0x%llx\n"); 1785 spufs_object_id_set, "0x%llx\n");
1793 1786
1794static u64 __spufs_lslr_get(void *data) 1787static u64 __spufs_lslr_get(struct spu_context *ctx)
1795{ 1788{
1796 struct spu_context *ctx = data;
1797 return ctx->csa.priv2.spu_lslr_RW; 1789 return ctx->csa.priv2.spu_lslr_RW;
1798} 1790}
1799 1791
@@ -1803,7 +1795,7 @@ static u64 spufs_lslr_get(void *data)
1803 u64 ret; 1795 u64 ret;
1804 1796
1805 spu_acquire_saved(ctx); 1797 spu_acquire_saved(ctx);
1806 ret = __spufs_lslr_get(data); 1798 ret = __spufs_lslr_get(ctx);
1807 spu_release_saved(ctx); 1799 spu_release_saved(ctx);
1808 1800
1809 return ret; 1801 return ret;
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 3dbffebb3cef..f869a4b488b0 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -296,7 +296,7 @@ struct spufs_coredump_reader {
296 char *name; 296 char *name;
297 ssize_t (*read)(struct spu_context *ctx, 297 ssize_t (*read)(struct spu_context *ctx,
298 char __user *buffer, size_t size, loff_t *pos); 298 char __user *buffer, size_t size, loff_t *pos);
299 u64 (*get)(void *data); 299 u64 (*get)(struct spu_context *ctx);
300 size_t size; 300 size_t size;
301}; 301};
302extern struct spufs_coredump_reader spufs_coredump_read[]; 302extern struct spufs_coredump_reader spufs_coredump_read[];