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 #pragma once 18 19 #include <stdint.h> 20 21 namespace unwindstack { 22 23 // Matches the numbers for the registers as generated by compilers. 24 // If this is changed, then unwinding will fail. 25 enum X86Reg : uint16_t { 26 X86_REG_EAX = 0, 27 X86_REG_ECX = 1, 28 X86_REG_EDX = 2, 29 X86_REG_EBX = 3, 30 X86_REG_ESP = 4, 31 X86_REG_EBP = 5, 32 X86_REG_ESI = 6, 33 X86_REG_EDI = 7, 34 X86_REG_EIP = 8, 35 X86_REG_EFL = 9, 36 X86_REG_CS = 10, 37 X86_REG_SS = 11, 38 X86_REG_DS = 12, 39 X86_REG_ES = 13, 40 X86_REG_FS = 14, 41 X86_REG_GS = 15, 42 X86_REG_LAST, 43 44 X86_REG_SP = X86_REG_ESP, 45 X86_REG_PC = X86_REG_EIP, 46 }; 47 48 } // namespace unwindstack 49