X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fdev%2Fterminal.cc;h=a11d45554eaa4716b159946410d3f2d3d51c5497;hb=eae1e97fb002b44a9d8c46df2da1ddc1d0156ce4;hp=bae4c9194b78dfaa62189926267778755a3a20b5;hpb=eddac53ff60c579eff28134bde84783fe36d6214;p=gem5.git diff --git a/src/dev/terminal.cc b/src/dev/terminal.cc index bae4c9194..a11d45554 100644 --- a/src/dev/terminal.cc +++ b/src/dev/terminal.cc @@ -102,6 +102,9 @@ Terminal::Terminal(const Params *p) { if (p->output) { outfile = simout.find(p->name); + if (!outfile) + outfile = simout.create(p->name); + outfile->setf(ios::unitbuf); } @@ -256,17 +259,13 @@ Terminal::write(const uint8_t *buf, size_t len) uint8_t Terminal::in() { - bool empty; uint8_t c; - empty = rxbuf.empty(); - assert(!empty); + assert(!rxbuf.empty()); rxbuf.read((char *)&c, 1); - empty = rxbuf.empty(); - DPRINTF(TerminalVerbose, "in: \'%c\' %#02x more: %d\n", - isprint(c) ? c : ' ', c, !empty); + isprint(c) ? c : ' ', c, !rxbuf.empty()); return c; }