1 | //===-- RegisterInfoPOSIX_riscv64.h -----------------------------*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_RISCV64_H |
10 | #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_REGISTERINFOPOSIX_RISCV64_H |
11 | |
12 | #include "RegisterInfoAndSetInterface.h" |
13 | #include "lldb/Target/RegisterContext.h" |
14 | #include "lldb/lldb-private.h" |
15 | #include <map> |
16 | |
17 | class RegisterInfoPOSIX_riscv64 |
18 | : public lldb_private::RegisterInfoAndSetInterface { |
19 | public: |
20 | static const lldb_private::RegisterInfo * |
21 | GetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch); |
22 | static uint32_t |
23 | GetRegisterInfoCount(const lldb_private::ArchSpec &target_arch); |
24 | |
25 | public: |
26 | enum { GPRegSet = 0, FPRegSet }; |
27 | |
28 | struct GPR { |
29 | // note: gpr[0] is pc, not x0 |
30 | uint64_t gpr[32]; |
31 | }; |
32 | |
33 | struct FPR { |
34 | uint64_t fpr[32]; |
35 | uint32_t fcsr; |
36 | }; |
37 | |
38 | struct VPR { |
39 | // The size should be VLEN*32 in bits, but we don't have VLEN here. |
40 | void *vpr; |
41 | }; |
42 | |
43 | RegisterInfoPOSIX_riscv64(const lldb_private::ArchSpec &target_arch, |
44 | lldb_private::Flags flags); |
45 | |
46 | size_t GetGPRSize() const override; |
47 | |
48 | size_t GetFPRSize() const override; |
49 | |
50 | const lldb_private::RegisterInfo *GetRegisterInfo() const override; |
51 | |
52 | uint32_t GetRegisterCount() const override; |
53 | |
54 | const lldb_private::RegisterSet * |
55 | GetRegisterSet(size_t reg_set) const override; |
56 | |
57 | size_t GetRegisterSetCount() const override; |
58 | |
59 | size_t GetRegisterSetFromRegisterIndex(uint32_t reg_index) const override; |
60 | |
61 | private: |
62 | const lldb_private::RegisterInfo *m_register_info_p; |
63 | uint32_t m_register_info_count; |
64 | }; |
65 | |
66 | #endif |
67 | |