SE/FS: Make some system funcs available in SE and FS.
This commit is contained in:
parent
464c485d0c
commit
ca36c01f7e
2 changed files with 8 additions and 20 deletions
|
@ -65,14 +65,12 @@ vector<System *> System::systemList;
|
||||||
int System::numSystemsRunning = 0;
|
int System::numSystemsRunning = 0;
|
||||||
|
|
||||||
System::System(Params *p)
|
System::System(Params *p)
|
||||||
: SimObject(p), physmem(p->physmem), _numContexts(0),
|
: SimObject(p), physmem(p->physmem), _numContexts(0), pagePtr(0),
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
init_param(p->init_param),
|
init_param(p->init_param),
|
||||||
loadAddrMask(p->load_addr_mask),
|
loadAddrMask(p->load_addr_mask),
|
||||||
#else
|
|
||||||
pagePtr(0),
|
|
||||||
nextPID(0),
|
|
||||||
#endif
|
#endif
|
||||||
|
nextPID(0),
|
||||||
memoryMode(p->mem_mode),
|
memoryMode(p->mem_mode),
|
||||||
workItemsBegin(0),
|
workItemsBegin(0),
|
||||||
workItemsEnd(0),
|
workItemsEnd(0),
|
||||||
|
@ -273,7 +271,6 @@ System::replaceThreadContext(ThreadContext *tc, int context_id)
|
||||||
remoteGDB[context_id]->replaceThreadContext(tc);
|
remoteGDB[context_id]->replaceThreadContext(tc);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !FULL_SYSTEM
|
|
||||||
Addr
|
Addr
|
||||||
System::new_page()
|
System::new_page()
|
||||||
{
|
{
|
||||||
|
@ -296,8 +293,6 @@ System::freeMemSize()
|
||||||
return physmem->size() - (pagePtr << LogVMPageSize);
|
return physmem->size() - (pagePtr << LogVMPageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
System::isMemory(const Addr addr) const
|
System::isMemory(const Addr addr) const
|
||||||
{
|
{
|
||||||
|
@ -321,10 +316,9 @@ System::serialize(ostream &os)
|
||||||
{
|
{
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
kernelSymtab->serialize("kernel_symtab", os);
|
kernelSymtab->serialize("kernel_symtab", os);
|
||||||
#else // !FULL_SYSTEM
|
#endif
|
||||||
SERIALIZE_SCALAR(pagePtr);
|
SERIALIZE_SCALAR(pagePtr);
|
||||||
SERIALIZE_SCALAR(nextPID);
|
SERIALIZE_SCALAR(nextPID);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -333,10 +327,9 @@ System::unserialize(Checkpoint *cp, const string §ion)
|
||||||
{
|
{
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
kernelSymtab->unserialize("kernel_symtab", cp, section);
|
kernelSymtab->unserialize("kernel_symtab", cp, section);
|
||||||
#else // !FULL_SYSTEM
|
#endif
|
||||||
UNSERIALIZE_SCALAR(pagePtr);
|
UNSERIALIZE_SCALAR(pagePtr);
|
||||||
UNSERIALIZE_SCALAR(nextPID);
|
UNSERIALIZE_SCALAR(nextPID);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -113,6 +113,8 @@ class System : public SimObject
|
||||||
*/
|
*/
|
||||||
bool isMemory(const Addr addr) const;
|
bool isMemory(const Addr addr) const;
|
||||||
|
|
||||||
|
Addr pagePtr;
|
||||||
|
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
uint64_t init_param;
|
uint64_t init_param;
|
||||||
|
|
||||||
|
@ -144,9 +146,7 @@ class System : public SimObject
|
||||||
*/
|
*/
|
||||||
Addr loadAddrMask;
|
Addr loadAddrMask;
|
||||||
|
|
||||||
#else
|
#endif // FULL_SYSTEM
|
||||||
|
|
||||||
Addr pagePtr;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
uint64_t nextPID;
|
uint64_t nextPID;
|
||||||
|
@ -163,9 +163,6 @@ class System : public SimObject
|
||||||
/** Amount of physical memory that exists */
|
/** Amount of physical memory that exists */
|
||||||
Addr memSize();
|
Addr memSize();
|
||||||
|
|
||||||
|
|
||||||
#endif // FULL_SYSTEM
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Enums::MemoryMode memoryMode;
|
Enums::MemoryMode memoryMode;
|
||||||
uint64_t workItemsBegin;
|
uint64_t workItemsBegin;
|
||||||
|
@ -284,12 +281,10 @@ class System : public SimObject
|
||||||
*/
|
*/
|
||||||
Addr getKernelEntry() const { return kernelEntry; }
|
Addr getKernelEntry() const { return kernelEntry; }
|
||||||
|
|
||||||
#else
|
#endif
|
||||||
|
|
||||||
Addr new_page();
|
Addr new_page();
|
||||||
|
|
||||||
#endif // FULL_SYSTEM
|
|
||||||
|
|
||||||
int registerThreadContext(ThreadContext *tc, int assigned=-1);
|
int registerThreadContext(ThreadContext *tc, int assigned=-1);
|
||||||
void replaceThreadContext(ThreadContext *tc, int context_id);
|
void replaceThreadContext(ThreadContext *tc, int context_id);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue