summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh3/entry.S
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-03-06 09:47:02 +0000
committerPaul Mundt <lethal@linux-sh.org>2009-03-10 12:55:40 +0900
commit2ef7f0dab6b3d171b6aff00a47077385ae3155b5 (patch)
tree6066996e7dfc65b02470ae4c1c96c6c7c70965a6 /arch/sh/kernel/cpu/sh3/entry.S
parentedab56f4c90f45ba4e61d06d3fc9658da4e94bde (diff)
sh: hibernation support
Add Suspend-to-disk / swsusp / CONFIG_HIBERNATION support to the SuperH architecture. To suspend, use "swapon /dev/sda2; echo disk > /sys/power/state" To resume, pass "resume=/dev/sda2" on the kernel command line. The patch "pm: rework includes, remove arch ifdefs V2" is needed to allow the generic swsusp code to build properly. Hibernation is not enabled with this patch though, a patch setting ARCH_HIBERNATION_POSSIBLE will be submitted later. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh3/entry.S')
-rw-r--r--arch/sh/kernel/cpu/sh3/entry.S22
1 files changed, 17 insertions, 5 deletions
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S
index c4829d6dee5..fba6ac20bb1 100644
--- a/arch/sh/kernel/cpu/sh3/entry.S
+++ b/arch/sh/kernel/cpu/sh3/entry.S
@@ -216,7 +216,7 @@ ENTRY(sh_bios_handler)
! r9 trashed
! BL=0 on entry, on exit BL=1 (depending on r8).
-restore_regs:
+ENTRY(restore_regs)
mov.l @r15+, r0
mov.l @r15+, r1
mov.l @r15+, r2
@@ -362,8 +362,10 @@ general_exception:
nop
! Save registers / Switch to bank 0
+ mov.l k4, k2 ! keep vector in k2
+ mov.l 1f, k4 ! SR bits to clear in k4
bsr save_regs ! needs original pr value in k3
- mov k4, k2 ! keep vector in k2
+ nop
bra handle_exception_special
nop
@@ -471,6 +473,7 @@ handle_exception:
! Save registers / Switch to bank 0
mov.l 5f, k2 ! vector register address
+ mov.l 1f, k4 ! SR bits to clear in k4
bsr save_regs ! needs original pr value in k3
mov.l @k2, k2 ! read out vector and keep in k2
@@ -495,10 +498,10 @@ handle_exception_special:
! k0 contains original stack pointer*
! k1 trashed
! k3 passes original pr*
-! k4 trashed
+! k4 passes SR bitmask
! BL=1 on entry, on exit BL=0.
-save_regs:
+ENTRY(save_regs)
mov #-1, r1
mov.l k1, @-r15 ! set TRA (default: -1)
sts.l macl, @-r15
@@ -518,8 +521,16 @@ save_regs:
mov.l r8, @-r15
mov.l 0f, k3 ! SR bits to set in k3
- mov.l 1f, k4 ! SR bits to clear in k4
+ ! fall-through
+
+! save_low_regs()
+! - modify SR for bank switch
+! - save r7, r6, r5, r4, r3, r2, r1, r0 on the stack
+! k3 passes bits to set in SR
+! k4 passes bits to clear in SR
+
+ENTRY(save_low_regs)
stc sr, r8
or k3, r8
and k4, r8
@@ -565,6 +576,7 @@ ENTRY(handle_interrupt)
PREF(k0)
! Save registers / Switch to bank 0
+ mov.l 1f, k4 ! SR bits to clear in k4
bsr save_regs ! needs original pr value in k3
mov #-1, k2 ! default vector kept in k2