summaryrefslogtreecommitdiffstats
path: root/lib/libc/powerpc64
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2012-04-07 22:28:50 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2012-04-07 22:28:50 +0000
commit07f16a905d18f1cd138abc999c10c0cbf62a72cc (patch)
tree9e41fd6fab4c7ec72abd692fb3deaf2f6b558b68 /lib/libc/powerpc64
parent75744aafa6065b399e52414e87808d1ab2bd5979 (diff)
downloadFreeBSD-src-07f16a905d18f1cd138abc999c10c0cbf62a72cc.zip
FreeBSD-src-07f16a905d18f1cd138abc999c10c0cbf62a72cc.tar.gz
Properly resolve the _ctx_start function descriptor (the symbol _ctx_start
is a descriptor, not a code address), which prevents crashes when starting a context. This fixes QEMU on powerpc64. MFC after: 3 days
Diffstat (limited to 'lib/libc/powerpc64')
-rw-r--r--lib/libc/powerpc64/gen/makecontext.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/powerpc64/gen/makecontext.c b/lib/libc/powerpc64/gen/makecontext.c
index 6d980f3..b01c5c1 100644
--- a/lib/libc/powerpc64/gen/makecontext.c
+++ b/lib/libc/powerpc64/gen/makecontext.c
@@ -111,7 +111,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...)
* Use caller-saved regs 14/15 to hold params that _ctx_start
* will use to invoke the user-supplied func
*/
- mc->mc_srr0 = (uintptr_t) _ctx_start;
+ mc->mc_srr0 = *(uintptr_t *)_ctx_start;
mc->mc_gpr[1] = (uintptr_t) sp; /* new stack pointer */
mc->mc_gpr[14] = (uintptr_t) start; /* r14 <- start */
mc->mc_gpr[15] = (uintptr_t) ucp; /* r15 <- ucp */
OpenPOWER on IntegriCloud