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/sys Don't hardcode offset in assembler. Th...



details:   https://anonhg.NetBSD.org/src/rev/c9a0d57bcaf9
branches:  trunk
changeset: 786523:c9a0d57bcaf9
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Apr 30 15:59:34 2013 +0000

description:
Don't hardcode offset in assembler. This ensures the return value in the
context is the correct value (0) on earm*

diffstat:

 lib/libc/arch/arm/sys/getcontext.S |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 4bb9cdfe2e7b -r c9a0d57bcaf9 lib/libc/arch/arm/sys/getcontext.S
--- a/lib/libc/arch/arm/sys/getcontext.S        Tue Apr 30 15:48:29 2013 +0000
+++ b/lib/libc/arch/arm/sys/getcontext.S        Tue Apr 30 15:59:34 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getcontext.S,v 1.6 2008/04/28 20:22:55 martin Exp $    */
+/*     $NetBSD: getcontext.S,v 1.7 2013/04/30 15:59:34 skrll Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "SYS.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-       RCSID("$NetBSD: getcontext.S,v 1.6 2008/04/28 20:22:55 martin Exp $")
+       RCSID("$NetBSD: getcontext.S,v 1.7 2013/04/30 15:59:34 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 #ifdef WEAK_ALIAS
@@ -43,12 +43,12 @@
        mov     r2, r0                  /* Must save argument pointer. */
        SYSTRAP (getcontext)
        bcs     PIC_SYM(CERROR, PLT)
-       str     lr, [r2, #(36 + 15*4)]  /* Adjust PC. */
+       str     lr, [r2, #_UC_REGS_PC]  /* Adjust PC. */
 #ifdef SOFTFLOAT
        /* Ahem. */
        /* Judging from the softfloat code we should at least save
           the exception codes and rounding mode here. */
 #endif
        mov     r0, #0
-       str     r0, [r2, #(36 + 0*4)]   /* Return 0. */
+       str     r0, [r2, #_UC_REGS_R0]  /* Return 0. */
        RET



Home | Main Index | Thread Index | Old Index