Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libpthread/arch/sh3 Cause SIGTRAP if NOTREACHED code is ...
details: https://anonhg.NetBSD.org/src/rev/2ecc9e7331b3
branches: trunk
changeset: 555446:2ecc9e7331b3
user: uwe <uwe%NetBSD.org@localhost>
date: Mon Nov 17 22:38:11 2003 +0000
description:
Cause SIGTRAP if NOTREACHED code is reached.
diffstat:
lib/libpthread/arch/sh3/_context_u.S | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diffs (51 lines):
diff -r b173994bad89 -r 2ecc9e7331b3 lib/libpthread/arch/sh3/_context_u.S
--- a/lib/libpthread/arch/sh3/_context_u.S Mon Nov 17 22:34:16 2003 +0000
+++ b/lib/libpthread/arch/sh3/_context_u.S Mon Nov 17 22:38:11 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: _context_u.S,v 1.3 2003/07/05 23:01:25 uwe Exp $ */
+/* $NetBSD: _context_u.S,v 1.4 2003/11/17 22:38:11 uwe Exp $ */
/*
* Copyright (c) 2003 Christian P. Groessler
@@ -32,6 +32,12 @@
/*
+ * Enter debugger or die with SIGTRAP if "notreached" code is reached
+ */
+#define NOTREACHED trapa #0xc3
+
+
+/*
* Only save/restore registers that are callee saved, i.e for which
* gcc has call_used_regs[reg] == 0.
*/
@@ -101,7 +107,7 @@
add #(_REG_R15 * 4), r1 ; \
jmp @r2 ; \
mov.l @r1, r15 ; \
- /* NOTREACHED */ \
+ NOTREACHED ; \
\
1: /* not a _UC_USER context, pass to setcontext(2) */ \
CALL_SETCONTEXT(uc) \
@@ -117,7 +123,7 @@
mov.l 2f, r1 ; \
1: bsrf r1 ; \
MAYBE_MOV_UC_R4(uc) ; \
- /* NOTREACHED */ \
+ NOTREACHED ; \
.align 2 ; \
2: .long _C_LABEL(setcontext)-(1b+4)
#else /* !PIC */
@@ -128,8 +134,8 @@
#define CALL_SETCONTEXT(uc) \
mov.l .L_setcontext, r1 ; \
jsr @r1 ; \
- MAYBE_MOV_UC_R4(uc) \
- /* NOTREACHED */
+ MAYBE_MOV_UC_R4(uc) ; \
+ NOTREACHED
#endif
#define MAYBE_MOV_UC_R4(uc) \
Home |
Main Index |
Thread Index |
Old Index