aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/booke/swtch.S
diff options
context:
space:
mode:
Diffstat (limited to 'sys/powerpc/booke/swtch.S')
-rw-r--r--sys/powerpc/booke/swtch.S5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/powerpc/booke/swtch.S b/sys/powerpc/booke/swtch.S
index 80bf2b3a459a..bfd7dd2c2204 100644
--- a/sys/powerpc/booke/swtch.S
+++ b/sys/powerpc/booke/swtch.S
@@ -66,6 +66,7 @@
#include <machine/param.h>
#include <machine/psl.h>
#include <machine/asm.h>
+#include <machine/spr.h>
/*
* void cpu_switch(struct thread *old, struct thread *new)
@@ -87,6 +88,8 @@ ENTRY(cpu_switch)
stw %r16, PCB_BOOKE_CTR(%r5)
mfxer %r16
stw %r16, PCB_BOOKE_XER(%r5)
+ mfspr %r16, SPR_DBCR0
+ stw %r16, PCB_BOOKE_DBCR0(%r5)
stw %r1, PCB_SP(%r5) /* Save the stack pointer */
@@ -114,6 +117,8 @@ ENTRY(cpu_switch)
mtctr %r5
lwz %r5, PCB_BOOKE_XER(%r3)
mtxer %r5
+ lwz %r5, PCB_BOOKE_DBCR0(%r3)
+ mtspr SPR_DBCR0, %r5
lwz %r1, PCB_SP(%r3) /* Load the stack pointer */
blr