1 |
734 |
jeremybenn |
/* Header file for the ARM EABI unwinder
|
2 |
|
|
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
|
3 |
|
|
Free Software Foundation, Inc.
|
4 |
|
|
Contributed by Paul Brook
|
5 |
|
|
|
6 |
|
|
This file is free software; you can redistribute it and/or modify it
|
7 |
|
|
under the terms of the GNU General Public License as published by the
|
8 |
|
|
Free Software Foundation; either version 3, or (at your option) any
|
9 |
|
|
later version.
|
10 |
|
|
|
11 |
|
|
This file is distributed in the hope that it will be useful, but
|
12 |
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 |
|
|
General Public License for more details.
|
15 |
|
|
|
16 |
|
|
Under Section 7 of GPL version 3, you are granted additional
|
17 |
|
|
permissions described in the GCC Runtime Library Exception, version
|
18 |
|
|
3.1, as published by the Free Software Foundation.
|
19 |
|
|
|
20 |
|
|
You should have received a copy of the GNU General Public License and
|
21 |
|
|
a copy of the GCC Runtime Library Exception along with this program;
|
22 |
|
|
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
23 |
|
|
<http://www.gnu.org/licenses/>. */
|
24 |
|
|
|
25 |
|
|
/* Language-independent unwinder header public defines. This contains both
|
26 |
|
|
ABI defined objects, and GNU support routines. */
|
27 |
|
|
|
28 |
|
|
#ifndef UNWIND_ARM_H
|
29 |
|
|
#define UNWIND_ARM_H
|
30 |
|
|
|
31 |
|
|
#include "unwind-arm-common.h"
|
32 |
|
|
|
33 |
|
|
#define UNWIND_STACK_REG 13
|
34 |
|
|
/* Use IP as a scratch register within the personality routine. */
|
35 |
|
|
#define UNWIND_POINTER_REG 12
|
36 |
|
|
|
37 |
|
|
#ifdef __cplusplus
|
38 |
|
|
extern "C" {
|
39 |
|
|
#endif
|
40 |
|
|
/* Decode an R_ARM_TARGET2 relocation. */
|
41 |
|
|
static inline _Unwind_Word
|
42 |
|
|
_Unwind_decode_typeinfo_ptr (_Unwind_Word base, _Unwind_Word ptr)
|
43 |
|
|
{
|
44 |
|
|
_Unwind_Word tmp;
|
45 |
|
|
|
46 |
|
|
tmp = *(_Unwind_Word *) ptr;
|
47 |
|
|
/* Zero values are always NULL. */
|
48 |
|
|
if (!tmp)
|
49 |
|
|
return 0;
|
50 |
|
|
|
51 |
|
|
#if (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__)
|
52 |
|
|
/* Pc-relative indirect. */
|
53 |
|
|
#define _GLIBCXX_OVERRIDE_TTYPE_ENCODING (DW_EH_PE_pcrel | DW_EH_PE_indirect)
|
54 |
|
|
tmp += ptr;
|
55 |
|
|
tmp = *(_Unwind_Word *) tmp;
|
56 |
|
|
#elif defined(__symbian__) || defined(__uClinux__)
|
57 |
|
|
#define _GLIBCXX_OVERRIDE_TTYPE_ENCODING (DW_EH_PE_absptr)
|
58 |
|
|
/* Absolute pointer. Nothing more to do. */
|
59 |
|
|
#else
|
60 |
|
|
#define _GLIBCXX_OVERRIDE_TTYPE_ENCODING (DW_EH_PE_pcrel)
|
61 |
|
|
/* Pc-relative pointer. */
|
62 |
|
|
tmp += ptr;
|
63 |
|
|
#endif
|
64 |
|
|
return tmp;
|
65 |
|
|
}
|
66 |
|
|
|
67 |
|
|
static inline _Unwind_Reason_Code
|
68 |
|
|
__gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact)
|
69 |
|
|
{
|
70 |
|
|
return _URC_FAILURE;
|
71 |
|
|
}
|
72 |
|
|
/* Return the address of the instruction, not the actual IP value. */
|
73 |
|
|
#define _Unwind_GetIP(context) \
|
74 |
|
|
(_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
|
75 |
|
|
|
76 |
|
|
#define _Unwind_SetIP(context, val) \
|
77 |
|
|
_Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1))
|
78 |
|
|
|
79 |
|
|
#ifdef __cplusplus
|
80 |
|
|
} /* extern "C" */
|
81 |
|
|
#endif
|
82 |
|
|
|
83 |
|
|
#endif /* defined UNWIND_ARM_H */
|