syscall emulation: fix fast build issue
[gem5.git] / src / sim / system.cc
index 24f9dfbada59ccf773a566715f1bd5799f18ea89..88d2a1625b2db90354f925e8c14e1b09a1764dd8 100644 (file)
@@ -48,7 +48,6 @@
 #include "arch/isa_traits.hh"
 #include "arch/remote_gdb.hh"
 #include "arch/utility.hh"
-#include "arch/vtophys.hh"
 #include "base/loader/object_file.hh"
 #include "base/loader/symtab.hh"
 #include "base/str.hh"
@@ -80,6 +79,7 @@ System::System(Params *p)
       init_param(p->init_param),
       physProxy(_systemPort, p->cache_line_size),
       loadAddrMask(p->load_addr_mask),
+      loadAddrOffset(p->load_offset),
       nextPID(0),
       physmem(name() + ".physmem", p->memories),
       memoryMode(p->mem_mode),
@@ -228,6 +228,7 @@ System::registerThreadContext(ThreadContext *tc, int assigned)
     threadContexts[id] = tc;
     _numContexts++;
 
+#if THE_ISA != NULL_ISA
     int port = getRemoteGDBPort();
     if (port) {
         RemoteGDB *rgdb = new RemoteGDB(this, tc);
@@ -243,6 +244,7 @@ System::registerThreadContext(ThreadContext *tc, int assigned)
 
         remoteGDB[id] = rgdb;
     }
+#endif
 
     activeCpus.push_back(false);
 
@@ -273,14 +275,15 @@ System::initState()
          */
         if (params()->kernel != "")  {
             // Validate kernel mapping before loading binary
-            if (!(isMemAddr(kernelStart & loadAddrMask) &&
-                            isMemAddr(kernelEnd & loadAddrMask))) {
+            if (!(isMemAddr((kernelStart & loadAddrMask) + loadAddrOffset) &&
+                     isMemAddr((kernelEnd & loadAddrMask) + loadAddrOffset))) {
                 fatal("Kernel is mapped to invalid location (not memory). "
-                      "kernelStart 0x(%x) - kernelEnd 0x(%x)\n", kernelStart,
-                      kernelEnd);
+                      "kernelStart 0x(%x) - kernelEnd 0x(%x) %#x:%#x\n", kernelStart,
+                      kernelEnd, (kernelStart & loadAddrMask) + loadAddrOffset,
+                      (kernelEnd & loadAddrMask) + loadAddrOffset);
             }
             // Load program sections into memory
-            kernel->loadSections(physProxy, loadAddrMask);
+            kernel->loadSections(physProxy, loadAddrMask, loadAddrOffset);
 
             DPRINTF(Loader, "Kernel start = %#x\n", kernelStart);
             DPRINTF(Loader, "Kernel end   = %#x\n", kernelEnd);
@@ -459,9 +462,6 @@ System::getMasterName(MasterID master_id)
     return masterIds[master_id];
 }
 
-const char *System::MemoryModeStrings[4] = {"invalid", "atomic", "timing",
-                                            "atomic_noncaching"};
-
 System *
 SystemParams::create()
 {