m68k: update jmpbuf-unwind.h
authorMaxim Kuvyrkov <maxim@codesourcery.com>
Tue, 9 Mar 2010 10:20:36 +0000 (02:20 -0800)
committerAndreas Schwab <schwab@linux-m68k.org>
Fri, 12 Mar 2010 18:45:34 +0000 (19:45 +0100)
ChangeLog.m68k
sysdeps/m68k/jmpbuf-unwind.h

index 8487ba3..d14368e 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-09  Maxim Kuvyrkov  <maxim@codesourcery.com>
+
+       * sysdeps/m68k/jmpbuf-unwind.h (_JMPBUF_CFA_UNWINDS_ADJ)
+       (_jmpbuf_sp, _JMPBUF_UNWINDS_ADJ, __libc_unwind_longjmp): Define.
+
 2010-02-10  Joseph Myers  <joseph@codesourcery.com>
 
        * sysdeps/m68k/fpu/fegetenv.c: Add hidden alias.
index 3490c79..28b9537 100644 (file)
@@ -1,5 +1,5 @@
 /* Examine __jmp_buf for unwinding frames.  m68k version.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2010 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
    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)