summaryrefslogtreecommitdiff
path: root/sim/system.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2006-01-28 00:08:22 -0500
committerSteve Reinhardt <stever@eecs.umich.edu>2006-01-28 00:08:22 -0500
commit03a2aca9a9fc6afa8d7e6f92cc9acc1e9b37a7cd (patch)
tree3f7061edd21acae37fc6208a3895f7b37f76512a /sim/system.hh
parent9df80550d43dd875e3449bd2287b0bccde36dcad (diff)
downloadgem5-03a2aca9a9fc6afa8d7e6f92cc9acc1e9b37a7cd.tar.xz
Changes for Process object initialization in merged-memory environment.
System object now exists for both fullsys and syscall emulation, as the latter needs it so that Process objects can find the shared PhysicalMemory for initialization. Changes are incomplete: still need to fix up Process (& EioProcess) memory initialization and syscall emulation code for new mem interface. arch/alpha/alpha_linux_process.cc: arch/alpha/alpha_linux_process.hh: arch/alpha/alpha_tru64_process.cc: arch/alpha/alpha_tru64_process.hh: cpu/base.cc: cpu/base.hh: Take System argument in constructor. cpu/exec_context.cc: Take System argument in constructor. Merge two constructors into a single one. cpu/exec_context.hh: Take System argument in constructor. Merge two constructors into a single one. Replace dummy translation with lookup in Process object's page table. python/m5/objects/Process.py: Add System parameter to Process object (& subobjects). python/m5/objects/System.py: Segregate full-system only Process parameters (most of them!). sim/process.cc: Take System argument in constructor. Move initialization to startup() callback to occur after system & cpus are initialized. Generate ProxyMemory object to pass to loader for transparent virtual page allocation. sim/process.hh: Take System argument in constructor. Move initialization to startup() callback to occur after system & cpus are initialized. sim/system.cc: sim/system.hh: Enable System object for non-full-system too. Basically involved putting most of the existing code inside '#ifdef FULL_SYSTEM'. Key thing needed for syscall emulation at this point is the PhysicalMemory object (for Process initialization). --HG-- extra : convert_revision : f0f34b47bd4f77b502191affd3d03b4d6d9bcdd8
Diffstat (limited to 'sim/system.hh')
-rw-r--r--sim/system.hh43
1 files changed, 36 insertions, 7 deletions
diff --git a/sim/system.hh b/sim/system.hh
index aa697c040..6602f8582 100644
--- a/sim/system.hh
+++ b/sim/system.hh
@@ -35,27 +35,29 @@
#include "base/statistics.hh"
#include "base/loader/symtab.hh"
#include "cpu/pc_event.hh"
-#include "kern/system_events.hh"
#include "sim/sim_object.hh"
+#if FULL_SYSTEM
+#include "kern/system_events.hh"
+#endif
class BaseCPU;
class ExecContext;
-class GDBListener;
class MemoryController;
class ObjectFile;
class PhysicalMemory;
+
+#if FULL_SYSTEM
class Platform;
+class GDBListener;
class RemoteGDB;
namespace Kernel { class Binning; }
+#endif
class System : public SimObject
{
public:
- MemoryController *memctrl;
PhysicalMemory *physmem;
- Platform *platform;
PCEventQueue pcEventQueue;
- uint64_t init_param;
std::vector<ExecContext *> execContexts;
int numcpus;
@@ -68,6 +70,11 @@ class System : public SimObject
return numcpus;
}
+#if FULL_SYSTEM
+ MemoryController *memctrl;
+ Platform *platform;
+ uint64_t init_param;
+
/** kernel symbol table */
SymbolTable *kernelSymtab;
@@ -97,11 +104,18 @@ class System : public SimObject
Kernel::Binning *kernelBinning;
-#ifndef NDEBUG
+#ifdef DEBUG
/** Event to halt the simulator if the console calls panic() */
BreakPCEvent *consolePanicEvent;
#endif
+#else
+
+ int page_ptr;
+
+
+#endif // FULL_SYSTEM
+
protected:
/**
@@ -128,6 +142,7 @@ class System : public SimObject
return NULL;
}
+#if FULL_SYSTEM
/** Add a function-based event to kernel code. */
template <class T>
T *System::addKernelFuncEvent(const char *lbl)
@@ -148,19 +163,24 @@ class System : public SimObject
{
return addFuncEvent<T>(consoleSymtab, lbl);
}
+#endif
public:
+#if FULL_SYSTEM
std::vector<RemoteGDB *> remoteGDB;
std::vector<GDBListener *> gdbListen;
bool breakpoint();
+#endif // FULL_SYSTEM
public:
struct Params
{
std::string name;
+ PhysicalMemory *physmem;
+
+#if FULL_SYSTEM
Tick boot_cpu_frequency;
MemoryController *memctrl;
- PhysicalMemory *physmem;
uint64_t init_param;
bool bin;
std::vector<std::string> binned_fns;
@@ -174,6 +194,7 @@ class System : public SimObject
std::string readfile;
uint64_t system_type;
uint64_t system_rev;
+#endif
};
Params *params;
@@ -183,6 +204,8 @@ class System : public SimObject
void startup();
public:
+
+#if FULL_SYSTEM
/**
* Set the m5AlphaAccess pointer in the console
*/
@@ -206,6 +229,12 @@ class System : public SimObject
*/
Addr getKernelEntry() const { return kernelEntry; }
+#else
+
+ Addr new_page();
+
+#endif // FULL_SYSTEM
+
int registerExecContext(ExecContext *xc, int xcIndex);
void replaceExecContext(ExecContext *xc, int xcIndex);