summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-06-30 11:12:08 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-06-30 11:12:08 +0000
commit045cd8195f5d8e171d6ccfbaf6893896fce25f79 (patch)
tree3deecd3c8c0d280e8daf7fbe7836b1ff415954bb /lib
parent93446bd9344cff2b791abac9acc466802388a210 (diff)
Add missing comparison instruction. Load %r12 with the indirect branch
address to load the correct TOC address.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/arch/powerpc64/sys/tfork_thread.S4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/arch/powerpc64/sys/tfork_thread.S b/lib/libc/arch/powerpc64/sys/tfork_thread.S
index 0968077b847..ba64ca63b4e 100644
--- a/lib/libc/arch/powerpc64/sys/tfork_thread.S
+++ b/lib/libc/arch/powerpc64/sys/tfork_thread.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: tfork_thread.S,v 1.1 2020/06/25 02:38:28 drahn Exp $ */
+/* $OpenBSD: tfork_thread.S,v 1.2 2020/06/30 11:12:07 kettenis Exp $ */
/*
* Copyright (c) 2005 Tim Wiess <tim@nop.cx>
@@ -22,6 +22,7 @@ ENTRY(__tfork_thread)
/* call __tfork */
li %r0, SYS___tfork
sc
+ cmpwi %r0, 0
bne 1f
/* check if we are parent or child */
@@ -29,6 +30,7 @@ ENTRY(__tfork_thread)
bnelr
/* child */
+ mr %r12, %r5
mtlr %r5 /* fp */
mr %r3, %r6 /* arg */
subi %r1, %r1, 32 /* fixup sp to get headroom */