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 Actually fail if the magic number is f...
details: https://anonhg.NetBSD.org/src/rev/a59683227822
branches: trunk
changeset: 786188:a59683227822
user: skrll <skrll%NetBSD.org@localhost>
date: Fri Apr 19 13:14:10 2013 +0000
description:
Actually fail if the magic number is found to be wrong in __longjmp.
Avoid overwriting the {,_}longjmp return value in __ARM_EABI__
ok matt@
diffstat:
lib/libc/arch/arm/gen/_setjmp.S | 10 +++++-----
lib/libc/arch/arm/gen/setjmp.S | 11 ++++++-----
2 files changed, 11 insertions(+), 10 deletions(-)
diffs (56 lines):
diff -r 9f7c8d5222cc -r a59683227822 lib/libc/arch/arm/gen/_setjmp.S
--- a/lib/libc/arch/arm/gen/_setjmp.S Fri Apr 19 10:41:53 2013 +0000
+++ b/lib/libc/arch/arm/gen/_setjmp.S Fri Apr 19 13:14:10 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: _setjmp.S,v 1.10 2013/01/29 19:23:09 matt Exp $ */
+/* $NetBSD: _setjmp.S,v 1.11 2013/04/19 13:14:10 skrll Exp $ */
/*
* Copyright (c) 1997 Mark Brinicombe
@@ -107,10 +107,10 @@
#ifdef __ARM_EABI__
teq r3, r2 /* did magic change? */
beq 1f /* no, don't restore VFP */
- add r1, r0, #(_JB_REG_D8 * 4)
- vldmia r1, {d8-d15}
- ldr r1, [r0, #(_JB_REG_FPSCR * 4)]
- vmsr fpscr, r1
+ add ip, r0, #(_JB_REG_D8 * 4)
+ vldmia ip, {d8-d15}
+ ldr ip, [r0, #(_JB_REG_FPSCR * 4)]
+ vmsr fpscr, ip
1:
#endif /* __ARM_EABI__ */
diff -r 9f7c8d5222cc -r a59683227822 lib/libc/arch/arm/gen/setjmp.S
--- a/lib/libc/arch/arm/gen/setjmp.S Fri Apr 19 10:41:53 2013 +0000
+++ b/lib/libc/arch/arm/gen/setjmp.S Fri Apr 19 13:14:10 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: setjmp.S,v 1.12 2013/01/29 19:23:09 matt Exp $ */
+/* $NetBSD: setjmp.S,v 1.13 2013/04/19 13:14:10 skrll Exp $ */
/*
* Copyright (c) 1997 Mark Brinicombe
@@ -105,6 +105,7 @@
ldr ip, .Lsetjmp_magic
bic r3, r2, #(_JB_MAGIC_SETJMP ^ _JB_MAGIC_SETJMP_VFP)
teq r3, ip
+ bne .Lbotch
/* Restore the signal mask. */
stmfd sp!, {r0-r2, r14}
@@ -118,10 +119,10 @@
tst r2, #(_JB_MAGIC_SETJMP ^ _JB_MAGIC_SETJMP_VFP)
/* is this a VFP magic? */
beq 1f /* no, don't restore VFP */
- add r1, r0, #(_JB_REG_D8 * 4)
- vldmia r1, {d8-d15}
- ldr r1, [r0, #(_JB_REG_FPSCR * 4)]
- vmsr fpscr, r1
+ add ip, r0, #(_JB_REG_D8 * 4)
+ vldmia ip, {d8-d15}
+ ldr ip, [r0, #(_JB_REG_FPSCR * 4)]
+ vmsr fpscr, ip
1:
#endif /* __ARM_EABI__ */
Home |
Main Index |
Thread Index |
Old Index