diff options
author | Steve Reinhardt <stever@eecs.umich.edu> | 2006-03-12 16:38:16 -0500 |
---|---|---|
committer | Steve Reinhardt <stever@eecs.umich.edu> | 2006-03-12 16:38:16 -0500 |
commit | 2d9c9dba37499d87ee599388aca5502279ce953a (patch) | |
tree | 263847b0bc4a20d0b138bcb51066c82f6f58f8bb /mem | |
parent | 159cee171976019badb17336eff5b69df3c89528 (diff) | |
download | gem5-2d9c9dba37499d87ee599388aca5502279ce953a.tar.xz |
Get rid of "Functional" suffix from (read|write)(Blob|String) functions.
--HG--
extra : convert_revision : 1456308af0fd686dff53ec1baddd7747354e1c0a
Diffstat (limited to 'mem')
-rw-r--r-- | mem/port.cc | 6 | ||||
-rw-r--r-- | mem/port.hh | 11 | ||||
-rw-r--r-- | mem/translating_port.cc | 54 | ||||
-rw-r--r-- | mem/translating_port.hh | 24 |
4 files changed, 42 insertions, 53 deletions
diff --git a/mem/port.cc b/mem/port.cc index 75362b472..fb4f3b4e0 100644 --- a/mem/port.cc +++ b/mem/port.cc @@ -52,19 +52,19 @@ Port::blobHelper(Addr addr, uint8_t *p, int size, Command cmd) } void -Port::writeBlobFunctional(Addr addr, uint8_t *p, int size) +Port::writeBlob(Addr addr, uint8_t *p, int size) { blobHelper(addr, p, size, Write); } void -Port::readBlobFunctional(Addr addr, uint8_t *p, int size) +Port::readBlob(Addr addr, uint8_t *p, int size) { blobHelper(addr, p, size, Read); } void -Port::memsetBlobFunctional(Addr addr, uint8_t val, int size) +Port::memsetBlob(Addr addr, uint8_t val, int size) { // quick and dirty... uint8_t *buf = new uint8_t[size]; diff --git a/mem/port.hh b/mem/port.hh index 5c89c74a5..ea2929a81 100644 --- a/mem/port.hh +++ b/mem/port.hh @@ -191,29 +191,26 @@ class Port void getPeerAddressRanges(AddrRangeList &range_list, bool &owner) { peer->getDeviceAddressRanges(range_list, owner); } - // Do we need similar wrappers for sendAtomic()? If not, should - // we drop the "Functional" from the names? - /** This function is a wrapper around sendFunctional() that breaks a larger, arbitrarily aligned access into appropriate chunks. The default implementation can use getBlockSize() to determine the block size and go from there. */ - void readBlobFunctional(Addr addr, uint8_t *p, int size); + void readBlob(Addr addr, uint8_t *p, int size); /** This function is a wrapper around sendFunctional() that breaks a larger, arbitrarily aligned access into appropriate chunks. The default implementation can use getBlockSize() to determine the block size and go from there. */ - void writeBlobFunctional(Addr addr, uint8_t *p, int size); + void writeBlob(Addr addr, uint8_t *p, int size); /** Fill size bytes starting at addr with byte value val. This should not need to be virtual, since it can be implemented in - terms of writeBlobFunctional(). However, it shouldn't be + terms of writeBlob(). However, it shouldn't be performance-critical either, so it could be if we wanted to. */ - void memsetBlobFunctional(Addr addr, uint8_t val, int size); + void memsetBlob(Addr addr, uint8_t val, int size); private: diff --git a/mem/translating_port.cc b/mem/translating_port.cc index a3bf1baa7..f0059fc08 100644 --- a/mem/translating_port.cc +++ b/mem/translating_port.cc @@ -42,7 +42,7 @@ TranslatingPort::~TranslatingPort() { } bool -TranslatingPort::tryReadBlobFunctional(Addr addr, uint8_t *p, int size) +TranslatingPort::tryReadBlob(Addr addr, uint8_t *p, int size) { Addr paddr; int prevSize = 0; @@ -52,7 +52,7 @@ TranslatingPort::tryReadBlobFunctional(Addr addr, uint8_t *p, int size) if (!pTable->translate(gen.addr(),paddr)) return false; - port->readBlobFunctional(paddr, p + prevSize, gen.size()); + port->readBlob(paddr, p + prevSize, gen.size()); prevSize += gen.size(); } @@ -60,16 +60,15 @@ TranslatingPort::tryReadBlobFunctional(Addr addr, uint8_t *p, int size) } void -TranslatingPort::readBlobFunctional(Addr addr, uint8_t *p, int size) +TranslatingPort::readBlob(Addr addr, uint8_t *p, int size) { - if (!tryReadBlobFunctional(addr, p, size)) - fatal("readBlobFunctional(0x%x, ...) failed", addr); + if (!tryReadBlob(addr, p, size)) + fatal("readBlob(0x%x, ...) failed", addr); } bool -TranslatingPort::tryWriteBlobFunctional(Addr addr, uint8_t *p, int size, - bool alloc) +TranslatingPort::tryWriteBlob(Addr addr, uint8_t *p, int size, bool alloc) { Addr paddr; @@ -87,7 +86,7 @@ TranslatingPort::tryWriteBlobFunctional(Addr addr, uint8_t *p, int size, } } - port->writeBlobFunctional(paddr, p + prevSize, gen.size()); + port->writeBlob(paddr, p + prevSize, gen.size()); prevSize += gen.size(); } @@ -96,16 +95,14 @@ TranslatingPort::tryWriteBlobFunctional(Addr addr, uint8_t *p, int size, void -TranslatingPort::writeBlobFunctional(Addr addr, uint8_t *p, int size, - bool alloc) +TranslatingPort::writeBlob(Addr addr, uint8_t *p, int size, bool alloc) { - if (!tryWriteBlobFunctional(addr, p, size, alloc)) - fatal("writeBlobFunctional(0x%x, ...) failed", addr); + if (!tryWriteBlob(addr, p, size, alloc)) + fatal("writeBlob(0x%x, ...) failed", addr); } bool -TranslatingPort::tryMemsetBlobFunctional(Addr addr, uint8_t val, int size, - bool alloc) +TranslatingPort::tryMemsetBlob(Addr addr, uint8_t val, int size, bool alloc) { Addr paddr; @@ -121,23 +118,22 @@ TranslatingPort::tryMemsetBlobFunctional(Addr addr, uint8_t val, int size, } } - port->memsetBlobFunctional(paddr, val, gen.size()); + port->memsetBlob(paddr, val, gen.size()); } return true; } void -TranslatingPort::memsetBlobFunctional(Addr addr, uint8_t val, int size, - bool alloc) +TranslatingPort::memsetBlob(Addr addr, uint8_t val, int size, bool alloc) { - if (!tryMemsetBlobFunctional(addr, val, size, alloc)) - fatal("memsetBlobFunctional(0x%x, ...) failed", addr); + if (!tryMemsetBlob(addr, val, size, alloc)) + fatal("memsetBlob(0x%x, ...) failed", addr); } bool -TranslatingPort::tryWriteStringFunctional(Addr addr, const char *str) +TranslatingPort::tryWriteString(Addr addr, const char *str) { Addr paddr,vaddr; uint8_t c; @@ -149,21 +145,21 @@ TranslatingPort::tryWriteStringFunctional(Addr addr, const char *str) if (!pTable->translate(vaddr++,paddr)) return false; - port->writeBlobFunctional(paddr, &c, 1); + port->writeBlob(paddr, &c, 1); } while (c); return true; } void -TranslatingPort::writeStringFunctional(Addr addr, const char *str) +TranslatingPort::writeString(Addr addr, const char *str) { - if (!tryWriteStringFunctional(addr, str)) - fatal("writeStringFunctional(0x%x, ...) failed", addr); + if (!tryWriteString(addr, str)) + fatal("writeString(0x%x, ...) failed", addr); } bool -TranslatingPort::tryReadStringFunctional(std::string &str, Addr addr) +TranslatingPort::tryReadString(std::string &str, Addr addr) { Addr paddr,vaddr; uint8_t c; @@ -174,7 +170,7 @@ TranslatingPort::tryReadStringFunctional(std::string &str, Addr addr) if (!pTable->translate(vaddr++,paddr)) return false; - port->readBlobFunctional(paddr, &c, 1); + port->readBlob(paddr, &c, 1); str += c; } while (c); @@ -182,9 +178,9 @@ TranslatingPort::tryReadStringFunctional(std::string &str, Addr addr) } void -TranslatingPort::readStringFunctional(std::string &str, Addr addr) +TranslatingPort::readString(std::string &str, Addr addr) { - if (!tryReadStringFunctional(str, addr)) - fatal("readStringFunctional(0x%x, ...) failed", addr); + if (!tryReadString(str, addr)) + fatal("readString(0x%x, ...) failed", addr); } diff --git a/mem/translating_port.hh b/mem/translating_port.hh index eaecff35a..acbc3fabc 100644 --- a/mem/translating_port.hh +++ b/mem/translating_port.hh @@ -48,21 +48,17 @@ class TranslatingPort virtual ~TranslatingPort(); public: - bool tryReadBlobFunctional(Addr addr, uint8_t *p, int size); - bool tryWriteBlobFunctional(Addr addr, uint8_t *p, int size, - bool alloc = false); - bool tryMemsetBlobFunctional(Addr addr, uint8_t val, int size, - bool alloc = false); - bool tryWriteStringFunctional(Addr addr, const char *str); - bool tryReadStringFunctional(std::string &str, Addr addr); + bool tryReadBlob(Addr addr, uint8_t *p, int size); + bool tryWriteBlob(Addr addr, uint8_t *p, int size, bool alloc = false); + bool tryMemsetBlob(Addr addr, uint8_t val, int size, bool alloc = false); + bool tryWriteString(Addr addr, const char *str); + bool tryReadString(std::string &str, Addr addr); - void readBlobFunctional(Addr addr, uint8_t *p, int size); - void writeBlobFunctional(Addr addr, uint8_t *p, int size, - bool alloc = false); - void memsetBlobFunctional(Addr addr, uint8_t val, int size, - bool alloc = false); - void writeStringFunctional(Addr addr, const char *str); - void readStringFunctional(std::string &str, Addr addr); + void readBlob(Addr addr, uint8_t *p, int size); + void writeBlob(Addr addr, uint8_t *p, int size, bool alloc = false); + void memsetBlob(Addr addr, uint8_t val, int size, bool alloc = false); + void writeString(Addr addr, const char *str); + void readString(std::string &str, Addr addr); }; #endif |