summaryrefslogtreecommitdiff
path: root/dev/baddev.cc
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2004-02-09 13:40:58 -0500
committerAli Saidi <saidi@eecs.umich.edu>2004-02-09 13:40:58 -0500
commit1ded394fc398f5bbbecef84709824ac7d028dd1e (patch)
treefc521118469880d20861e2120b3ab65760e21eec /dev/baddev.cc
parent77a30ed48daec8fa8db2aaf955eda4e2384df912 (diff)
downloadgem5-1ded394fc398f5bbbecef84709824ac7d028dd1e.tar.xz
Some changes to for linux 2.6.2
dev/pcidev.cc: Linux 2.6 writes the latency timer, so it was added to the list of allowable writes dev/tsunami_uart.cc: dev/tsunami_uart.hh: A couple of changes so that the new linux autoconf serial driver thinks that the serial port exists and configures it --HG-- extra : convert_revision : 6c026ef754e31de56c9b837ceb8f6be48c8d8d9c
Diffstat (limited to 'dev/baddev.cc')
-rw-r--r--dev/baddev.cc68
1 files changed, 68 insertions, 0 deletions
diff --git a/dev/baddev.cc b/dev/baddev.cc
new file mode 100644
index 000000000..d91069bae
--- /dev/null
+++ b/dev/baddev.cc
@@ -0,0 +1,68 @@
+/* $Id$ */
+
+/* @file
+ * BadDevice implemenation
+ */
+
+#include <deque>
+#include <string>
+#include <vector>
+
+#include "base/trace.hh"
+#include "cpu/exec_context.hh"
+#include "dev/scsi_ctrl.hh"
+#include "dev/baddev.hh"
+#include "dev/tsunamireg.h"
+#include "dev/tsunami.hh"
+#include "mem/functional_mem/memory_control.hh"
+#include "sim/builder.hh"
+#include "sim/system.hh"
+
+using namespace std;
+
+BadDevice::BadDevice(const string &name,
+ Addr addr, Addr mask, MemoryController *mmu, const string &devicename)
+ : MmapDevice(name, addr, mask, mmu), devname(devicename)
+{
+}
+
+Fault
+BadDevice::read(MemReqPtr &req, uint8_t *data)
+{
+
+ panic("Device %s not imlpmented\n", devname);
+ return No_Fault;
+}
+
+Fault
+BadDevice::write(MemReqPtr &req, const uint8_t *data)
+{
+ panic("Device %s not imlpmented\n", devname);
+ return No_Fault;
+}
+
+
+BEGIN_DECLARE_SIM_OBJECT_PARAMS(BadDevice)
+
+ SimObjectParam<MemoryController *> mmu;
+ Param<Addr> addr;
+ Param<Addr> mask;
+ Param<string> devicename;
+
+END_DECLARE_SIM_OBJECT_PARAMS(BadDevice)
+
+BEGIN_INIT_SIM_OBJECT_PARAMS(BadDevice)
+
+ INIT_PARAM(mmu, "Memory Controller"),
+ INIT_PARAM(addr, "Device Address"),
+ INIT_PARAM(mask, "Address Mask"),
+ INIT_PARAM(devicename, "Name of device to error on")
+
+END_INIT_SIM_OBJECT_PARAMS(BadDevice)
+
+CREATE_SIM_OBJECT(BadDevice)
+{
+ return new BadDevice(getInstanceName(), addr, mask, mmu, devicename);
+}
+
+REGISTER_SIM_OBJECT("BadDevice", BadDevice)