projects
/
gem5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ARM: Make VMSR, RFE PC/LR etc non speculative, and serializing
[gem5.git]
/
src
/
sim
/
system.cc
diff --git
a/src/sim/system.cc
b/src/sim/system.cc
index 29b1d1f61df89d7fc0a123591fde82763000f713..45e06616da83929bfd217a348e6658dfbe2179af 100644
(file)
--- a/
src/sim/system.cc
+++ b/
src/sim/system.cc
@@
-38,11
+38,14
@@
#include "base/loader/symtab.hh"
#include "base/trace.hh"
#include "cpu/thread_context.hh"
#include "base/loader/symtab.hh"
#include "base/trace.hh"
#include "cpu/thread_context.hh"
+#include "config/full_system.hh"
+#include "config/the_isa.hh"
#include "mem/mem_object.hh"
#include "mem/physical.hh"
#include "sim/byteswap.hh"
#include "sim/system.hh"
#include "sim/debug.hh"
#include "mem/mem_object.hh"
#include "mem/physical.hh"
#include "sim/byteswap.hh"
#include "sim/system.hh"
#include "sim/debug.hh"
+
#if FULL_SYSTEM
#include "arch/vtophys.hh"
#include "kern/kernel_stats.hh"
#if FULL_SYSTEM
#include "arch/vtophys.hh"
#include "kern/kernel_stats.hh"
@@
-63,6
+66,7
@@
System::System(Params *p)
init_param(p->init_param),
functionalPort(p->name + "-fport"),
virtPort(p->name + "-vport"),
init_param(p->init_param),
functionalPort(p->name + "-fport"),
virtPort(p->name + "-vport"),
+ loadAddrMask(p->load_addr_mask),
#else
page_ptr(0),
next_PID(0),
#else
page_ptr(0),
next_PID(0),
@@
-95,18
+99,18
@@
System::System(Params *p)
* Load the kernel code into memory
*/
if (params()->kernel == "") {
* Load the kernel code into memory
*/
if (params()->kernel == "") {
-
warn
("No kernel set for full system simulation. Assuming you know what"
+
inform
("No kernel set for full system simulation. Assuming you know what"
" you're doing...\n");
} else {
// Load kernel code
kernel = createObjectFile(params()->kernel);
" you're doing...\n");
} else {
// Load kernel code
kernel = createObjectFile(params()->kernel);
-
warn
("kernel located at: %s", params()->kernel);
+
inform
("kernel located at: %s", params()->kernel);
if (kernel == NULL)
fatal("Could not load kernel file %s", params()->kernel);
// Load program sections into memory
if (kernel == NULL)
fatal("Could not load kernel file %s", params()->kernel);
// Load program sections into memory
- kernel->loadSections(&functionalPort,
L
oadAddrMask);
+ kernel->loadSections(&functionalPort,
l
oadAddrMask);
// setup entry points
kernelStart = kernel->textBase();
// setup entry points
kernelStart = kernel->textBase();
@@
-115,16
+119,16
@@
System::System(Params *p)
// load symbols
if (!kernel->loadGlobalSymbols(kernelSymtab))
// load symbols
if (!kernel->loadGlobalSymbols(kernelSymtab))
-
panic
("could not load kernel symbols\n");
+
fatal
("could not load kernel symbols\n");
if (!kernel->loadLocalSymbols(kernelSymtab))
if (!kernel->loadLocalSymbols(kernelSymtab))
-
panic
("could not load kernel local symbols\n");
+
fatal
("could not load kernel local symbols\n");
if (!kernel->loadGlobalSymbols(debugSymbolTable))
if (!kernel->loadGlobalSymbols(debugSymbolTable))
-
panic
("could not load kernel symbols\n");
+
fatal
("could not load kernel symbols\n");
if (!kernel->loadLocalSymbols(debugSymbolTable))
if (!kernel->loadLocalSymbols(debugSymbolTable))
-
panic
("could not load kernel local symbols\n");
+
fatal
("could not load kernel local symbols\n");
DPRINTF(Loader, "Kernel start = %#x\n", kernelStart);
DPRINTF(Loader, "Kernel end = %#x\n", kernelEnd);
DPRINTF(Loader, "Kernel start = %#x\n", kernelStart);
DPRINTF(Loader, "Kernel end = %#x\n", kernelEnd);
@@
-148,9
+152,6
@@
System::~System()
#endif // FULL_SYSTEM}
}
#endif // FULL_SYSTEM}
}
-int rgdb_wait = -1;
-int rgdb_enable = true;
-
void
System::setMemoryMode(Enums::MemoryMode mode)
{
void
System::setMemoryMode(Enums::MemoryMode mode)
{
@@
-165,6
+166,13
@@
bool System::breakpoint()
return false;
}
return false;
}
+/**
+ * Setting rgdb_wait to a positive integer waits for a remote debugger to
+ * connect to that context ID before continuing. This should really
+ be a parameter on the CPU object or something...
+ */
+int rgdb_wait = -1;
+
int
System::registerThreadContext(ThreadContext *tc, int assigned)
{
int
System::registerThreadContext(ThreadContext *tc, int assigned)
{
@@
-184,20
+192,17
@@
System::registerThreadContext(ThreadContext *tc, int assigned)
}
if (threadContexts[id])
}
if (threadContexts[id])
-
panic
("Cannot have two CPUs with the same id (%d)\n", id);
+
fatal
("Cannot have two CPUs with the same id (%d)\n", id);
threadContexts[id] = tc;
_numContexts++;
int port = getRemoteGDBPort();
threadContexts[id] = tc;
_numContexts++;
int port = getRemoteGDBPort();
- if (
rgdb_enable &&
port) {
+ if (port) {
RemoteGDB *rgdb = new RemoteGDB(this, tc);
GDBListener *gdbl = new GDBListener(rgdb, port + id);
gdbl->listen();
RemoteGDB *rgdb = new RemoteGDB(this, tc);
GDBListener *gdbl = new GDBListener(rgdb, port + id);
gdbl->listen();
- /**
- * Uncommenting this line waits for a remote debugger to
- * connect to the simulator before continuing.
- */
+
if (rgdb_wait != -1 && rgdb_wait == id)
gdbl->accept();
if (rgdb_wait != -1 && rgdb_wait == id)
gdbl->accept();
@@
-211,6
+216,17
@@
System::registerThreadContext(ThreadContext *tc, int assigned)
return id;
}
return id;
}
+int
+System::numRunningContexts()
+{
+ int running = 0;
+ for (int i = 0; i < _numContexts; ++i) {
+ if (threadContexts[i]->status() != ThreadContext::Halted)
+ ++running;
+ }
+ return running;
+}
+
void
System::startup()
{
void
System::startup()
{
@@
-244,6
+260,19
@@
System::new_page()
fatal("Out of memory, please increase size of physical memory.");
return return_addr;
}
fatal("Out of memory, please increase size of physical memory.");
return return_addr;
}
+
+Addr
+System::memSize()
+{
+ return physmem->size();
+}
+
+Addr
+System::freeMemSize()
+{
+ return physmem->size() - (page_ptr << LogVMPageSize);
+}
+
#endif
void
#endif
void