dev: Fix incorrect terminal backlog handling
authorAndreas Sandberg <andreas.sandberg@arm.com>
Wed, 27 Apr 2016 14:33:58 +0000 (15:33 +0100)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Wed, 27 Apr 2016 14:33:58 +0000 (15:33 +0100)
commit6d74892b38d48e48c4aa69ff9205ef32b222c974
treedf6c3ca7519616542ea29b7c8213b6fb0b86a07b
parent67e93a5846dd05eff8a31990e3b18f4d9caf3496
dev: Fix incorrect terminal backlog handling

The Terminal device currently uses the peek functionality in gem5's
circular buffer implementation to send existing buffered content on
the terminal when a new client attaches. This functionallity is
however not implemented correctly and re-sends the same block multiple
time.

Add the required functionality to peek with an offset into the
circular buffer and change the Terminal::accept() implementation to
send the buffered contents.

Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Radhika Jagtap <radhika.jagtap@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
src/base/circlebuf.hh
src/dev/terminal.cc