1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef _LIBUNWINDSTACK_MACHINE_X86_64_H 18 #define _LIBUNWINDSTACK_MACHINE_X86_64_H 19 20 #include <stdint.h> 21 22 namespace unwindstack { 23 24 // Matches the numbers for the registers as generated by compilers. 25 // If this is changed, then unwinding will fail. 26 enum X86_64Reg : uint16_t { 27 X86_64_REG_RAX = 0, 28 X86_64_REG_RDX = 1, 29 X86_64_REG_RCX = 2, 30 X86_64_REG_RBX = 3, 31 X86_64_REG_RSI = 4, 32 X86_64_REG_RDI = 5, 33 X86_64_REG_RBP = 6, 34 X86_64_REG_RSP = 7, 35 X86_64_REG_R8 = 8, 36 X86_64_REG_R9 = 9, 37 X86_64_REG_R10 = 10, 38 X86_64_REG_R11 = 11, 39 X86_64_REG_R12 = 12, 40 X86_64_REG_R13 = 13, 41 X86_64_REG_R14 = 14, 42 X86_64_REG_R15 = 15, 43 X86_64_REG_RIP = 16, 44 X86_64_REG_LAST, 45 46 X86_64_REG_SP = X86_64_REG_RSP, 47 X86_64_REG_PC = X86_64_REG_RIP, 48 }; 49 50 } // namespace unwindstack 51 52 #endif // _LIBUNWINDSTACK_MACHINE_X86_64_H 53