• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_H
18 #define _LIBUNWINDSTACK_MACHINE_X86_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 X86Reg : uint16_t {
27   X86_REG_EAX = 0,
28   X86_REG_ECX = 1,
29   X86_REG_EDX = 2,
30   X86_REG_EBX = 3,
31   X86_REG_ESP = 4,
32   X86_REG_EBP = 5,
33   X86_REG_ESI = 6,
34   X86_REG_EDI = 7,
35   X86_REG_EIP = 8,
36   X86_REG_EFL = 9,
37   X86_REG_CS = 10,
38   X86_REG_SS = 11,
39   X86_REG_DS = 12,
40   X86_REG_ES = 13,
41   X86_REG_FS = 14,
42   X86_REG_GS = 15,
43   X86_REG_LAST,
44 
45   X86_REG_SP = X86_REG_ESP,
46   X86_REG_PC = X86_REG_EIP,
47 };
48 
49 }  // namespace unwindstack
50 
51 #endif  // _LIBUNWINDSTACK_MACHINE_X86_H
52