94a95,98
>
>
> /** Fixed functionality for use in base classes. */
>
95a100,121
> * Read size bytes memory at physical address and store in p.
> */
> void readBlobPhys(Addr addr, Request::Flags flags,
> uint8_t* p, int size) const;
>
> /**
> * Write size bytes from p to physical address.
> */
> void writeBlobPhys(Addr addr, Request::Flags flags,
> const uint8_t* p, int size) const;
>
> /**
> * Fill size bytes starting at physical addr with byte value val.
> */
> void memsetBlobPhys(Addr addr, Request::Flags flags,
> uint8_t v, int size) const;
>
>
>
> /** Methods to override in base classes */
>
> /**
96a123
> * Returns true on success and false on failure.
98,99c125,126
< virtual void
< readBlob(Addr addr, uint8_t* p, int size) const
---
> virtual bool
> tryReadBlob(Addr addr, uint8_t *p, int size) const
101a129
> return true;
105a134
> * Returns true on success and false on failure.
107,108c136,137
< virtual void
< writeBlob(Addr addr, const uint8_t* p, int size) const
---
> virtual bool
> tryWriteBlob(Addr addr, const uint8_t *p, int size) const
110a140
> return true;
114a145
> * Returns true on success and false on failure.
116,117c147,148
< virtual void
< memsetBlob(Addr addr, uint8_t v, int size) const
---
> virtual bool
> tryMemsetBlob(Addr addr, uint8_t val, int size) const
119c150,151
< memsetBlobPhys(addr, 0, v, size);
---
> memsetBlobPhys(addr, 0, val, size);
> return true;
121a154,157
>
>
> /** Higher level interfaces based on the above. */
>
123c159
< * Read size bytes memory at physical address and store in p.
---
> * Same as tryReadBlob, but insists on success.
125,126c161,166
< void readBlobPhys(Addr addr, Request::Flags flags,
< uint8_t* p, int size) const;
---
> void
> readBlob(Addr addr, uint8_t* p, int size) const
> {
> if (!tryReadBlob(addr, p, size))
> fatal("readBlob(%#x, ...) failed", addr);
> }
129c169
< * Write size bytes from p to physical address.
---
> * Same as tryWriteBlob, but insists on success.
131,132c171,176
< void writeBlobPhys(Addr addr, Request::Flags flags,
< const uint8_t* p, int size) const;
---
> void
> writeBlob(Addr addr, const uint8_t* p, int size) const
> {
> if (!tryWriteBlob(addr, p, size))
> fatal("writeBlob(%#x, ...) failed", addr);
> }
135c179
< * Fill size bytes starting at physical addr with byte value val.
---
> * Same as tryMemsetBlob, but insists on success.
137,138c181,186
< void memsetBlobPhys(Addr addr, Request::Flags flags,
< uint8_t v, int size) const;
---
> void
> memsetBlob(Addr addr, uint8_t v, int size) const
> {
> if (!tryMemsetBlob(addr, v, size))
> fatal("memsetBlob(%#x, ...) failed", addr);
> }
164a213,244
>
> /**
> * Write the string str into guest memory at address addr.
> * Returns true on success and false on failure.
> */
> bool tryWriteString(Addr addr, const char *str) const;
>
> /**
> * Same as tryWriteString, but insists on success.
> */
> void
> writeString(Addr addr, const char *str) const
> {
> if (!tryWriteString(addr, str))
> fatal("writeString(%#x, ...) failed", addr);
> }
>
> /**
> * Reads the string at guest address addr into the std::string str.
> * Returns true on success and false on failure.
> */
> bool tryReadString(std::string &str, Addr addr) const;
>
> /**
> * Same as tryReadString, but insists on success.
> */
> void
> readString(std::string &str, Addr addr) const
> {
> if (!tryReadString(str, addr))
> fatal("readString(%#x, ...) failed", addr);
> }