LLVM API Documentation
00001 //===--- ARMEHABI.h - ARM Exception Handling ABI ----------------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file defines the constants for the ARM unwind opcodes and exception 00011 // handling table entry kinds. 00012 // 00013 // The enumerations and constants in this file reflect the ARM EHABI 00014 // Specification as published by ARM. 00015 // 00016 // Exception Handling ABI for the ARM Architecture r2.09 - November 30, 2012 00017 // 00018 // http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038a/IHI0038A_ehabi.pdf 00019 // 00020 //===----------------------------------------------------------------------===// 00021 00022 #ifndef LLVM_SUPPORT_ARMEHABI_H 00023 #define LLVM_SUPPORT_ARMEHABI_H 00024 00025 namespace llvm { 00026 namespace ARM { 00027 namespace EHABI { 00028 /// ARM exception handling table entry kinds 00029 enum EHTEntryKind { 00030 EHT_GENERIC = 0x00, 00031 EHT_COMPACT = 0x80 00032 }; 00033 00034 enum { 00035 /// Special entry for the function never unwind 00036 EXIDX_CANTUNWIND = 0x1 00037 }; 00038 00039 /// ARM-defined frame unwinding opcodes 00040 enum UnwindOpcodes { 00041 // Format: 00xxxxxx 00042 // Purpose: vsp = vsp + ((x << 2) + 4) 00043 UNWIND_OPCODE_INC_VSP = 0x00, 00044 00045 // Format: 01xxxxxx 00046 // Purpose: vsp = vsp - ((x << 2) + 4) 00047 UNWIND_OPCODE_DEC_VSP = 0x40, 00048 00049 // Format: 10000000 00000000 00050 // Purpose: refuse to unwind 00051 UNWIND_OPCODE_REFUSE = 0x8000, 00052 00053 // Format: 1000xxxx xxxxxxxx 00054 // Purpose: pop r[15:12], r[11:4] 00055 // Constraint: x != 0 00056 UNWIND_OPCODE_POP_REG_MASK_R4 = 0x8000, 00057 00058 // Format: 1001xxxx 00059 // Purpose: vsp = r[x] 00060 // Constraint: x != 13 && x != 15 00061 UNWIND_OPCODE_SET_VSP = 0x90, 00062 00063 // Format: 10100xxx 00064 // Purpose: pop r[(4+x):4] 00065 UNWIND_OPCODE_POP_REG_RANGE_R4 = 0xa0, 00066 00067 // Format: 10101xxx 00068 // Purpose: pop r14, r[(4+x):4] 00069 UNWIND_OPCODE_POP_REG_RANGE_R4_R14 = 0xa8, 00070 00071 // Format: 10110000 00072 // Purpose: finish 00073 UNWIND_OPCODE_FINISH = 0xb0, 00074 00075 // Format: 10110001 0000xxxx 00076 // Purpose: pop r[3:0] 00077 // Constraint: x != 0 00078 UNWIND_OPCODE_POP_REG_MASK = 0xb100, 00079 00080 // Format: 10110010 x(uleb128) 00081 // Purpose: vsp = vsp + ((x << 2) + 0x204) 00082 UNWIND_OPCODE_INC_VSP_ULEB128 = 0xb2, 00083 00084 // Format: 10110011 xxxxyyyy 00085 // Purpose: pop d[(x+y):x] 00086 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDX = 0xb300, 00087 00088 // Format: 10111xxx 00089 // Purpose: pop d[(8+x):8] 00090 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDX_D8 = 0xb8, 00091 00092 // Format: 11000xxx 00093 // Purpose: pop wR[(10+x):10] 00094 UNWIND_OPCODE_POP_WIRELESS_MMX_REG_RANGE_WR10 = 0xc0, 00095 00096 // Format: 11000110 xxxxyyyy 00097 // Purpose: pop wR[(x+y):x] 00098 UNWIND_OPCODE_POP_WIRELESS_MMX_REG_RANGE = 0xc600, 00099 00100 // Format: 11000111 0000xxxx 00101 // Purpose: pop wCGR[3:0] 00102 // Constraint: x != 0 00103 UNWIND_OPCODE_POP_WIRELESS_MMX_REG_MASK = 0xc700, 00104 00105 // Format: 11001000 xxxxyyyy 00106 // Purpose: pop d[(16+x+y):(16+x)] 00107 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDD_D16 = 0xc800, 00108 00109 // Format: 11001001 xxxxyyyy 00110 // Purpose: pop d[(x+y):x] 00111 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDD = 0xc900, 00112 00113 // Format: 11010xxx 00114 // Purpose: pop d[(8+x):8] 00115 UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDD_D8 = 0xd0 00116 }; 00117 00118 /// ARM-defined Personality Routine Index 00119 enum PersonalityRoutineIndex { 00120 // To make the exception handling table become more compact, ARM defined 00121 // several personality routines in EHABI. There are 3 different 00122 // personality routines in ARM EHABI currently. It is possible to have 16 00123 // pre-defined personality routines at most. 00124 AEABI_UNWIND_CPP_PR0 = 0, 00125 AEABI_UNWIND_CPP_PR1 = 1, 00126 AEABI_UNWIND_CPP_PR2 = 2, 00127 00128 NUM_PERSONALITY_INDEX 00129 }; 00130 } 00131 } 00132 } 00133 00134 #endif