1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef UNWIND_ARM_DEFINE_H 16 #define UNWIND_ARM_DEFINE_H 17 18 #include <cinttypes> 19 #include <string> 20 #include <vector> 21 22 namespace OHOS { 23 namespace HiviewDFX { 24 #define REGS_PRINT_LEN 256 25 #define DWARF_PRESERVED_REGS_NUM 128 26 27 enum RegsEnumArm : uint16_t { 28 REG_ARM_R0 = 0, 29 REG_ARM_R1, 30 REG_ARM_R2, 31 REG_ARM_R3, 32 REG_ARM_R4, 33 REG_ARM_R5, 34 REG_ARM_R6, 35 REG_ARM_R7, 36 REG_ARM_R8, 37 REG_ARM_R9, 38 REG_ARM_R10, 39 REG_ARM_R11, 40 REG_ARM_R12, 41 REG_ARM_R13, 42 REG_ARM_R14, 43 REG_ARM_R15, 44 REG_ARM_CPSR, 45 REG_ARM_LAST, 46 47 REG_FP = REG_ARM_R11, 48 REG_SP = REG_ARM_R13, 49 REG_LR = REG_ARM_R14, 50 REG_PC = REG_ARM_R15, 51 REG_EH = REG_ARM_R0, 52 REG_LAST = REG_ARM_LAST, 53 }; 54 55 static const std::vector<uint16_t> QUT_REGS { 56 REG_ARM_R7, 57 REG_ARM_R11, 58 REG_SP, 59 REG_PC, 60 REG_LR, 61 }; 62 63 struct RegsUserArm { 64 uint32_t regs[16]; // 16 65 }; 66 67 typedef struct UnwindUContext { 68 RegsUserArm userRegs; 69 } UnwindUContext_t; 70 } // namespace HiviewDFX 71 } // namespace OHOS 72 #endif 73