Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:56

0001 //===-- AddressableBits.h ---------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_UTILITY_ADDRESSABLEBITS_H
0010 #define LLDB_UTILITY_ADDRESSABLEBITS_H
0011 
0012 #include "lldb/lldb-forward.h"
0013 #include "lldb/lldb-public.h"
0014 
0015 #include <cstdint>
0016 
0017 namespace lldb_private {
0018 
0019 /// \class AddressableBits AddressableBits.h "lldb/Core/AddressableBits.h"
0020 /// A class which holds the metadata from a remote stub/corefile note
0021 /// about how many bits are used for addressing on this target.
0022 ///
0023 class AddressableBits {
0024 public:
0025   AddressableBits() : m_low_memory_addr_bits(0), m_high_memory_addr_bits(0) {}
0026 
0027   /// When a single value is available for the number of bits.
0028   void SetAddressableBits(uint32_t addressing_bits);
0029 
0030   /// When we have separate values for low memory addresses and high memory
0031   /// addresses.
0032   void SetAddressableBits(uint32_t lowmem_addressing_bits,
0033                           uint32_t highmem_addressing_bits);
0034 
0035   void SetLowmemAddressableBits(uint32_t lowmem_addressing_bits);
0036 
0037   uint32_t GetLowmemAddressableBits() const;
0038 
0039   void SetHighmemAddressableBits(uint32_t highmem_addressing_bits);
0040 
0041   uint32_t GetHighmemAddressableBits() const;
0042 
0043   static lldb::addr_t AddressableBitToMask(uint32_t addressable_bits);
0044 
0045 private:
0046   uint32_t m_low_memory_addr_bits;
0047   uint32_t m_high_memory_addr_bits;
0048 };
0049 
0050 } // namespace lldb_private
0051 
0052 #endif // LLDB_UTILITY_ADDRESSABLEBITS_H