summaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorAustin Harris <austinharris@utexas.edu>2018-12-26 19:19:00 -0600
committerAustin Harris <austin.dane.harris@gmail.com>2019-02-07 01:48:08 +0000
commit9c5373ca61587409e4d0f6ad4c032e8d53be28ca (patch)
tree21f173c01ba01f908b4eb449cf43b6b628081a91 /src/base
parentea487f9bb7b35556a39ef25765859330e62b11ae (diff)
downloadgem5-9c5373ca61587409e4d0f6ad4c032e8d53be28ca.tar.xz
arch-riscv: Enable support for riscv 32-bit in SE mode.
This patch splits up the riscv SE mode support for 32 and 64-bit. A future patch will add support for decoding rv32 instructions. Change-Id: Ia79ae19f753caf94dc7e5830a6630efb94b419d7 Signed-off-by: Austin Harris <austinharris@utexas.edu> Reviewed-on: https://gem5-review.googlesource.com/c/15355 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Alec Roelke <alec.roelke@gmail.com> Maintainer: Alec Roelke <alec.roelke@gmail.com>
Diffstat (limited to 'src/base')
-rw-r--r--src/base/loader/elf_object.cc2
-rw-r--r--src/base/loader/object_file.hh3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc
index 60c79f803..761fd79f5 100644
--- a/src/base/loader/elf_object.cc
+++ b/src/base/loader/elf_object.cc
@@ -112,7 +112,7 @@ ElfObject::tryFile(const std::string &fname, size_t len, uint8_t *data,
ehdr.e_ident[EI_CLASS] == ELFCLASS64) {
arch = Arm64;
} else if (ehdr.e_machine == EM_RISCV) {
- arch = Riscv;
+ arch = (ehdr.e_ident[EI_CLASS] == ELFCLASS64) ? Riscv64 : Riscv32;
} else if (ehdr.e_machine == EM_PPC &&
ehdr.e_ident[EI_CLASS] == ELFCLASS32) {
arch = Power;
diff --git a/src/base/loader/object_file.hh b/src/base/loader/object_file.hh
index c2cdafe47..09c453b8d 100644
--- a/src/base/loader/object_file.hh
+++ b/src/base/loader/object_file.hh
@@ -57,7 +57,8 @@ class ObjectFile
Arm,
Thumb,
Power,
- Riscv
+ Riscv64,
+ Riscv32
};
enum OpSys {