From 42ae1878f326c413dd026373ebdb6bf6cd20e75d Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Tue, 9 Mar 2010 02:20:36 -0800 Subject: [PATCH] m68k: update jmpbuf-unwind.h --- ChangeLog.m68k | 5 +++++ sysdeps/m68k/jmpbuf-unwind.h | 23 ++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/ChangeLog.m68k b/ChangeLog.m68k index 8487ba3e5c..d14368e493 100644 --- a/ChangeLog.m68k +++ b/ChangeLog.m68k @@ -1,3 +1,8 @@ +2010-03-09 Maxim Kuvyrkov + + * sysdeps/m68k/jmpbuf-unwind.h (_JMPBUF_CFA_UNWINDS_ADJ) + (_jmpbuf_sp, _JMPBUF_UNWINDS_ADJ, __libc_unwind_longjmp): Define. + 2010-02-10 Joseph Myers * sysdeps/m68k/fpu/fegetenv.c: Add hidden alias. diff --git a/sysdeps/m68k/jmpbuf-unwind.h b/sysdeps/m68k/jmpbuf-unwind.h index 3490c79bdc..28b9537960 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, 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 @@ -18,8 +18,29 @@ 02111-1307 USA. */ #include +#include +#include /* 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)