Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
00001 00002 /* 00003 00004 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00005 00006 This program is free software; you can redistribute it and/or modify it 00007 under the terms of version 2 of the GNU General Public License as 00008 published by the Free Software Foundation. 00009 00010 This program is distributed in the hope that it would be useful, but 00011 WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00013 00014 Further, this software is distributed without any warranty that it is 00015 free of the rightful claim of any third person regarding infringement 00016 or the like. Any license provided herein, whether implied or 00017 otherwise, applies only to this software file. Patent licenses, if 00018 any, provided herein do not apply to combinations of this program with 00019 other software, or any other product whatsoever. 00020 00021 You should have received a copy of the GNU General Public License along 00022 with this program; if not, write the Free Software Foundation, Inc., 59 00023 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00024 00025 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00026 Mountain View, CA 94043, or: 00027 00028 http://www.sgi.com 00029 00030 For further information regarding this notice, see: 00031 00032 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00033 00034 */ 00035 00036 /* 00037 * ========================================================================== 00038 * 00039 * Module : unwind_ia64.h -- IA64 unwind descriptor header file 00040 * Do not include directly, use 00041 * - unwind.h for consumer interface 00042 * - unwindP.h for producer interface 00043 * ========================================================================== 00044 */ 00045 00046 #ifndef __SYS_IA64_UNWIND_IA64_H 00047 #define __SYS_IA64_UNWIND_IA64_H 00048 00049 #include <inttypes.h> 00050 00051 /* unwind version */ 00052 #define __UNW_VERSION 0x01 00053 00054 /* unwind generic return values */ 00055 #define __UNW_OK 0x00 00056 #define __UNW_INTERNAL_ERROR 0x01 00057 #define __UNW_MALLOC_ERROR 0x02 00058 #define __UNW_REALLOC_ERROR 0x03 00059 #define __UNW_MMAP_ERROR 0x04 00060 #define __UNW_SYSCALL_ERROR 0x05 00061 #define __UNW_NULL_ERROR 0x06 00062 #define __UNW_INV_ARG_ERROR 0x07 00063 #define __UNW_INV_SIZE_ERROR 0x08 00064 #define __UNW_INV_OP_ERROR 0x09 00065 #define __UNW_INV_ALIGNMENT_ERROR 0x0a 00066 #define __UNW_INV_VERSION_ERROR 0x0b 00067 #define __UNW_NOT_FOUND_ERROR 0x0c 00068 00069 /* unwind generic types */ 00070 #ifdef _ABI32 00071 typedef uint32_t __unw_addr_t; 00072 #else /* _ABI64 */ 00073 typedef uint64_t __unw_addr_t; 00074 #endif 00075 typedef uint64_t __unw_dbl_word_t; 00076 typedef uint32_t __unw_word_t; 00077 typedef int32_t __unw_error_t; 00078 00079 /* unwind table entry records */ 00080 typedef struct __unw_table_entry_struct { 00081 __unw_addr_t _start; /* segment-relative region starting address */ 00082 __unw_addr_t _end; /* segment-relative region ending address */ 00083 __unw_addr_t _info; /* pointer to unwind info */ 00084 } __unw_table_entry_t; 00085 00086 /* unwind info records/blocks */ 00087 typedef struct __unw_info_struct { 00088 __unw_dbl_word_t _header; /* unwind info header */ 00089 char _body[1]; /* unwind info body */ 00090 } __unw_info_t; 00091 00092 /* access macros for unwind descriptors for region headers */ 00093 /* (where x is the leading byte) */ 00094 #define __UNW_IS_HEADER(x) (!((x) & 0x80)) 00095 /* access macros for unwind descriptors for prologue region headers */ 00096 /* (where x is the leading byte) */ 00097 #define __UNW_IS_PROLOGUE_HEADER(x) ((0x00 == ((x) & 0xe0)) \ 00098 || (0x40 == ((x) & 0xf8)) \ 00099 || (0x60 == (x))) 00100 /* access macros for unwind descriptors for body region headers */ 00101 /* (where x is the leading byte) */ 00102 #define __UNW_IS_BODY_HEADER(x) ((0x20 == ((x) & 0xe0)) \ 00103 || (0x61 == (x))) 00104 /* access macros for all unwind descriptors */ 00105 /* (where x is the leading byte) */ 00106 #define __UNW_IS_R1(x) (0x00 == ((x) & 0xc0)) 00107 #define __UNW_IS_R2(x) (0x40 == ((x) & 0xe0)) 00108 #define __UNW_IS_R3(x) (0x60 == ((x) & 0xe0)) 00109 #define __UNW_IS_P1(x) (0x80 == ((x) & 0xe0)) 00110 #define __UNW_IS_P2(x) (0xa0 == ((x) & 0xf0)) 00111 #define __UNW_IS_P3(x) (0xb0 == ((x) & 0xf8)) 00112 #define __UNW_IS_P4(x) (0xb8 == ((x) & 0xff)) 00113 #define __UNW_IS_P5(x) (0xb9 == ((x) & 0xff)) 00114 #define __UNW_IS_P6(x) (0xc0 == ((x) & 0xe0)) 00115 #define __UNW_IS_P7(x) (0xe0 == ((x) & 0xf0)) 00116 #define __UNW_IS_P8(x) (0xf0 == ((x) & 0xff)) 00117 #define __UNW_IS_P9(x) (0xf1 == ((x) & 0xff)) 00118 #define __UNW_IS_P10(x) (0xff == ((x) & 0xff)) 00119 #define __UNW_IS_B1(x) (0x80 == ((x) & 0xc0)) 00120 #define __UNW_IS_B2(x) (0xc0 == ((x) & 0xe0)) 00121 #define __UNW_IS_B3(x) (0xe0 == ((x) & 0xff)) 00122 #define __UNW_IS_B4(x) (0xf0 == ((x) & 0xf7)) 00123 #define __UNW_IS_X1(x) (0xf9 == ((x) & 0xff)) 00124 #define __UNW_IS_X2(x) (0xfa == ((x) & 0xff)) 00125 #define __UNW_IS_X3(x) (0xfb == ((x) & 0xff)) 00126 #define __UNW_IS_X4(x) (0xfc == ((x) & 0xff)) 00127 /* access macros for unwind info records/blocks */ 00128 /* (where x is the leading double word) */ 00129 #define __UNW_VER(x) ((x) >> 48) 00130 #define __UNW_FLAG_EHANDLER(x) ((x) & 0x0000000100000000L) 00131 #define __UNW_FLAG_UHANDLER(x) ((x) & 0x0000000200000000L) 00132 #define __UNW_LENGTH(x) ((x) & 0x00000000ffffffffL) 00133 00134 /* ========================================================================== */ 00135 00136 #ifdef __cplusplus 00137 extern "C" { 00138 #endif 00139 00140 /* general API */ 00141 00142 /* little-endian base 128 variable-length decoding */ 00143 uint64_t __leb128_decode(char *, uint64_t, uint64_t *); 00144 /* little-endian base 128 variable-length encoding */ 00145 uint64_t __leb128_encode(char *, uint64_t, uint64_t); 00146 /* unwind table and/or unwind info processing */ 00147 __unw_error_t unwind_process(__unw_error_t (*)(char *, uint64_t, char *, 00148 uint64_t, void *), void *); 00149 /* unwind table and/or unwind info dumping into ascii */ 00150 __unw_error_t unwind_dump2ascii(char *, uint64_t, 00151 char *, uint64_t, void *); 00152 00153 00154 #ifdef __cplusplus 00155 } 00156 #endif 00157 00158 #endif