diff options
author | Jerry Zhao <jerryz123@berkeley.edu> | 2022-12-13 16:51:45 -0800 |
---|---|---|
committer | Jerry Zhao <jerryz123@berkeley.edu> | 2022-12-15 14:02:40 -0800 |
commit | 9f93b98c87cfdbcbeb59b9da298344c840f747a4 (patch) | |
tree | 3ba6d247ca03596c7a9b9ab7ed93957a69b33c6d /fesvr | |
parent | 4d4159e76d61980e300cea7bdbdab873f07db12a (diff) | |
download | spike-9f93b98c87cfdbcbeb59b9da298344c840f747a4.zip spike-9f93b98c87cfdbcbeb59b9da298344c840f747a4.tar.gz spike-9f93b98c87cfdbcbeb59b9da298344c840f747a4.tar.bz2 |
Rename memif_endianness_t to endianness_t
Diffstat (limited to 'fesvr')
-rw-r--r-- | fesvr/elfloader.cc | 4 | ||||
-rw-r--r-- | fesvr/htif.h | 12 | ||||
-rw-r--r-- | fesvr/memif.h | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/fesvr/elfloader.cc b/fesvr/elfloader.cc index 7357b47..192de65 100644 --- a/fesvr/elfloader.cc +++ b/fesvr/elfloader.cc @@ -98,7 +98,7 @@ std::map<std::string, uint64_t> load_elf(const char* fn, memif_t* memif, reg_t* } while (0) if (IS_ELFLE(*eh64)) { - if (memif->get_target_endianness() != memif_endianness_little) { + if (memif->get_target_endianness() != endianness_little) { throw std::invalid_argument("Specified ELF is little endian, but system uses a big-endian memory system. Rerun without --big-endian"); } if (IS_ELF32(*eh64)) @@ -109,7 +109,7 @@ std::map<std::string, uint64_t> load_elf(const char* fn, memif_t* memif, reg_t* #ifndef RISCV_ENABLE_DUAL_ENDIAN throw std::invalid_argument("Specified ELF is big endian. Configure with --enable-dual-endian to enable support"); #else - if (memif->get_target_endianness() != memif_endianness_big) { + if (memif->get_target_endianness() != endianness_big) { throw std::invalid_argument("Specified ELF is big endian, but system uses a little-endian memory system. Rerun with --big-endian"); } if (IS_ELF32(*eh64)) diff --git a/fesvr/htif.h b/fesvr/htif.h index 5767e31..f63ff1c 100644 --- a/fesvr/htif.h +++ b/fesvr/htif.h @@ -31,18 +31,18 @@ class htif_t : public chunked_memif_t template<typename T> inline T from_target(target_endian<T> n) const { - memif_endianness_t endianness = get_target_endianness(); - assert(endianness == memif_endianness_little || endianness == memif_endianness_big); + endianness_t endianness = get_target_endianness(); + assert(endianness == endianness_little || endianness == endianness_big); - return endianness == memif_endianness_big? n.from_be() : n.from_le(); + return endianness == endianness_big? n.from_be() : n.from_le(); } template<typename T> inline target_endian<T> to_target(T n) const { - memif_endianness_t endianness = get_target_endianness(); - assert(endianness == memif_endianness_little || endianness == memif_endianness_big); + endianness_t endianness = get_target_endianness(); + assert(endianness == endianness_little || endianness == endianness_big); - return endianness == memif_endianness_big? target_endian<T>::to_be(n) : target_endian<T>::to_le(n); + return endianness == endianness_big? target_endian<T>::to_be(n) : target_endian<T>::to_le(n); } protected: diff --git a/fesvr/memif.h b/fesvr/memif.h index aa4ca98..fff2f55 100644 --- a/fesvr/memif.h +++ b/fesvr/memif.h @@ -23,8 +23,8 @@ public: virtual size_t chunk_align() = 0; virtual size_t chunk_max_size() = 0; - virtual memif_endianness_t get_target_endianness() const { - return memif_endianness_little; + virtual endianness_t get_target_endianness() const { + return endianness_little; } virtual ~chunked_memif_t() = default; @@ -65,7 +65,7 @@ public: virtual void write_int64(addr_t addr, target_endian<int64_t> val); // endianness - virtual memif_endianness_t get_target_endianness() const { + virtual endianness_t get_target_endianness() const { return cmemif->get_target_endianness(); } |