aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/cell/spufs/switch.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c
index 4210ec2cb4ca..85bea06e798b 100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -622,12 +622,17 @@ static inline void save_ppuint_mb(struct spu_state *csa, struct spu *spu)
622static inline void save_ch_part1(struct spu_state *csa, struct spu *spu) 622static inline void save_ch_part1(struct spu_state *csa, struct spu *spu)
623{ 623{
624 struct spu_priv2 __iomem *priv2 = spu->priv2; 624 struct spu_priv2 __iomem *priv2 = spu->priv2;
625 u64 idx, ch_indices[7] = { 0UL, 1UL, 3UL, 4UL, 24UL, 25UL, 27UL }; 625 u64 idx, ch_indices[7] = { 0UL, 3UL, 4UL, 24UL, 25UL, 27UL };
626 int i; 626 int i;
627 627
628 /* Save, Step 42: 628 /* Save, Step 42:
629 * Save the following CH: [0,1,3,4,24,25,27]
630 */ 629 */
630
631 /* Save CH 1, without channel count */
632 out_be64(&priv2->spu_chnlcntptr_RW, 1);
633 csa->spu_chnldata_RW[1] = in_be64(&priv2->spu_chnldata_RW);
634
635 /* Save the following CH: [0,3,4,24,25,27] */
631 for (i = 0; i < 7; i++) { 636 for (i = 0; i < 7; i++) {
632 idx = ch_indices[i]; 637 idx = ch_indices[i];
633 out_be64(&priv2->spu_chnlcntptr_RW, idx); 638 out_be64(&priv2->spu_chnlcntptr_RW, idx);
@@ -1105,13 +1110,18 @@ static inline void clear_spu_status(struct spu_state *csa, struct spu *spu)
1105static inline void reset_ch_part1(struct spu_state *csa, struct spu *spu) 1110static inline void reset_ch_part1(struct spu_state *csa, struct spu *spu)
1106{ 1111{
1107 struct spu_priv2 __iomem *priv2 = spu->priv2; 1112 struct spu_priv2 __iomem *priv2 = spu->priv2;
1108 u64 ch_indices[7] = { 0UL, 1UL, 3UL, 4UL, 24UL, 25UL, 27UL }; 1113 u64 ch_indices[7] = { 0UL, 3UL, 4UL, 24UL, 25UL, 27UL };
1109 u64 idx; 1114 u64 idx;
1110 int i; 1115 int i;
1111 1116
1112 /* Restore, Step 20: 1117 /* Restore, Step 20:
1113 * Reset the following CH: [0,1,3,4,24,25,27]
1114 */ 1118 */
1119
1120 /* Reset CH 1 */
1121 out_be64(&priv2->spu_chnlcntptr_RW, 1);
1122 out_be64(&priv2->spu_chnldata_RW, 0UL);
1123
1124 /* Reset the following CH: [0,3,4,24,25,27] */
1115 for (i = 0; i < 7; i++) { 1125 for (i = 0; i < 7; i++) {
1116 idx = ch_indices[i]; 1126 idx = ch_indices[i];
1117 out_be64(&priv2->spu_chnlcntptr_RW, idx); 1127 out_be64(&priv2->spu_chnlcntptr_RW, idx);
@@ -1572,12 +1582,17 @@ static inline void restore_decr_wrapped(struct spu_state *csa, struct spu *spu)
1572static inline void restore_ch_part1(struct spu_state *csa, struct spu *spu) 1582static inline void restore_ch_part1(struct spu_state *csa, struct spu *spu)
1573{ 1583{
1574 struct spu_priv2 __iomem *priv2 = spu->priv2; 1584 struct spu_priv2 __iomem *priv2 = spu->priv2;
1575 u64 idx, ch_indices[7] = { 0UL, 1UL, 3UL, 4UL, 24UL, 25UL, 27UL }; 1585 u64 idx, ch_indices[7] = { 0UL, 3UL, 4UL, 24UL, 25UL, 27UL };
1576 int i; 1586 int i;
1577 1587
1578 /* Restore, Step 59: 1588 /* Restore, Step 59:
1579 * Restore the following CH: [0,1,3,4,24,25,27]
1580 */ 1589 */
1590
1591 /* Restore CH 1 without count */
1592 out_be64(&priv2->spu_chnlcntptr_RW, 1);
1593 out_be64(&priv2->spu_chnldata_RW, csa->spu_chnldata_RW[1]);
1594
1595 /* Restore the following CH: [0,3,4,24,25,27] */
1581 for (i = 0; i < 7; i++) { 1596 for (i = 0; i < 7; i++) {
1582 idx = ch_indices[i]; 1597 idx = ch_indices[i];
1583 out_be64(&priv2->spu_chnlcntptr_RW, idx); 1598 out_be64(&priv2->spu_chnlcntptr_RW, idx);