summaryrefslogtreecommitdiff
path: root/src/base/loader
diff options
context:
space:
mode:
authorTimothy M. Jones <tjones1@inf.ed.ac.uk>2009-10-27 09:24:39 -0700
committerTimothy M. Jones <tjones1@inf.ed.ac.uk>2009-10-27 09:24:39 -0700
commit835a55e7f347697815fc43851b2dd5a8642d21c4 (patch)
tree637768b1de6de2bc4520fad97f90194ad6d3f8d6 /src/base/loader
parent0fdfc82bde5b8975ee93d5da9c604ad9b99942e0 (diff)
downloadgem5-835a55e7f347697815fc43851b2dd5a8642d21c4.tar.xz
POWER: Add support for the Power ISA
This adds support for the 32-bit, big endian Power ISA. This supports both integer and floating point instructions based on the Power ISA Book I v2.06.
Diffstat (limited to 'src/base/loader')
-rw-r--r--src/base/loader/elf_object.cc13
-rw-r--r--src/base/loader/object_file.hh3
2 files changed, 15 insertions, 1 deletions
diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc
index 15ad88f76..60f0f99b4 100644
--- a/src/base/loader/elf_object.cc
+++ b/src/base/loader/elf_object.cc
@@ -97,6 +97,19 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data)
arch = ObjectFile::Alpha;
} else if (ehdr.e_machine == EM_ARM) {
arch = ObjectFile::Arm;
+ } else if (ehdr.e_machine == EM_PPC &&
+ ehdr.e_ident[EI_CLASS] == ELFCLASS32) {
+ if (ehdr.e_ident[EI_DATA] == ELFDATA2MSB) {
+ arch = ObjectFile::Power;
+ } else {
+ fatal("The binary you're trying to load is compiled for "
+ "little endian Power.\nM5 only supports big "
+ "endian Power. Please recompile your binary.\n");
+ }
+ } else if (ehdr.e_machine == EM_PPC64) {
+ fatal("The binary you're trying to load is compiled for 64-bit "
+ "Power. M5\n only supports 32-bit Power. Please "
+ "recompile your binary.\n");
} else {
warn("Unknown architecture: %d\n", ehdr.e_machine);
arch = ObjectFile::UnknownArch;
diff --git a/src/base/loader/object_file.hh b/src/base/loader/object_file.hh
index e511451b7..b08f1c633 100644
--- a/src/base/loader/object_file.hh
+++ b/src/base/loader/object_file.hh
@@ -52,7 +52,8 @@ class ObjectFile
Mips,
X86_64,
I386,
- Arm
+ Arm,
+ Power
};
enum OpSys {