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 X86_64Reg : uint16_t {
26   X86_64_REG_RAX = 0,
27   X86_64_REG_RDX = 1,
28   X86_64_REG_RCX = 2,
29   X86_64_REG_RBX = 3,
30   X86_64_REG_RSI = 4,
31   X86_64_REG_RDI = 5,
32   X86_64_REG_RBP = 6,
33   X86_64_REG_RSP = 7,
34   X86_64_REG_R8 = 8,
35   X86_64_REG_R9 = 9,
36   X86_64_REG_R10 = 10,
37   X86_64_REG_R11 = 11,
38   X86_64_REG_R12 = 12,
39   X86_64_REG_R13 = 13,
40   X86_64_REG_R14 = 14,
41   X86_64_REG_R15 = 15,
42   X86_64_REG_RIP = 16,
43   X86_64_REG_LAST,
44 
45   X86_64_REG_SP = X86_64_REG_RSP,
46   X86_64_REG_PC = X86_64_REG_RIP,
47 };
48 
49 }  // namespace unwindstack
50