diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-08-20 01:02:20 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-08-20 01:02:20 -0400 |
commit | 485f0720c3e0f57deac403acfbf078a89baeb6ba (patch) | |
tree | 763e04f149fb17683f3f1353ec517c11c53bc8c2 /arch/sh/include/asm/system_32.h | |
parent | 6503fe4a6508673c15a509ec4ac3ca5979ae9593 (diff) |
sh: DSP save/restore ordering and a0 sign extension fixups.
As an excellent indicator of how much testing the DSP code gets, a couple
of rather glaring bugs in the DSP save/restore paths were found:
- In the DSP restore case a0 needs to be popped off before a0g,
or the value of a0g is clobbered by the MSB of a0 in the case
of sign extension.
- Beyond that, the save and restore orders were out of sync,
so this fixes that up as well. At the same time, we switch over
to using movs.l for both the save and restore of the general DSP
registers as opposed to using sts.l (which was initially put in
place to work around a bug in ancient binutils versions which
the kernel no longer supports).
Reported-by: Chee Soon Yip <yip.cheesoon@renesas.com>
Cc: Chu Lih Kwek <kwek.chulih@renesas.com>,
Cc: General Lai <general.lai@renesas.com>,
Cc: Robert Cozens <Robert.Cozens@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/system_32.h')
-rw-r--r-- | arch/sh/include/asm/system_32.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/sh/include/asm/system_32.h b/arch/sh/include/asm/system_32.h index 6c68a51f1cc5..81e0d668eefd 100644 --- a/arch/sh/include/asm/system_32.h +++ b/arch/sh/include/asm/system_32.h | |||
@@ -14,12 +14,12 @@ do { \ | |||
14 | (u32 *)&tsk->thread.dsp_status; \ | 14 | (u32 *)&tsk->thread.dsp_status; \ |
15 | __asm__ __volatile__ ( \ | 15 | __asm__ __volatile__ ( \ |
16 | ".balign 4\n\t" \ | 16 | ".balign 4\n\t" \ |
17 | "movs.l @r2+, a0\n\t" \ | ||
17 | "movs.l @r2+, a1\n\t" \ | 18 | "movs.l @r2+, a1\n\t" \ |
18 | "movs.l @r2+, a0g\n\t" \ | 19 | "movs.l @r2+, a0g\n\t" \ |
19 | "movs.l @r2+, a1g\n\t" \ | 20 | "movs.l @r2+, a1g\n\t" \ |
20 | "movs.l @r2+, m0\n\t" \ | 21 | "movs.l @r2+, m0\n\t" \ |
21 | "movs.l @r2+, m1\n\t" \ | 22 | "movs.l @r2+, m1\n\t" \ |
22 | "movs.l @r2+, a0\n\t" \ | ||
23 | "movs.l @r2+, x0\n\t" \ | 23 | "movs.l @r2+, x0\n\t" \ |
24 | "movs.l @r2+, x1\n\t" \ | 24 | "movs.l @r2+, x1\n\t" \ |
25 | "movs.l @r2+, y0\n\t" \ | 25 | "movs.l @r2+, y0\n\t" \ |
@@ -39,20 +39,20 @@ do { \ | |||
39 | \ | 39 | \ |
40 | __asm__ __volatile__ ( \ | 40 | __asm__ __volatile__ ( \ |
41 | ".balign 4\n\t" \ | 41 | ".balign 4\n\t" \ |
42 | "stc.l mod, @-r2\n\t" \ | 42 | "stc.l mod, @-r2\n\t" \ |
43 | "stc.l re, @-r2\n\t" \ | 43 | "stc.l re, @-r2\n\t" \ |
44 | "stc.l rs, @-r2\n\t" \ | 44 | "stc.l rs, @-r2\n\t" \ |
45 | "sts.l dsr, @-r2\n\t" \ | 45 | "sts.l dsr, @-r2\n\t" \ |
46 | "sts.l y1, @-r2\n\t" \ | 46 | "movs.l y1, @-r2\n\t" \ |
47 | "sts.l y0, @-r2\n\t" \ | 47 | "movs.l y0, @-r2\n\t" \ |
48 | "sts.l x1, @-r2\n\t" \ | 48 | "movs.l x1, @-r2\n\t" \ |
49 | "sts.l x0, @-r2\n\t" \ | 49 | "movs.l x0, @-r2\n\t" \ |
50 | "sts.l a0, @-r2\n\t" \ | 50 | "movs.l m1, @-r2\n\t" \ |
51 | ".word 0xf653 ! movs.l a1, @-r2\n\t" \ | 51 | "movs.l m0, @-r2\n\t" \ |
52 | ".word 0xf6f3 ! movs.l a0g, @-r2\n\t" \ | 52 | "movs.l a1g, @-r2\n\t" \ |
53 | ".word 0xf6d3 ! movs.l a1g, @-r2\n\t" \ | 53 | "movs.l a0g, @-r2\n\t" \ |
54 | ".word 0xf6c3 ! movs.l m0, @-r2\n\t" \ | 54 | "movs.l a1, @-r2\n\t" \ |
55 | ".word 0xf6e3 ! movs.l m1, @-r2\n\t" \ | 55 | "movs.l a0, @-r2\n\t" \ |
56 | : : "r" (__ts2)); \ | 56 | : : "r" (__ts2)); \ |
57 | } while (0) | 57 | } while (0) |
58 | 58 | ||