gem5
v20.1.0.0
|
This proxy attempts to translate virtual addresses using the TLBs. More...
#include <translating_port_proxy.hh>
Public Member Functions | |
TranslatingPortProxy (ThreadContext *tc, Request::Flags _flags=0) | |
bool | tryReadBlob (Addr addr, void *p, int size) const override |
Version of tryReadblob that translates virt->phys and deals with page boundries. More... | |
bool | tryWriteBlob (Addr addr, const void *p, int size) const override |
Version of tryWriteBlob that translates virt->phys and deals with page boundries. More... | |
bool | tryMemsetBlob (Addr address, uint8_t v, int size) const override |
Fill size bytes starting at addr with byte value val. More... | |
Public Member Functions inherited from PortProxy | |
PortProxy (SendFunctionalFunc func, unsigned int cacheLineSize) | |
PortProxy (const RequestPort &port, unsigned int cacheLineSize) | |
virtual | ~PortProxy () |
void | readBlobPhys (Addr addr, Request::Flags flags, void *p, int size) const |
Fixed functionality for use in base classes. More... | |
void | writeBlobPhys (Addr addr, Request::Flags flags, const void *p, int size) const |
Write size bytes from p to physical address. More... | |
void | memsetBlobPhys (Addr addr, Request::Flags flags, uint8_t v, int size) const |
Fill size bytes starting at physical addr with byte value val. More... | |
void | readBlob (Addr addr, void *p, int size) const |
Higher level interfaces based on the above. More... | |
void | writeBlob (Addr addr, const void *p, int size) const |
Same as tryWriteBlob, but insists on success. More... | |
void | memsetBlob (Addr addr, uint8_t v, int size) const |
Same as tryMemsetBlob, but insists on success. More... | |
template<typename T > | |
T | read (Addr address) const |
Read sizeof(T) bytes from address and return as object T. More... | |
template<typename T > | |
void | write (Addr address, const T &data) const |
Write object T to address. More... | |
template<typename T > | |
T | read (Addr address, ByteOrder guest_byte_order) const |
Read sizeof(T) bytes from address and return as object T. More... | |
template<typename T > | |
void | write (Addr address, T data, ByteOrder guest_byte_order) const |
Write object T to address. More... | |
bool | tryWriteString (Addr addr, const char *str) const |
Write the string str into guest memory at address addr. More... | |
void | writeString (Addr addr, const char *str) const |
Same as tryWriteString, but insists on success. More... | |
bool | tryReadString (std::string &str, Addr addr) const |
Reads the string at guest address addr into the std::string str. More... | |
void | readString (std::string &str, Addr addr) const |
Same as tryReadString, but insists on success. More... | |
bool | tryReadString (char *str, Addr addr, size_t maxlen) const |
Reads the string at guest address addr into the char * str, reading up to maxlen characters. More... | |
void | readString (char *str, Addr addr, size_t maxlen) const |
Same as tryReadString, but insists on success. More... | |
Protected Member Functions | |
virtual bool | fixupAddr (Addr addr, BaseTLB::Mode mode) const |
Protected Attributes | |
ThreadContext * | _tc |
const Addr | pageBytes |
Request::Flags | flags |
Private Member Functions | |
bool | tryTLBsOnce (RequestPtr req, BaseTLB::Mode) const |
bool | tryTLBs (RequestPtr req, BaseTLB::Mode) const |
Additional Inherited Members | |
Public Types inherited from PortProxy | |
typedef std::function< void(PacketPtr pkt)> | SendFunctionalFunc |
This proxy attempts to translate virtual addresses using the TLBs.
If it fails, subclasses can override the fixupAddr virtual method to try to recover, and then attempt the translation again. If it still fails then the access as a whole fails.
Definition at line 55 of file translating_port_proxy.hh.
TranslatingPortProxy::TranslatingPortProxy | ( | ThreadContext * | tc, |
Request::Flags | _flags = 0 |
||
) |
Definition at line 53 of file translating_port_proxy.cc.
|
inlineprotectedvirtual |
Reimplemented in SETranslatingPortProxy.
Definition at line 68 of file translating_port_proxy.hh.
Referenced by tryTLBs().
|
overridevirtual |
Fill size bytes starting at addr with byte value val.
Reimplemented from PortProxy.
Definition at line 122 of file translating_port_proxy.cc.
References _tc, ThreadContext::contextId(), ChunkGenerator::done(), flags, Request::funcRequestorId, PortProxy::memsetBlobPhys(), pageBytes, tryTLBs(), ArmISA::v, and BaseTLB::Write.
|
overridevirtual |
Version of tryReadblob that translates virt->phys and deals with page boundries.
Reimplemented from PortProxy.
Definition at line 80 of file translating_port_proxy.cc.
References _tc, addr, ThreadContext::contextId(), ChunkGenerator::done(), flags, Request::funcRequestorId, MipsISA::p, pageBytes, BaseTLB::Read, PortProxy::readBlobPhys(), and tryTLBs().
|
private |
Definition at line 71 of file translating_port_proxy.cc.
References fixupAddr(), ArmISA::mode, and tryTLBsOnce().
Referenced by tryMemsetBlob(), tryReadBlob(), and tryWriteBlob().
|
private |
Definition at line 62 of file translating_port_proxy.cc.
References _tc, ThreadContext::getDTBPtr(), ArmISA::mode, NoFault, BaseTLB::Read, and BaseTLB::translateFunctional().
Referenced by tryTLBs().
|
overridevirtual |
Version of tryWriteBlob that translates virt->phys and deals with page boundries.
Reimplemented from PortProxy.
Definition at line 101 of file translating_port_proxy.cc.
References _tc, addr, ThreadContext::contextId(), ChunkGenerator::done(), flags, Request::funcRequestorId, MipsISA::p, pageBytes, tryTLBs(), BaseTLB::Write, and PortProxy::writeBlobPhys().
|
protected |
Definition at line 62 of file translating_port_proxy.hh.
Referenced by SETranslatingPortProxy::fixupAddr(), tryMemsetBlob(), tryReadBlob(), tryTLBsOnce(), and tryWriteBlob().
|
protected |
Definition at line 65 of file translating_port_proxy.hh.
Referenced by tryMemsetBlob(), tryReadBlob(), and tryWriteBlob().
|
protected |
Definition at line 63 of file translating_port_proxy.hh.
Referenced by SETranslatingPortProxy::fixupAddr(), tryMemsetBlob(), tryReadBlob(), and tryWriteBlob().