Date: Tue, 10 Apr 2012 13:37:43 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r234097 - stable/9/lib/libc/powerpc64/gen Message-ID: <201204101337.q3ADbhss025821@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Tue Apr 10 13:37:43 2012 New Revision: 234097 URL: http://svn.freebsd.org/changeset/base/234097 Log: MFC r234003: 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. Modified: stable/9/lib/libc/powerpc64/gen/makecontext.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/powerpc64/gen/makecontext.c ============================================================================== --- stable/9/lib/libc/powerpc64/gen/makecontext.c Tue Apr 10 13:31:38 2012 (r234096) +++ stable/9/lib/libc/powerpc64/gen/makecontext.c Tue Apr 10 13:37:43 2012 (r234097) @@ -111,7 +111,7 @@ __makecontext(ucontext_t *ucp, void (*st * 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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204101337.q3ADbhss025821>