Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:27

0001 //===--- ARMEHABI.h - ARM Exception Handling ABI ----------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file defines the constants for the ARM unwind opcodes and exception
0010 // handling table entry kinds.
0011 //
0012 // The enumerations and constants in this file reflect the ARM EHABI
0013 // Specification as published by ARM.
0014 //
0015 // Exception Handling ABI for the ARM Architecture r2.09 - November 30, 2012
0016 //
0017 // http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038a/IHI0038A_ehabi.pdf
0018 //
0019 //===----------------------------------------------------------------------===//
0020 
0021 #ifndef LLVM_SUPPORT_ARMEHABI_H
0022 #define LLVM_SUPPORT_ARMEHABI_H
0023 
0024 namespace llvm {
0025 namespace ARM {
0026 namespace EHABI {
0027   /// ARM exception handling table entry kinds
0028   enum EHTEntryKind {
0029     EHT_GENERIC = 0x00,
0030     EHT_COMPACT = 0x80
0031   };
0032 
0033   enum {
0034     /// Special entry for the function never unwind
0035     EXIDX_CANTUNWIND = 0x1
0036   };
0037 
0038   /// ARM-defined frame unwinding opcodes
0039   enum UnwindOpcodes {
0040     // Format: 00xxxxxx
0041     // Purpose: vsp = vsp + ((x << 2) + 4)
0042     UNWIND_OPCODE_INC_VSP = 0x00,
0043 
0044     // Format: 01xxxxxx
0045     // Purpose: vsp = vsp - ((x << 2) + 4)
0046     UNWIND_OPCODE_DEC_VSP = 0x40,
0047 
0048     // Format: 10000000 00000000
0049     // Purpose: refuse to unwind
0050     UNWIND_OPCODE_REFUSE = 0x8000,
0051 
0052     // Format: 1000xxxx xxxxxxxx
0053     // Purpose: pop r[15:12], r[11:4]
0054     // Constraint: x != 0
0055     UNWIND_OPCODE_POP_REG_MASK_R4 = 0x8000,
0056 
0057     // Format: 1001xxxx
0058     // Purpose: vsp = r[x]
0059     // Constraint: x != 13 && x != 15
0060     UNWIND_OPCODE_SET_VSP = 0x90,
0061 
0062     // Format: 10100xxx
0063     // Purpose: pop r[(4+x):4]
0064     UNWIND_OPCODE_POP_REG_RANGE_R4 = 0xa0,
0065 
0066     // Format: 10101xxx
0067     // Purpose: pop r14, r[(4+x):4]
0068     UNWIND_OPCODE_POP_REG_RANGE_R4_R14 = 0xa8,
0069 
0070     // Format: 10110000
0071     // Purpose: finish
0072     UNWIND_OPCODE_FINISH = 0xb0,
0073 
0074     // Format: 10110100
0075     // Purpose: Pop Return Address Authetication Code
0076     UNWIND_OPCODE_POP_RA_AUTH_CODE = 0xb4,
0077 
0078     // Format: 10110001 0000xxxx
0079     // Purpose: pop r[3:0]
0080     // Constraint: x != 0
0081     UNWIND_OPCODE_POP_REG_MASK = 0xb100,
0082 
0083     // Format: 10110010 x(uleb128)
0084     // Purpose: vsp = vsp + ((x << 2) + 0x204)
0085     UNWIND_OPCODE_INC_VSP_ULEB128 = 0xb2,
0086 
0087     // Format: 10110011 xxxxyyyy
0088     // Purpose: pop d[(x+y):x]
0089     UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDX = 0xb300,
0090 
0091     // Format: 10111xxx
0092     // Purpose: pop d[(8+x):8]
0093     UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDX_D8 = 0xb8,
0094 
0095     // Format: 11000xxx
0096     // Purpose: pop wR[(10+x):10]
0097     UNWIND_OPCODE_POP_WIRELESS_MMX_REG_RANGE_WR10 = 0xc0,
0098 
0099     // Format: 11000110 xxxxyyyy
0100     // Purpose: pop wR[(x+y):x]
0101     UNWIND_OPCODE_POP_WIRELESS_MMX_REG_RANGE = 0xc600,
0102 
0103     // Format: 11000111 0000xxxx
0104     // Purpose: pop wCGR[3:0]
0105     // Constraint: x != 0
0106     UNWIND_OPCODE_POP_WIRELESS_MMX_REG_MASK = 0xc700,
0107 
0108     // Format: 11001000 xxxxyyyy
0109     // Purpose: pop d[(16+x+y):(16+x)]
0110     UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDD_D16 = 0xc800,
0111 
0112     // Format: 11001001 xxxxyyyy
0113     // Purpose: pop d[(x+y):x]
0114     UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDD = 0xc900,
0115 
0116     // Format: 11010xxx
0117     // Purpose: pop d[(8+x):8]
0118     UNWIND_OPCODE_POP_VFP_REG_RANGE_FSTMFDD_D8 = 0xd0
0119   };
0120 
0121   /// ARM-defined Personality Routine Index
0122   enum PersonalityRoutineIndex {
0123     // To make the exception handling table become more compact, ARM defined
0124     // several personality routines in EHABI.  There are 3 different
0125     // personality routines in ARM EHABI currently.  It is possible to have 16
0126     // pre-defined personality routines at most.
0127     AEABI_UNWIND_CPP_PR0 = 0,
0128     AEABI_UNWIND_CPP_PR1 = 1,
0129     AEABI_UNWIND_CPP_PR2 = 2,
0130 
0131     NUM_PERSONALITY_INDEX
0132   };
0133 }
0134 }
0135 }
0136 
0137 #endif