aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2015-10-06 01:24:46 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2015-10-06 01:24:46 +0000
commitdb0d64f24ae73554f7013132f91c8556f9e97ebb (patch)
treee669bb692960bdd0a13f95d6e03d1aaaafb9a22b /sys
parent777f366fb635ac3f08773b9c002698e3adb4ee66 (diff)
downloadsrc-db0d64f24ae73554f7013132f91c8556f9e97ebb.tar.gz
src-db0d64f24ae73554f7013132f91c8556f9e97ebb.zip
Save the link register in savectx().
Pointed out by: jhb
Notes
Notes: svn path=/head/; revision=288909
Diffstat (limited to 'sys')
-rw-r--r--sys/powerpc/powerpc/swtch32.S2
-rw-r--r--sys/powerpc/powerpc/swtch64.S2
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/powerpc/powerpc/swtch32.S b/sys/powerpc/powerpc/swtch32.S
index 12b1bc03a399..e8394625bcf5 100644
--- a/sys/powerpc/powerpc/swtch32.S
+++ b/sys/powerpc/powerpc/swtch32.S
@@ -187,6 +187,8 @@ ENTRY(savectx)
stmw %r12,PCB_CONTEXT(%r3) /* Save the non-volatile GP regs */
mfcr %r4 /* Save the condition register */
stw %r4,PCB_CR(%r3)
+ mflr %r4 /* Save the link register */
+ stw %r4,PCB_LR(%r3)
blr
/*
diff --git a/sys/powerpc/powerpc/swtch64.S b/sys/powerpc/powerpc/swtch64.S
index b785281b2888..d2f686372b1d 100644
--- a/sys/powerpc/powerpc/swtch64.S
+++ b/sys/powerpc/powerpc/swtch64.S
@@ -255,6 +255,8 @@ ENTRY(savectx)
mfcr %r4 /* Save the condition register */
std %r4,PCB_CR(%r3)
std %r2,PCB_TOC(%r3) /* Save the TOC pointer */
+ mflr %r4 /* Save the link register */
+ std %r4,PCB_LR(%r3)
blr
/*