diff options
author | Nathan Binkert <binkertn@umich.edu> | 2006-02-26 20:31:08 -0500 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2006-02-26 20:31:08 -0500 |
commit | 9b18c0e87272b35a34e39ce2a9924963402e5b29 (patch) | |
tree | 22ec173ac5f37ac61ecd1fce077d6e1fdcbd5e96 /dev/pktfifo.hh | |
parent | 10fcad4ce099118fde1e61a907fb96abd617ac68 (diff) | |
download | gem5-9b18c0e87272b35a34e39ce2a9924963402e5b29.tar.xz |
add some support for random access of data in packet fifos
dev/pktfifo.cc:
add support for copying arbitrary data out of a
packet fifo
dev/pktfifo.hh:
add support for copying arbitrary data out of a
packet fifo.
Add functions to determine where in the fifo a
particular packet is
--HG--
extra : convert_revision : f8ddc994ce8577f29af0de3fa418a01e4e2cb0f1
Diffstat (limited to 'dev/pktfifo.hh')
-rw-r--r-- | dev/pktfifo.hh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/dev/pktfifo.hh b/dev/pktfifo.hh index e63fd291f..e245840a8 100644 --- a/dev/pktfifo.hh +++ b/dev/pktfifo.hh @@ -127,6 +127,35 @@ class PacketFifo fifo.erase(i); } + bool copyout(void *dest, int offset, int len); + + int countPacketsBefore(iterator end) + { + iterator i = fifo.begin(); + int count = 0; + + while (i != end) { + ++count; + ++i; + } + + return count; + } + + int countPacketsAfter(iterator i) + { + iterator end = fifo.end(); + int count = 0; + + while (i != end) { + ++count; + ++i; + } + + return count; + } + + /** * Serialization stuff */ |