1 //===-- AddressableBits.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_UTILITY_ADDRESSABLEBITS_H
10 #define LLDB_UTILITY_ADDRESSABLEBITS_H
11 
12 #include "lldb/lldb-forward.h"
13 
14 namespace lldb_private {
15 
16 /// \class AddressableBits AddressableBits.h "lldb/Core/AddressableBits.h"
17 /// A class which holds the metadata from a remote stub/corefile note
18 /// about how many bits are used for addressing on this target.
19 ///
20 class AddressableBits {
21 public:
AddressableBits()22   AddressableBits() : m_low_memory_addr_bits(0), m_high_memory_addr_bits(0) {}
23 
24   /// When a single value is available for the number of bits.
25   void SetAddressableBits(uint32_t addressing_bits);
26 
27   /// When we have separate values for low memory addresses and high memory
28   /// addresses.
29   void SetAddressableBits(uint32_t lowmem_addressing_bits,
30                           uint32_t highmem_addressing_bits);
31 
32   void SetLowmemAddressableBits(uint32_t lowmem_addressing_bits);
33 
34   void SetHighmemAddressableBits(uint32_t highmem_addressing_bits);
35 
36   void SetProcessMasks(lldb_private::Process &process);
37 
38 private:
39   uint32_t m_low_memory_addr_bits;
40   uint32_t m_high_memory_addr_bits;
41 };
42 
43 } // namespace lldb_private
44 
45 #endif // LLDB_UTILITY_ADDRESSABLEBITS_H
46