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