OpenADFortTk (including Open64 and OpenAnalysis references)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
unwind_ia64.h
Go to the documentation of this file.
1 
2 /*
3 
4  Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved.
5 
6  This program is free software; you can redistribute it and/or modify it
7  under the terms of version 2 of the GNU General Public License as
8  published by the Free Software Foundation.
9 
10  This program is distributed in the hope that it would be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 
14  Further, this software is distributed without any warranty that it is
15  free of the rightful claim of any third person regarding infringement
16  or the like. Any license provided herein, whether implied or
17  otherwise, applies only to this software file. Patent licenses, if
18  any, provided herein do not apply to combinations of this program with
19  other software, or any other product whatsoever.
20 
21  You should have received a copy of the GNU General Public License along
22  with this program; if not, write the Free Software Foundation, Inc., 59
23  Temple Place - Suite 330, Boston MA 02111-1307, USA.
24 
25  Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky,
26  Mountain View, CA 94043, or:
27 
28  http://www.sgi.com
29 
30  For further information regarding this notice, see:
31 
32  http://oss.sgi.com/projects/GenInfo/NoticeExplan
33 
34 */
35 
36 /*
37  * ==========================================================================
38  *
39  * Module : unwind_ia64.h -- IA64 unwind descriptor header file
40  * Do not include directly, use
41  * - unwind.h for consumer interface
42  * - unwindP.h for producer interface
43  * ==========================================================================
44  */
45 
46 #ifndef __SYS_IA64_UNWIND_IA64_H
47 #define __SYS_IA64_UNWIND_IA64_H
48 
49 #include <inttypes.h>
50 
51 /* unwind version */
52 #define __UNW_VERSION 0x01
53 
54 /* unwind generic return values */
55 #define __UNW_OK 0x00
56 #define __UNW_INTERNAL_ERROR 0x01
57 #define __UNW_MALLOC_ERROR 0x02
58 #define __UNW_REALLOC_ERROR 0x03
59 #define __UNW_MMAP_ERROR 0x04
60 #define __UNW_SYSCALL_ERROR 0x05
61 #define __UNW_NULL_ERROR 0x06
62 #define __UNW_INV_ARG_ERROR 0x07
63 #define __UNW_INV_SIZE_ERROR 0x08
64 #define __UNW_INV_OP_ERROR 0x09
65 #define __UNW_INV_ALIGNMENT_ERROR 0x0a
66 #define __UNW_INV_VERSION_ERROR 0x0b
67 #define __UNW_NOT_FOUND_ERROR 0x0c
68 
69 /* unwind generic types */
70 #ifdef _ABI32
71 typedef uint32_t __unw_addr_t;
72 #else /* _ABI64 */
73 typedef uint64_t __unw_addr_t;
74 #endif
75 typedef uint64_t __unw_dbl_word_t;
77 typedef int32_t __unw_error_t;
78 
79 /* unwind table entry records */
80 typedef struct __unw_table_entry_struct {
81  __unw_addr_t _start; /* segment-relative region starting address */
82  __unw_addr_t _end; /* segment-relative region ending address */
83  __unw_addr_t _info; /* pointer to unwind info */
85 
86 /* unwind info records/blocks */
87 typedef struct __unw_info_struct {
88  __unw_dbl_word_t _header; /* unwind info header */
89  char _body[1]; /* unwind info body */
90 } __unw_info_t;
91 
92 /* access macros for unwind descriptors for region headers */
93 /* (where x is the leading byte) */
94 #define __UNW_IS_HEADER(x) (!((x) & 0x80))
95 /* access macros for unwind descriptors for prologue region headers */
96 /* (where x is the leading byte) */
97 #define __UNW_IS_PROLOGUE_HEADER(x) ((0x00 == ((x) & 0xe0)) \
98  || (0x40 == ((x) & 0xf8)) \
99  || (0x60 == (x)))
100 /* access macros for unwind descriptors for body region headers */
101 /* (where x is the leading byte) */
102 #define __UNW_IS_BODY_HEADER(x) ((0x20 == ((x) & 0xe0)) \
103  || (0x61 == (x)))
104 /* access macros for all unwind descriptors */
105 /* (where x is the leading byte) */
106 #define __UNW_IS_R1(x) (0x00 == ((x) & 0xc0))
107 #define __UNW_IS_R2(x) (0x40 == ((x) & 0xe0))
108 #define __UNW_IS_R3(x) (0x60 == ((x) & 0xe0))
109 #define __UNW_IS_P1(x) (0x80 == ((x) & 0xe0))
110 #define __UNW_IS_P2(x) (0xa0 == ((x) & 0xf0))
111 #define __UNW_IS_P3(x) (0xb0 == ((x) & 0xf8))
112 #define __UNW_IS_P4(x) (0xb8 == ((x) & 0xff))
113 #define __UNW_IS_P5(x) (0xb9 == ((x) & 0xff))
114 #define __UNW_IS_P6(x) (0xc0 == ((x) & 0xe0))
115 #define __UNW_IS_P7(x) (0xe0 == ((x) & 0xf0))
116 #define __UNW_IS_P8(x) (0xf0 == ((x) & 0xff))
117 #define __UNW_IS_P9(x) (0xf1 == ((x) & 0xff))
118 #define __UNW_IS_P10(x) (0xff == ((x) & 0xff))
119 #define __UNW_IS_B1(x) (0x80 == ((x) & 0xc0))
120 #define __UNW_IS_B2(x) (0xc0 == ((x) & 0xe0))
121 #define __UNW_IS_B3(x) (0xe0 == ((x) & 0xff))
122 #define __UNW_IS_B4(x) (0xf0 == ((x) & 0xf7))
123 #define __UNW_IS_X1(x) (0xf9 == ((x) & 0xff))
124 #define __UNW_IS_X2(x) (0xfa == ((x) & 0xff))
125 #define __UNW_IS_X3(x) (0xfb == ((x) & 0xff))
126 #define __UNW_IS_X4(x) (0xfc == ((x) & 0xff))
127 /* access macros for unwind info records/blocks */
128 /* (where x is the leading double word) */
129 #define __UNW_VER(x) ((x) >> 48)
130 #define __UNW_FLAG_EHANDLER(x) ((x) & 0x0000000100000000L)
131 #define __UNW_FLAG_UHANDLER(x) ((x) & 0x0000000200000000L)
132 #define __UNW_LENGTH(x) ((x) & 0x00000000ffffffffL)
133 
134 /* ========================================================================== */
135 
136 #ifdef __cplusplus
137 extern "C" {
138 #endif
139 
140 /* general API */
141 
142 /* little-endian base 128 variable-length decoding */
143 uint64_t __leb128_decode(char *, uint64_t, uint64_t *);
144 /* little-endian base 128 variable-length encoding */
145 uint64_t __leb128_encode(char *, uint64_t, uint64_t);
146 /* unwind table and/or unwind info processing */
147 __unw_error_t unwind_process(__unw_error_t (*)(char *, uint64_t, char *,
148  uint64_t, void *), void *);
149 /* unwind table and/or unwind info dumping into ascii */
150 __unw_error_t unwind_dump2ascii(char *, uint64_t,
151  char *, uint64_t, void *);
152 
153 
154 #ifdef __cplusplus
155 }
156 #endif
157 
158 #endif