Go to the documentation of this file.
24 , m_alloc(physRange, pageSize)
25 , m_virtRange(virtRange)
26 , m_pageSize(pageSize)
48 }
else if (args.
size % (allocSize)) {
52 for (
Size i = 0; i < args.
size; i += allocSize)
56 alloc_args.
size = allocSize;
97 return phys - mappingDiff;
103 return virt + mappingDiff;
virtual Result allocate(Range &args)
Allocate physical memory.
BitAllocator m_alloc
Physical memory allocator.
const Size m_pageSize
Size of a memory page.
virtual void execute(void *parameter)=0
Execute the callback.
Represents a callback function.
bool isAllocated(const Address page) const
Check if a chunk is allocated.
virtual Size available() const
Get memory available.
Result allocateAt(const Address addr)
Allocate a specific address.
unsigned long Address
A memory address.
Address address
Starting address of the memory range.
Size alignment
Alignment in bytes or ZERO for default alignment.
virtual Size available() const
Get available memory.
Size size
Amount of memory in bytes.
virtual Result release(const Address chunk)
Release memory chunk.
unsigned int Size
Any sane size indicator cannot go negative.
Address base() const
Get memory base address for allocations.
Describes a range of memory.
const Range m_virtRange
Virtual memory range to manage.
virtual Result release(const Address addr)
Release memory page.
Address toPhysical(const Address virt) const
Convert Address to physical pointer.
virtual Result allocate(Range &args)
Allocate memory.
SplitAllocator(const Range physRange, const Range virtRange, const Size pageSize)
Class constructor.
bool isAllocated(const Address page) const
Check if a physical page is allocated.
Address toVirtual(const Address phys) const
Convert Address to virtual pointer.
Result
Allocation results.
Result allocateSparse(const Range &range, CallbackFunction *function)
Allocate sparse (non-contiguous) physical memory.