41 : pageShift(page_shift), startPageNum(ptr >> page_shift),
42 freePageNum(ptr >> page_shift),
43 _totalPages((
limit - ptr) >> page_shift)
121 "Out of memory, please increase size of physical memory.");
147 for (
const auto &
mem : memories)
154 return pools[pool_id].allocate(npages);
160 return pools[pool_id].totalBytes();
166 return pools[pool_id].freeBytes();
173 int num_pools =
pools.size();
176 for (
int i = 0;
i < num_pools;
i++)
190 for (
int i = 0;
i < num_pools;
i++) {
193 pools.push_back(pool);
Class for handling allocation of physical pages in SE mode.
void setFreePage(Counter value)
Counter totalPages() const
void serialize(CheckpointOut &cp) const override
Serialize an object.
Addr freePageAddr() const
Counter _totalPages
The size of the pool, in number of pages.
Counter allocatedPages() const
Counter startPageNum
Start page of pool.
Addr allocatedBytes() const
Counter startPage() const
Addr allocate(Addr npages)
Counter freePages() const
Counter freePageNum
Page number of free memory.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Addr allocPhysPages(int npages, int pool_id=0)
Allocate npages contiguous unused physical pages.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void populate(const AddrRangeList &memories)
Addr freeMemSize(int pool_id=0) const
Amount of physical memory that is still free in a pool.
std::vector< MemPool > pools
Addr memSize(int pool_id=0) const
Amount of physical memory that exists in a pool.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
#define gem5_assert(cond,...)
The assert macro will function like a normal assert, but will use panic instead of straight abort().
void serializeSection(CheckpointOut &cp, const char *name) const
Serialize an object into a new section.
void unserializeSection(CheckpointIn &cp, const char *name)
Unserialize an a child object.
BitfieldType< SegDescriptorLimit > limit
double Counter
All counters are of 64-bit values.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void paramOut(CheckpointOut &cp, const std::string &name, ExtMachInst const &machInst)
void paramIn(CheckpointIn &cp, const std::string &name, ExtMachInst &machInst)
std::string csprintf(const char *format, const Args &...args)
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)