1 //===-- RegisterInfoPOSIX_arm64.h -------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef liblldb_RegisterContextLinux_arm64_H_
11 #define liblldb_RegisterContextLinux_arm64_H_
12 
13 #include "RegisterInfoInterface.h"
14 #include "lldb/Target/RegisterContext.h"
15 #include "lldb/lldb-private.h"
16 
17 class RegisterInfoPOSIX_arm64 : public lldb_private::RegisterInfoInterface {
18 public:
19   // based on RegisterContextDarwin_arm64.h
20   struct GPR {
21     uint64_t x[29]; // x0-x28
22     uint64_t fp;    // x29
23     uint64_t lr;    // x30
24     uint64_t sp;    // x31
25     uint64_t pc;    // pc
26     uint32_t cpsr;  // cpsr
27   };
28 
29   // based on RegisterContextDarwin_arm64.h
30   struct VReg {
31     uint8_t bytes[16];
32   };
33 
34   // based on RegisterContextDarwin_arm64.h
35   struct FPU {
36     VReg v[32];
37     uint32_t fpsr;
38     uint32_t fpcr;
39   };
40 
41   // based on RegisterContextDarwin_arm64.h
42   struct EXC {
43     uint64_t far;       // Virtual Fault Address
44     uint32_t esr;       // Exception syndrome
45     uint32_t exception; // number of arm exception token
46   };
47 
48   // based on RegisterContextDarwin_arm64.h
49   struct DBG {
50     uint64_t bvr[16];
51     uint64_t bcr[16];
52     uint64_t wvr[16];
53     uint64_t wcr[16];
54     uint64_t mdscr_el1;
55   };
56 
57   RegisterInfoPOSIX_arm64(const lldb_private::ArchSpec &target_arch);
58 
59   size_t GetGPRSize() const override;
60 
61   const lldb_private::RegisterInfo *GetRegisterInfo() const override;
62 
63   uint32_t GetRegisterCount() const override;
64 
65 private:
66   const lldb_private::RegisterInfo *m_register_info_p;
67   uint32_t m_register_info_count;
68 };
69 
70 #endif
71