diff options
author | Masato Noguchi <Masato.Noguchi@jp.sony.com> | 2007-07-20 15:39:37 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@klappe.arndb.de> | 2007-07-20 15:41:55 -0400 |
commit | 1cfc0f86eb0348dd04ace8c2171642ebe9cd87bb (patch) | |
tree | 4d7d4de86d020eab3c00975117f8e2b4745f995b /arch/powerpc/platforms/cell/spufs/switch.c | |
parent | cfd529b25d9b1d48423b85d76066348e2459e646 (diff) |
[CELL] spufs: fix decr_status meanings
The decr_status in the LSCSA is confusedly used as two meanings:
* SPU decrementer was running
* SPU decrementer was wrapped as a result of adjust
and the code to set decr_status is missing.
This patch fixes these problems by using the decr_status argument as a
set of flags. This requires a rebuild of the shipped spu_restore code.
Signed-off-by: Masato Noguchi <Masato.Noguchi@jp.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/switch.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/switch.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c index a08fe93817f6..d4dea1874847 100644 --- a/arch/powerpc/platforms/cell/spufs/switch.c +++ b/arch/powerpc/platforms/cell/spufs/switch.c | |||
@@ -1285,7 +1285,15 @@ static inline void setup_decr(struct spu_state *csa, struct spu *spu) | |||
1285 | cycles_t resume_time = get_cycles(); | 1285 | cycles_t resume_time = get_cycles(); |
1286 | cycles_t delta_time = resume_time - csa->suspend_time; | 1286 | cycles_t delta_time = resume_time - csa->suspend_time; |
1287 | 1287 | ||
1288 | csa->lscsa->decr_status.slot[0] = SPU_DECR_STATUS_RUNNING; | ||
1289 | if (csa->lscsa->decr.slot[0] < delta_time) { | ||
1290 | csa->lscsa->decr_status.slot[0] |= | ||
1291 | SPU_DECR_STATUS_WRAPPED; | ||
1292 | } | ||
1293 | |||
1288 | csa->lscsa->decr.slot[0] -= delta_time; | 1294 | csa->lscsa->decr.slot[0] -= delta_time; |
1295 | } else { | ||
1296 | csa->lscsa->decr_status.slot[0] = 0; | ||
1289 | } | 1297 | } |
1290 | } | 1298 | } |
1291 | 1299 | ||
@@ -1544,10 +1552,10 @@ static inline void restore_decr_wrapped(struct spu_state *csa, struct spu *spu) | |||
1544 | * "wrapped" flag is set, OR in a '1' to | 1552 | * "wrapped" flag is set, OR in a '1' to |
1545 | * CSA.SPU_Event_Status[Tm]. | 1553 | * CSA.SPU_Event_Status[Tm]. |
1546 | */ | 1554 | */ |
1547 | if (csa->lscsa->decr_status.slot[0] == 1) { | 1555 | if (csa->lscsa->decr_status.slot[0] & SPU_DECR_STATUS_WRAPPED) { |
1548 | csa->spu_chnldata_RW[0] |= 0x20; | 1556 | csa->spu_chnldata_RW[0] |= 0x20; |
1549 | } | 1557 | } |
1550 | if ((csa->lscsa->decr_status.slot[0] == 1) && | 1558 | if ((csa->lscsa->decr_status.slot[0] & SPU_DECR_STATUS_WRAPPED) && |
1551 | (csa->spu_chnlcnt_RW[0] == 0 && | 1559 | (csa->spu_chnlcnt_RW[0] == 0 && |
1552 | ((csa->spu_chnldata_RW[2] & 0x20) == 0x0) && | 1560 | ((csa->spu_chnldata_RW[2] & 0x20) == 0x0) && |
1553 | ((csa->spu_chnldata_RW[0] & 0x20) != 0x1))) { | 1561 | ((csa->spu_chnldata_RW[0] & 0x20) != 0x1))) { |