sim: Make the page shift a member of the MemPool class.
Pass it in through the constructor, rather than have the MemPool call into the System object every time it needs the page shift. This is simpler, more efficient, and removes a dependency between the MemPool class and the System class. Change-Id: I059bcb0db249251b32bff1beba3eadfe306d9081 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50339 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:
@@ -236,9 +236,10 @@ System::System(const Params &p)
|
||||
if (_m5opRange.valid()) {
|
||||
// Make sure the m5op range is not included.
|
||||
for (const auto &range: mem.exclude({_m5opRange}))
|
||||
memPools.emplace_back(this, range.start(), range.end());
|
||||
memPools.emplace_back(getPageShift(),
|
||||
range.start(), range.end());
|
||||
} else {
|
||||
memPools.emplace_back(this, mem.start(), mem.end());
|
||||
memPools.emplace_back(getPageShift(), mem.start(), mem.end());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,7 +469,7 @@ System::unserialize(CheckpointIn &cp)
|
||||
|
||||
assert(ptrs.size() == limits.size());
|
||||
for (size_t i = 0; i < ptrs.size(); i++)
|
||||
memPools.emplace_back(this, ptrs[i], limits[i]);
|
||||
memPools.emplace_back(getPageShift(), ptrs[i], limits[i]);
|
||||
|
||||
// also unserialize the memories in the system
|
||||
physmem.unserializeSection(cp, "physmem");
|
||||
|
||||
Reference in New Issue
Block a user