From 90ec01758b35be9a782bc6ea5c5b48aa6fac7e0d Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 22 Dec 2011 11:13:45 -0800 Subject: [PATCH] libc - fix mcontext issues * Fix incorrect register use in _get_mcontext() left over from the 32-bit port to 64-bits. * This routine is only (currently) used by a few pkgsrc packages. --- lib/libc/x86_64/gen/mcontext.S | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libc/x86_64/gen/mcontext.S b/lib/libc/x86_64/gen/mcontext.S index ea31674adb..a86889e1c3 100644 --- a/lib/libc/x86_64/gen/mcontext.S +++ b/lib/libc/x86_64/gen/mcontext.S @@ -32,7 +32,7 @@ /* * int get_mcontext(mcontext_t *mcp : rdi) * - * Copy the caller's context into the mcontext, %eax excepted. + * Copy the caller's context into the mcontext, %rax excepted. */ .weak get_mcontext .set get_mcontext,_get_mcontext @@ -66,11 +66,11 @@ ENTRY(_get_mcontext) * Saved stack pointer as if we had returned from this * procedure. */ - movq %rsp,MC_RSP(%eax) - addq $8,MC_RSP(%eax) + movq %rsp,MC_RSP(%rdi) + addq $8,MC_RSP(%rdi) /* - * Save eflags + * Save rflags * XXX */ @@ -89,7 +89,7 @@ ENTRY(_get_mcontext) /* * Set MC_LEN */ - movl $SIZEOF_MCONTEXT_T,MC_LEN(%eax) + movl $SIZEOF_MCONTEXT_T,MC_LEN(%rdi) /* * Return 0 -- 2.41.0