Go to the documentation of this file.
35 #include "config/the_isa.hh"
121 : _buffer(nullptr), _length(
length)
125 struct stat file_stat;
126 if (fstat(
fd, &file_stat) > 0) {
127 panic(
"Cannot stat file: %s\n", strerror(errno));
132 "Tried to mmap with offset greater than file size");
140 panic(
"Failed to map file into host address space: %s",
144 panic(
"Tried to mmap 0 bytes");
151 panic_if(munmap(_buffer, _length) == -1,
152 "mmap: failed to unmap file-backed host memory: %s",
void sliceRegionLeft(Addr slice_addr)
Remove the address range to the left of slice_addr.
Addr end() const
Get the end address of the range.
uint64_t _hostBufLen
Length of host buffer 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,...
void sliceRegionRight(Addr slice_addr)
Remove the address range to the right of slice_addr.
bool hasHostBuf() const
Check if the virtual memory area has an equivalent buffer on the host machine.
void writeBlob(Addr addr, const void *p, int size) const
Same as tryWriteBlob, but insists on success.
void * _hostBuf
Host buffer ptr for this virtual memory area.
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
Addr size()
Defer AddrRange related calls to the AddrRange.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
This object is a proxy for a port or other object which implements the functional response protocol,...
Addr start() const
Get the start address of the range.
AddrRange _addrRange
Address range for this virtual memory area.
bool isStrictSuperset(const AddrRange &range) const
Returns true if desired range exists within this virtual memory area and does not include the start a...
MappedFileBuffer(int fd, size_t length, off_t offset)
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.
Addr _pageBytes
Number of bytes in an OS page.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17