Merge zizzer.eecs.umich.edu:/z/m5/Bitkeeper/m5
[gem5.git] / dev / baddev.hh
index 348d0db22980e495d25d70c115673b6aaced0a6f..c2a204c051bb59353990b306123aadeb1794d9ef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004 The Regents of The University of Michigan
+ * Copyright (c) 2004-2005 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* @file
+/** @file
  * This devices just panics when touched. For example if you have a
  * kernel that touches the frame buffer which isn't allowed.
  */
 
-#ifndef __BADDEV_HH__
-#define __BADDEV_HH__
+#ifndef __DEV_BADDEV_HH__
+#define __DEV_BADDEV_HH__
 
-#include "mem/functional_mem/functional_memory.hh"
+#include "base/range.hh"
+#include "dev/io_device.hh"
 
 /**
  * BadDevice
@@ -42,7 +43,7 @@
  * the user that the kernel they are running has unsupported
  * options (i.e. frame buffer)
  */
-class BadDevice : public FunctionalMemory
+class BadDevice : public PioDevice
 {
   private:
     Addr addr;
@@ -56,10 +57,12 @@ class BadDevice : public FunctionalMemory
       * @param name name of the object
       * @param a base address of the write
       * @param mmu the memory controller
+      * @param hier object to store parameters universal the device hierarchy
+      * @param bus The bus that this device is attached to
       * @param devicename device that is not implemented
       */
     BadDevice(const std::string &name, Addr a, MemoryController *mmu,
-              const std::string &devicename);
+              HierParams *hier, Bus *bus, const std::string &devicename);
 
     /**
       * On a read event we just panic aand hopefully print a
@@ -79,7 +82,12 @@ class BadDevice : public FunctionalMemory
       */
     virtual Fault write(MemReqPtr &req, const uint8_t *data);
 
-    /** @todo add serialize/unserialize */
+    /**
+     * Return how long this access will take.
+     * @param req the memory request to calcuate
+     * @return Tick when the request is done
+     */
+    Tick cacheAccess(MemReqPtr &req);
 };
 
-#endif // __BADDEV_HH__
+#endif // __DEV_BADDEV_HH__