summaryrefslogtreecommitdiff
path: root/src/base/loader
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-02-28 16:36:38 +0000
committerGabe Black <gblack@eecs.umich.edu>2007-02-28 16:36:38 +0000
commit29e5df890d9512a6a2c726dcb4ee46b92ac4cb22 (patch)
tree4858cf8e087521bba01ad78783a5f4a768b5ab26 /src/base/loader
parent99948060b2863b37c0db5e6b609ff7ff30de6d1b (diff)
downloadgem5-29e5df890d9512a6a2c726dcb4ee46b92ac4cb22.tar.xz
Make trap instructions always generate TrapInstruction Fault objects which call into the Process object to handle system calls. Refactored the Process objects, and move the handler code into it's own file, and add some syscalls which are used in a natively compiled hello world. Software traps with trap number 3 (not syscall number 3) are supposed to cause the register windows to be flushed but are ignored right now. Finally, made uname for SPARC report a 2.6.12 kernel which is what m22-018.pool happens to be running.
--HG-- extra : convert_revision : ea873f01c62234c0542f310cc143c6a7c76ade94
Diffstat (limited to 'src/base/loader')
-rw-r--r--src/base/loader/elf_object.cc9
-rw-r--r--src/base/loader/object_file.hh3
2 files changed, 9 insertions, 3 deletions
diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc
index d59affe85..b56dc5aa6 100644
--- a/src/base/loader/elf_object.cc
+++ b/src/base/loader/elf_object.cc
@@ -78,9 +78,14 @@ ElfObject::tryFile(const string &fname, int fd, size_t len, uint8_t *data)
//just assume if it wasn't something else and it's 64 bit, that's
//what it must be.
if (ehdr.e_machine == EM_SPARC64 ||
- ehdr.e_machine == EM_SPARC ||
+ (ehdr.e_machine == EM_SPARC &&
+ ehdr.e_ident[EI_CLASS] == ELFCLASS64)||
ehdr.e_machine == EM_SPARCV9) {
- arch = ObjectFile::SPARC;
+ arch = ObjectFile::SPARC64;
+ } else if (ehdr.e_machine == EM_SPARC32PLUS ||
+ (ehdr.e_machine == EM_SPARC &&
+ ehdr.e_ident[EI_CLASS] == ELFCLASS32)) {
+ arch = ObjectFile::SPARC32;
} else if (ehdr.e_machine == EM_MIPS
&& ehdr.e_ident[EI_CLASS] == ELFCLASS32) {
arch = ObjectFile::Mips;
diff --git a/src/base/loader/object_file.hh b/src/base/loader/object_file.hh
index 18e6482be..49c7363e6 100644
--- a/src/base/loader/object_file.hh
+++ b/src/base/loader/object_file.hh
@@ -47,7 +47,8 @@ class ObjectFile
enum Arch {
UnknownArch,
Alpha,
- SPARC,
+ SPARC64,
+ SPARC32,
Mips
};