This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
[M68K/ColdFire patch 3/n] Update jmpbuf-unwind.h
- From: Maxim Kuvyrkov <maxim at codesourcery dot com>
- To: libc-ports at sourceware dot org
- Cc: Andreas Schwab <schwab at linux-m68k dot org>
- Date: Tue, 25 Aug 2009 16:52:04 +0400
- Subject: [M68K/ColdFire patch 3/n] Update jmpbuf-unwind.h
- References: <4A93D885.3060004@codesourcery.com>
This patch updates jmpbuf-unwind.h.
The implementation was borrowed from what other major architectures do.
Any comments?
Thanks,
--
Maxim K.
CodeSourcery
>From efd28b55921422dc141672336bed8a33284dfbfb Mon Sep 17 00:00:00 2001
From: Maxim Kuvyrkov <maxim@codesourcery.com>
Date: Mon, 24 Aug 2009 12:35:48 +0400
Subject: [PATCH 3/5] Update jmpbuf-unwind.h.
* sysdeps/m68k/jmpbuf-unwind.h: Update.
---
sysdeps/m68k/jmpbuf-unwind.h | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/sysdeps/m68k/jmpbuf-unwind.h b/sysdeps/m68k/jmpbuf-unwind.h
index 3490c79..d001039 100644
--- a/sysdeps/m68k/jmpbuf-unwind.h
+++ b/sysdeps/m68k/jmpbuf-unwind.h
@@ -1,5 +1,5 @@
/* Examine __jmp_buf for unwinding frames. m68k version.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,8 +18,29 @@
02111-1307 USA. */
#include <setjmp.h>
+#include <stdint.h>
+#include <unwind.h>
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
((void *) (address) < (void *) demangle ((jmpbuf)->__sp))
+
+#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
+ _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
+
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+ uintptr_t sp = regs[0].__sp;
+#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (sp);
+#endif
+ return sp;
+}
+
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+ ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
+
+/* We use the normal longjmp for unwinding. */
+#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
--
1.6.4