misc: Move MemPool based calls to the SEWorkload.
These currently proxy to the System object, but this is one step towards moving the MemPool-s out of the System and into the SEWorkload where they really should have been from the start. Change-Id: Id27e7b874c283abf07bd892c8467a9cc52e2fdff Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50342 Reviewed-by: Matthew Poremba <matthew.poremba@amd.com> Maintainer: Gabe Black <gabe.black@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -332,7 +332,7 @@ Process::allocateMem(Addr vaddr, int64_t size, bool clobber)
|
||||
}
|
||||
|
||||
int npages = divCeil(size, pTable->pageSize());
|
||||
Addr paddr = system->allocPhysPages(npages);
|
||||
Addr paddr = seWorkload->allocPhysPages(npages);
|
||||
pTable->map(vaddr, paddr, size,
|
||||
clobber ? EmulationPageTable::Clobber :
|
||||
EmulationPageTable::MappingFlags(0));
|
||||
@@ -343,7 +343,7 @@ Process::replicatePage(Addr vaddr, Addr new_paddr, ThreadContext *old_tc,
|
||||
ThreadContext *new_tc, bool allocate_page)
|
||||
{
|
||||
if (allocate_page)
|
||||
new_paddr = system->allocPhysPages(1);
|
||||
new_paddr = seWorkload->allocPhysPages(1);
|
||||
|
||||
// Read from old physical page.
|
||||
uint8_t buf_p[pTable->pageSize()];
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "cpu/thread_context.hh"
|
||||
#include "params/SEWorkload.hh"
|
||||
#include "sim/process.hh"
|
||||
#include "sim/system.hh"
|
||||
|
||||
namespace gem5
|
||||
{
|
||||
@@ -43,4 +44,22 @@ SEWorkload::syscall(ThreadContext *tc)
|
||||
tc->getProcessPtr()->syscall(tc);
|
||||
}
|
||||
|
||||
Addr
|
||||
SEWorkload::allocPhysPages(int npages, int pool_id)
|
||||
{
|
||||
return system->allocPhysPages(npages, pool_id);
|
||||
}
|
||||
|
||||
Addr
|
||||
SEWorkload::memSize(int pool_id) const
|
||||
{
|
||||
return system->memSize(pool_id);
|
||||
}
|
||||
|
||||
Addr
|
||||
SEWorkload::freeMemSize(int pool_id) const
|
||||
{
|
||||
return system->freeMemSize(pool_id);
|
||||
}
|
||||
|
||||
} // namespace gem5
|
||||
|
||||
@@ -78,6 +78,10 @@ class SEWorkload : public Workload
|
||||
|
||||
// For now, assume the only type of events are system calls.
|
||||
void event(ThreadContext *tc) override { syscall(tc); }
|
||||
|
||||
Addr allocPhysPages(int npages, int pool_id=0);
|
||||
Addr memSize(int pool_id=0) const;
|
||||
Addr freeMemSize(int pool_id=0) const;
|
||||
};
|
||||
|
||||
} // namespace gem5
|
||||
|
||||
Reference in New Issue
Block a user