summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/powerpc
diff options
context:
space:
mode:
authorjhibbits <jhibbits@FreeBSD.org>2015-10-06 01:24:46 +0000
committerjhibbits <jhibbits@FreeBSD.org>2015-10-06 01:24:46 +0000
commitc3c1533b787ea7520103e13da636bdb284667002 (patch)
treee669bb692960bdd0a13f95d6e03d1aaaafb9a22b /sys/powerpc/powerpc
parented7617dae96114c195346c570cbdee8081d7c9e9 (diff)
downloadFreeBSD-src-c3c1533b787ea7520103e13da636bdb284667002.zip
FreeBSD-src-c3c1533b787ea7520103e13da636bdb284667002.tar.gz
Save the link register in savectx().
Pointed out by: jhb
Diffstat (limited to 'sys/powerpc/powerpc')
-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 12b1bc0..e839462 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 b785281..d2f6863 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
/*
OpenPOWER on IntegriCloud