summaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/base')
-rw-r--r--src/base/bigint.cc4
-rw-r--r--src/base/bigint.hh5
-rw-r--r--src/base/cp_annotate.cc1
-rw-r--r--src/base/cp_annotate.hh1
-rw-r--r--src/base/inet.cc1
-rw-r--r--src/base/loader/elf_object.cc13
-rw-r--r--src/base/loader/object_file.hh3
-rw-r--r--src/base/remote_gdb.cc3
-rw-r--r--src/base/types.hh1
9 files changed, 26 insertions, 6 deletions
diff --git a/src/base/bigint.cc b/src/base/bigint.cc
index ce9942c9c..d741e1f7b 100644
--- a/src/base/bigint.cc
+++ b/src/base/bigint.cc
@@ -28,10 +28,10 @@
* Authors: Gabe Black
*/
-#include "base/bigint.hh"
-
#include <iostream>
+#include "base/bigint.hh"
+
using namespace std;
ostream & operator << (ostream & os, const Twin64_t & t)
diff --git a/src/base/bigint.hh b/src/base/bigint.hh
index d60684231..a4e8738d3 100644
--- a/src/base/bigint.hh
+++ b/src/base/bigint.hh
@@ -28,10 +28,11 @@
* Authors: Ali Saidi
*/
-#include "base/misc.hh"
-
#include <iostream>
+#include "base/misc.hh"
+#include "base/types.hh"
+
#ifndef __BASE_BIGINT_HH__
#define __BASE_BIGINT_HH__
// Create a couple of large int types for atomic reads
diff --git a/src/base/cp_annotate.cc b/src/base/cp_annotate.cc
index 0aba2d999..4e138a6dd 100644
--- a/src/base/cp_annotate.cc
+++ b/src/base/cp_annotate.cc
@@ -35,6 +35,7 @@
#include "base/loader/object_file.hh"
#include "base/output.hh"
#include "base/trace.hh"
+#include "config/the_isa.hh"
#include "cpu/thread_context.hh"
#include "sim/arguments.hh"
#include "sim/core.hh"
diff --git a/src/base/cp_annotate.hh b/src/base/cp_annotate.hh
index 05d8129d0..4248c070a 100644
--- a/src/base/cp_annotate.hh
+++ b/src/base/cp_annotate.hh
@@ -41,6 +41,7 @@
#include "base/trace.hh"
#include "base/types.hh"
#include "config/cp_annotate.hh"
+#include "config/the_isa.hh"
#include "sim/serialize.hh"
#include "sim/startup.hh"
#include "sim/system.hh"
diff --git a/src/base/inet.cc b/src/base/inet.cc
index 898a189ef..1a280e993 100644
--- a/src/base/inet.cc
+++ b/src/base/inet.cc
@@ -28,6 +28,7 @@
* Authors: Nathan Binkert
*/
+#include <cstdio>
#include <sstream>
#include <string>
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 {
diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc
index 6c301b10e..68747b3d1 100644
--- a/src/base/remote_gdb.cc
+++ b/src/base/remote_gdb.cc
@@ -118,6 +118,7 @@
#include <sys/signal.h>
+#include <cstdio>
#include <string>
#include <unistd.h>
@@ -131,9 +132,9 @@
#include "base/remote_gdb.hh"
#include "base/socket.hh"
#include "base/trace.hh"
+#include "config/the_isa.hh"
#include "cpu/thread_context.hh"
#include "cpu/static_inst.hh"
-//#include "mem/physical.hh"
#include "mem/port.hh"
#include "mem/translating_port.hh"
#include "sim/system.hh"
diff --git a/src/base/types.hh b/src/base/types.hh
index 1a6db9fbb..0c10fac64 100644
--- a/src/base/types.hh
+++ b/src/base/types.hh
@@ -55,6 +55,7 @@ typedef int64_t Counter;
* @note using an unsigned breaks the cache.
*/
typedef int64_t Tick;
+typedef uint64_t UTick;
const Tick MaxTick = LL(0x7fffffffffffffff);