}
void
-FSTranslatingPortProxy::readBlob(Addr addr, uint8_t *p, int size)
+FSTranslatingPortProxy::readBlob(Addr addr, uint8_t *p, int size) const
{
Addr paddr;
for (ChunkGenerator gen(addr, size, TheISA::PageBytes); !gen.done();
}
void
-FSTranslatingPortProxy::writeBlob(Addr addr, uint8_t *p, int size)
+FSTranslatingPortProxy::writeBlob(Addr addr, uint8_t *p, int size) const
{
Addr paddr;
for (ChunkGenerator gen(addr, size, TheISA::PageBytes); !gen.done();
}
void
-FSTranslatingPortProxy::memsetBlob(Addr address, uint8_t v, int size)
+FSTranslatingPortProxy::memsetBlob(Addr address, uint8_t v, int size) const
{
Addr paddr;
for (ChunkGenerator gen(address, size, TheISA::PageBytes); !gen.done();
/** Version of readblob that translates virt->phys and deals
* with page boundries. */
- virtual void readBlob(Addr addr, uint8_t *p, int size);
+ virtual void readBlob(Addr addr, uint8_t *p, int size) const;
/** Version of writeBlob that translates virt->phys and deals
* with page boundries. */
- virtual void writeBlob(Addr addr, uint8_t *p, int size);
+ virtual void writeBlob(Addr addr, uint8_t *p, int size) const;
/**
* Fill size bytes starting at addr with byte value val.
*/
- virtual void memsetBlob(Addr address, uint8_t v, int size);
+ virtual void memsetBlob(Addr address, uint8_t v, int size) const;
};
void CopyOut(ThreadContext *tc, void *dest, Addr src, size_t cplen);
#include "mem/port_proxy.hh"
void
-PortProxy::blobHelper(Addr addr, uint8_t *p, int size, MemCmd cmd)
+PortProxy::blobHelper(Addr addr, uint8_t *p, int size, MemCmd cmd) const
{
Request req;
}
void
-PortProxy::memsetBlob(Addr addr, uint8_t v, int size)
+PortProxy::memsetBlob(Addr addr, uint8_t v, int size) const
{
// quick and dirty...
uint8_t *buf = new uint8_t[size];
/** The actual physical port used by this proxy. */
Port &_port;
- void blobHelper(Addr addr, uint8_t *p, int size, MemCmd cmd);
+ void blobHelper(Addr addr, uint8_t *p, int size, MemCmd cmd) const;
public:
PortProxy(Port &port) : _port(port) { }
/**
* Read size bytes memory at address and store in p.
*/
- virtual void readBlob(Addr addr, uint8_t* p, int size)
+ virtual void readBlob(Addr addr, uint8_t* p, int size) const
{ blobHelper(addr, p, size, MemCmd::ReadReq); }
/**
* Write size bytes from p to address.
*/
- virtual void writeBlob(Addr addr, uint8_t* p, int size)
+ virtual void writeBlob(Addr addr, uint8_t* p, int size) const
{ blobHelper(addr, p, size, MemCmd::WriteReq); }
/**
* Fill size bytes starting at addr with byte value val.
*/
- virtual void memsetBlob(Addr addr, uint8_t v, int size);
+ virtual void memsetBlob(Addr addr, uint8_t v, int size) const;
/**
* Read sizeof(T) bytes from address and return as object T.
*/
template <typename T>
- T read(Addr address);
+ T read(Addr address) const;
/**
* Write object T to address. Writes sizeof(T) bytes.
*/
template <typename T>
- void write(Addr address, T data);
+ void write(Addr address, T data) const;
#if THE_ISA != NO_ISA
/**
* Performs Guest to Host endianness transform.
*/
template <typename T>
- T readGtoH(Addr address);
+ T readGtoH(Addr address) const;
/**
* Write object T to address. Writes sizeof(T) bytes.
* Performs Host to Guest endianness transform.
*/
template <typename T>
- void writeHtoG(Addr address, T data);
+ void writeHtoG(Addr address, T data) const;
#endif
};
template <typename T>
T
-PortProxy::read(Addr address)
+PortProxy::read(Addr address) const
{
T data;
readBlob(address, (uint8_t*)&data, sizeof(T));
template <typename T>
void
-PortProxy::write(Addr address, T data)
+PortProxy::write(Addr address, T data) const
{
writeBlob(address, (uint8_t*)&data, sizeof(T));
}
#if THE_ISA != NO_ISA
template <typename T>
T
-PortProxy::readGtoH(Addr address)
+PortProxy::readGtoH(Addr address) const
{
T data;
readBlob(address, (uint8_t*)&data, sizeof(T));
template <typename T>
void
-PortProxy::writeHtoG(Addr address, T data)
+PortProxy::writeHtoG(Addr address, T data) const
{
data = TheISA::htog(data);
writeBlob(address, (uint8_t*)&data, sizeof(T));
{ }
bool
-SETranslatingPortProxy::tryReadBlob(Addr addr, uint8_t *p, int size)
+SETranslatingPortProxy::tryReadBlob(Addr addr, uint8_t *p, int size) const
{
int prevSize = 0;
}
void
-SETranslatingPortProxy::readBlob(Addr addr, uint8_t *p, int size)
+SETranslatingPortProxy::readBlob(Addr addr, uint8_t *p, int size) const
{
if (!tryReadBlob(addr, p, size))
fatal("readBlob(0x%x, ...) failed", addr);
bool
-SETranslatingPortProxy::tryWriteBlob(Addr addr, uint8_t *p, int size)
+SETranslatingPortProxy::tryWriteBlob(Addr addr, uint8_t *p, int size) const
{
int prevSize = 0;
void
-SETranslatingPortProxy::writeBlob(Addr addr, uint8_t *p, int size)
+SETranslatingPortProxy::writeBlob(Addr addr, uint8_t *p, int size) const
{
if (!tryWriteBlob(addr, p, size))
fatal("writeBlob(0x%x, ...) failed", addr);
}
bool
-SETranslatingPortProxy::tryMemsetBlob(Addr addr, uint8_t val, int size)
+SETranslatingPortProxy::tryMemsetBlob(Addr addr, uint8_t val, int size) const
{
for (ChunkGenerator gen(addr, size, VMPageSize); !gen.done(); gen.next()) {
Addr paddr;
}
void
-SETranslatingPortProxy::memsetBlob(Addr addr, uint8_t val, int size)
+SETranslatingPortProxy::memsetBlob(Addr addr, uint8_t val, int size) const
{
if (!tryMemsetBlob(addr, val, size))
fatal("memsetBlob(0x%x, ...) failed", addr);
bool
-SETranslatingPortProxy::tryWriteString(Addr addr, const char *str)
+SETranslatingPortProxy::tryWriteString(Addr addr, const char *str) const
{
uint8_t c;
}
void
-SETranslatingPortProxy::writeString(Addr addr, const char *str)
+SETranslatingPortProxy::writeString(Addr addr, const char *str) const
{
if (!tryWriteString(addr, str))
fatal("writeString(0x%x, ...) failed", addr);
}
bool
-SETranslatingPortProxy::tryReadString(std::string &str, Addr addr)
+SETranslatingPortProxy::tryReadString(std::string &str, Addr addr) const
{
uint8_t c;
}
void
-SETranslatingPortProxy::readString(std::string &str, Addr addr)
+SETranslatingPortProxy::readString(std::string &str, Addr addr) const
{
if (!tryReadString(str, addr))
fatal("readString(0x%x, ...) failed", addr);
SETranslatingPortProxy(Port& port, Process* p, AllocType alloc);
virtual ~SETranslatingPortProxy();
- bool tryReadBlob(Addr addr, uint8_t *p, int size);
- bool tryWriteBlob(Addr addr, uint8_t *p, int size);
- bool tryMemsetBlob(Addr addr, uint8_t val, int size);
- bool tryWriteString(Addr addr, const char *str);
- bool tryReadString(std::string &str, Addr addr);
+ bool tryReadBlob(Addr addr, uint8_t *p, int size) const;
+ bool tryWriteBlob(Addr addr, uint8_t *p, int size) const;
+ bool tryMemsetBlob(Addr addr, uint8_t val, int size) const;
+ bool tryWriteString(Addr addr, const char *str) const;
+ bool tryReadString(std::string &str, Addr addr) const;
- virtual void readBlob(Addr addr, uint8_t *p, int size);
- virtual void writeBlob(Addr addr, uint8_t *p, int size);
- virtual void memsetBlob(Addr addr, uint8_t val, int size);
+ virtual void readBlob(Addr addr, uint8_t *p, int size) const;
+ virtual void writeBlob(Addr addr, uint8_t *p, int size) const;
+ virtual void memsetBlob(Addr addr, uint8_t val, int size) const;
- void writeString(Addr addr, const char *str);
- void readString(std::string &str, Addr addr);
+ void writeString(Addr addr, const char *str) const;
+ void readString(std::string &str, Addr addr) const;
};
#endif // __MEM_SE_TRANSLATING_PORT_PROXY_HH__