summaryrefslogtreecommitdiff
path: root/src/dev
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2016-04-27 15:33:58 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2016-04-27 15:33:58 +0100
commit6d74892b38d48e48c4aa69ff9205ef32b222c974 (patch)
treedf6c3ca7519616542ea29b7c8213b6fb0b86a07b /src/dev
parent67e93a5846dd05eff8a31990e3b18f4d9caf3496 (diff)
downloadgem5-6d74892b38d48e48c4aa69ff9205ef32b222c974.tar.xz
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>
Diffstat (limited to 'src/dev')
-rw-r--r--src/dev/terminal.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dev/terminal.cc b/src/dev/terminal.cc
index 53e593f85..9f0ea5ea3 100644
--- a/src/dev/terminal.cc
+++ b/src/dev/terminal.cc
@@ -204,7 +204,7 @@ Terminal::accept()
char buf[1024];
for (size_t i = 0; i < txbuf.size(); i += sizeof(buf)) {
const size_t chunk_len(std::min(txbuf.size() - i, sizeof(buf)));
- txbuf.peek(buf, chunk_len);
+ txbuf.peek(buf, i, chunk_len);
write((const uint8_t *)buf, chunk_len);
}
}