From dfd191367991cb157b53767dcc05824c826b5abd Mon Sep 17 00:00:00 2001 From: Iman Hosseini Date: Tue, 20 Sep 2022 00:05:00 -0400 Subject: detects the loading of isa-incompatible (i.e. 32 bit code to 64bit HART) code and emits an error message to help avoid unintentionally loading wrong elf. --- fesvr/memif.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'fesvr/memif.h') diff --git a/fesvr/memif.h b/fesvr/memif.h index 001c425..3f9bd2d 100644 --- a/fesvr/memif.h +++ b/fesvr/memif.h @@ -5,6 +5,7 @@ #include #include +#include #include "byteorder.h" typedef uint64_t reg_t; @@ -79,4 +80,11 @@ protected: chunked_memif_t* cmemif; }; +class incompat_xlen : public std::exception { +public: + const unsigned expected_xlen; + const unsigned actual_xlen; + incompat_xlen(unsigned _expected_xlen, unsigned _actual_xlen) : expected_xlen(_expected_xlen), actual_xlen(_actual_xlen) {} +}; + #endif // __MEMIF_H -- cgit v1.1 From f8752d8feea04303d5f3bdeabce8864b3b2430ed Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Thu, 22 Sep 2022 17:29:50 -0700 Subject: Suppress several unused-parameter warnings in fesvr --- fesvr/memif.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fesvr/memif.h') diff --git a/fesvr/memif.h b/fesvr/memif.h index 3f9bd2d..9eebed4 100644 --- a/fesvr/memif.h +++ b/fesvr/memif.h @@ -28,7 +28,8 @@ public: virtual size_t chunk_align() = 0; virtual size_t chunk_max_size() = 0; - virtual void set_target_endianness(memif_endianness_t endianness) {} + virtual void set_target_endianness(memif_endianness_t) {} + virtual memif_endianness_t get_target_endianness() const { return memif_endianness_undecided; } -- cgit v1.1 From f5ec721fa966ce92390afc48b13d492f4045c4ae Mon Sep 17 00:00:00 2001 From: Jerin Joy Date: Thu, 22 Sep 2022 23:12:36 -0700 Subject: Fixed -Wnon-virtual-dtor warnings Signed-off-by: Jerin Joy --- fesvr/memif.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fesvr/memif.h') diff --git a/fesvr/memif.h b/fesvr/memif.h index 9eebed4..7c73f48 100644 --- a/fesvr/memif.h +++ b/fesvr/memif.h @@ -33,6 +33,8 @@ public: virtual memif_endianness_t get_target_endianness() const { return memif_endianness_undecided; } + + virtual ~chunked_memif_t() = default; }; class memif_t -- cgit v1.1