Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/arch/arm/gen Fixup the stack pointer in the ucontex...



details:   https://anonhg.NetBSD.org/src/rev/d594b45d12f0
branches:  trunk
changeset: 781745:d594b45d12f0
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Sep 27 09:53:53 2012 +0000

description:
Fixup the stack pointer in the ucontext returned by getcontext.

This fixes the following tests

        lib/libc/sys/t_swapcontext.c
        lib/libpthread/t_swapcontext.c

diffstat:

 lib/libc/arch/arm/gen/swapcontext.S |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 799621887840 -r d594b45d12f0 lib/libc/arch/arm/gen/swapcontext.S
--- a/lib/libc/arch/arm/gen/swapcontext.S       Thu Sep 27 08:19:18 2012 +0000
+++ b/lib/libc/arch/arm/gen/swapcontext.S       Thu Sep 27 09:53:53 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: swapcontext.S,v 1.6 2012/08/05 05:10:38 skrll Exp $    */
+/*     $NetBSD: swapcontext.S,v 1.7 2012/09/27 09:53:53 skrll Exp $    */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "SYS.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-        RCSID("$NetBSD: swapcontext.S,v 1.6 2012/08/05 05:10:38 skrll Exp $")
+        RCSID("$NetBSD: swapcontext.S,v 1.7 2012/09/27 09:53:53 skrll Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 ENTRY(swapcontext)
@@ -43,6 +43,7 @@
        add     sp, #4
        ldmfd   sp!, {r0-r1, lr}
        RETc(ne)
+       str     sp, [r0, #(36 + 13*4)]  /* Adjust saved SP. */
        str     lr, [r0, #(36 + 15*4)]  /* Adjust saved PC. */
 #ifdef SOFTFLOAT
        /* Ahem. */



Home | Main Index | Thread Index | Old Index