29#ifndef __SRC_MEM_VMA_HH__
30#define __SRC_MEM_VMA_HH__
37#include "debug/Vma.hh"
49 int fd=-1, off_t off=0)
52 DPRINTF(Vma,
"Creating vma start %#x len %llu end %#x\n",
53 r.start(),
r.size(),
r.end());
57 std::make_shared<MappedFileBuffer>(
fd,
r.size(), off);
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
This object is a proxy for a port or other object which implements the functional response protocol,...
MappedFileBuffer is a wrapper around a region of host memory backed by a file.
uint64_t getLength() const
MappedFileBuffer(int fd, size_t length, off_t offset)
Addr size()
Defer AddrRange related calls to the AddrRange.
Addr _pageBytes
Number of bytes in an OS page.
void sliceRegionLeft(Addr slice_addr)
Remove the address range to the left of slice_addr.
void fillMemPages(Addr start, Addr size, PortProxy &port) const
Copy memory from a buffer which resides on the host machine into a section of memory on the target.
off_t getFileMappingOffset() const
uint64_t _hostBufLen
Length of host buffer for this virtual memory area.
void remap(Addr new_start)
Remap the virtual memory area starting at new_start.
bool isStrictSuperset(const AddrRange &range) const
Returns true if desired range exists within this virtual memory area and does not include the start a...
AddrRange _addrRange
Address range for this virtual memory area.
std::string _vmaName
Human-readable name associated with the virtual memory area.
void * _hostBuf
Host buffer ptr for this virtual memory area.
std::shared_ptr< MappedFileBuffer > _origHostBuf
The host file backing will be chopped up and reassigned as pages are mapped, remapped,...
VMA(AddrRange r, Addr page_bytes, const std::string &vma_name="anon", int fd=-1, off_t off=0)
bool contains(const Addr &a) const
const std::string & getName()
bool mergesWith(const AddrRange &r) const
bool hasHostBuf() const
Check if the virtual memory area has an equivalent buffer on the host machine.
void sliceRegionRight(Addr slice_addr)
Remove the address range to the right of slice_addr.
bool intersects(const AddrRange &r) const
bool isSubset(const AddrRange &r) const
bool isSubset(const AddrRange &r) const
Determine if this range is a subset of another range, i.e.
bool contains(const Addr &a) const
Determine if the range contains an address.
bool intersects(const AddrRange &r) const
Determine if another range intersects this one, i.e.
Addr end() const
Get the end address of the range.
bool mergesWith(const AddrRange &r) const
Determine if another range merges with the current one, i.e.
Addr start() const
Get the start address of the range.
Addr size() const
Get the size of the address range.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.