mem: Cleanup packet accessor methods
Review Request #2945 - Created July 7, 2015 and submitted
| Information | |
|---|---|
| Andreas Sandberg | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 10923:ac0c11d8dfd6
---------------------------
mem: Cleanup packet accessor methodsThe Packet::get() and Packet::set() methods both have very strange
semantics. Currently, they automatically convert between the guest
system's endianness and the host system's endianness. This behavior is
usually undesired and unexpected.This patch introduces three new method pairs to access data:
* getLE() / setLE() - Get data stored as little endian.
* getBE() / setBE() - Get data stored as big endian.
* get(ByteOrder) / set(v, ByteOrder) - Configurable endiannessFor example, a little endian device that is receiving a write request
will use teh getLE() method to get the data from the packet.The old interface will be deprecated once all existing devices have
been ported to the new interface.
