diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2017-07-20 11:20:17 +0100 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2017-11-08 10:32:54 +0000 |
commit | d6c204c67d42a3cea9d603888ec52a8d8dacf1a3 (patch) | |
tree | 3c5c0f263d122a4d13901e432ff408bfa905f1f3 /src/dev/uart.cc | |
parent | 344911b885114b8401482679202aaee89fa8b29b (diff) | |
download | gem5-d6c204c67d42a3cea9d603888ec52a8d8dacf1a3.tar.xz |
dev: Refactor UART->Terminal interface
The UART models currently assume that they are always wired to a
terminal. While true at the moment, this isn't necessarily a valid
assumption. This change introduces the SerialDevice class that defines
the interface for serial devices. Currently, Terminal is the only
class that implements this interface.
Change-Id: I74fefafbbaf5ac1ec0d4ec0b5a0f4b246fdad305
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/4289
Reviewed-by: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/dev/uart.cc')
-rw-r--r-- | src/dev/uart.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/dev/uart.cc b/src/dev/uart.cc index 01900445f..ff952cc7f 100644 --- a/src/dev/uart.cc +++ b/src/dev/uart.cc @@ -34,18 +34,17 @@ #include "dev/uart.hh" -#include "dev/platform.hh" -#include "dev/terminal.hh" +#include "dev/serial.hh" using namespace std; Uart::Uart(const Params *p, Addr pio_size) : BasicPioDevice(p, pio_size), - platform(p->platform), term(p->terminal), + platform(p->platform), device(p->device), callbackDataAvail(this) { status = 0; - // setup terminal callbacks - term->regDataAvailCallback(&callbackDataAvail); + // setup serial device callbacks + device->regInterfaceCallback(&callbackDataAvail); } |