diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2004-05-14 17:34:15 -0400 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2004-05-14 17:34:15 -0400 |
commit | fd21387149c272b8aaee62466fe96863f3ef458f (patch) | |
tree | e7029f7536b5374fc0fb5a9688d8d1a2b5a816b3 /dev/console.cc | |
parent | cd8db7669aefe1075c9ded5e6cc3203593698880 (diff) | |
download | gem5-fd21387149c272b8aaee62466fe96863f3ef458f.tar.xz |
Linux boots... various fixes to make console work correctly
dev/console.cc:
commented out code that checks if an interrupt is happening before issuing one
because they can get lost when linux boots
dev/console.hh:
added a setPlatform function to set the platform to interrupt
dev/platform.hh:
dev/tsunami.cc:
dev/tsunami.hh:
Added virtual functions to post console interrupts
dev/tsunami_io.cc:
allowed a 64bit read of the PIC since we can't do a physical byte read
dev/tsunami_uart.cc:
moved TsunamiUart to PioDevice
various little fixes to make linux work
dev/tsunami_uart.hh:
Made Tsunami_Uart a PIO device
dev/tsunamireg.h:
added some UART defines and used the ULL macros
kern/linux/linux_system.cc:
commented out waiting for gdb
--HG--
extra : convert_revision : 8cfd0700f3812ab349a6d7f132f85f4f421c5c5e
Diffstat (limited to 'dev/console.cc')
-rw-r--r-- | dev/console.cc | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/dev/console.cc b/dev/console.cc index fb74c388a..ef3f64d8d 100644 --- a/dev/console.cc +++ b/dev/console.cc @@ -49,6 +49,7 @@ #include "mem/functional_mem/memory_control.hh" #include "sim/builder.hh" #include "targetarch/ev5.hh" +#include "dev/platform.hh" using namespace std; @@ -76,7 +77,7 @@ SimConsole::SimConsole(const string &name, const string &file, int num) #if TRACING_ON == 1 linebuf(16384), #endif - _status(0), _enable(0), intr(NULL) + _status(0), _enable(0), intr(NULL), platform(NULL) { if (!file.empty()) outfile = new ofstream(file.c_str()); @@ -322,8 +323,8 @@ SimConsole::clearInt(int i) { int old = _status; _status &= ~i; - if (MaskStatus(old, _enable) != MaskStatus(_status, _enable) && intr) - intr->clear(TheISA::INTLEVEL_IRQ0); + //if (MaskStatus(old, _enable) != MaskStatus(_status, _enable) && intr) + platform->clearConsoleInt(); return old; } @@ -331,10 +332,10 @@ SimConsole::clearInt(int i) void SimConsole::raiseInt(int i) { - int old = _status; + //int old = _status; _status |= i; - if (MaskStatus(old, _enable) != MaskStatus(_status, _enable) && intr) - intr->post(TheISA::INTLEVEL_IRQ0); + //if (MaskStatus(old, _enable) != MaskStatus(_status, _enable) && intr) + platform->postConsoleInt(); } void @@ -357,14 +358,21 @@ SimConsole::setInt(int bits) old = _enable; _enable |= bits; - if (MaskStatus(_status, old) != MaskStatus(_status, _enable) && intr) { + //if (MaskStatus(_status, old) != MaskStatus(_status, _enable) && intr) { + if (intr) { if (MaskStatus(_status, _enable)) - intr->post(TheISA::INTLEVEL_IRQ0); + platform->postConsoleInt(); else - intr->clear(TheISA::INTLEVEL_IRQ0); + platform->clearConsoleInt(); } } +void +SimConsole::setPlatform(Platform *p) +{ + platform = p; + platform->cons = this; +} void SimConsole::serialize(ostream &os) @@ -381,6 +389,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(SimConsole) SimObjectParam<ConsoleListener *> listener; SimObjectParam<IntrControl *> intr_control; + SimObjectParam<Platform *> platform; Param<string> output; Param<bool> append_name; Param<int> number; @@ -391,6 +400,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(SimConsole) INIT_PARAM(listener, "console listener"), INIT_PARAM(intr_control, "interrupt controller"), + INIT_PARAM(platform, "platform"), INIT_PARAM_DFLT(output, "file to dump output to", ""), INIT_PARAM_DFLT(append_name, "append name() to filename", true), INIT_PARAM_DFLT(number, "console number", 0) @@ -413,8 +423,9 @@ CREATE_SIM_OBJECT(SimConsole) SimConsole *console = new SimConsole(getInstanceName(), filename, number); ((ConsoleListener *)listener)->add(console); ((SimConsole *)console)->initInt(intr_control); -// ((SimConsole *)console)->setInt(SimConsole::TransmitInterrupt | -// SimConsole::ReceiveInterrupt); + ((SimConsole *)console)->setPlatform(platform); + //((SimConsole *)console)->setInt(SimConsole::TransmitInterrupt | + // SimConsole::ReceiveInterrupt); return console; } |