Move options files from <build_dir>/build_options to build_options/<build_dir>.
[gem5.git] / dev / alpha_console.hh
index 9e774773ee048bfb4059178b42e97b47b8c9c3db..6236c5713cffbc0b0ed6e8142cfe42aefd95d219 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2001-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
  * System Console Interface
  */
 
 #ifndef __ALPHA_CONSOLE_HH__
 #define __ALPHA_CONSOLE_HH__
 
-#include "sim/host.hh"
+#include "base/range.hh"
 #include "dev/alpha_access.h"
-#include "mem/functional_mem/mmap_device.hh"
+#include "dev/io_device.hh"
+#include "sim/host.hh"
+#include "sim/sim_object.hh"
 
 class BaseCPU;
 class SimConsole;
 class System;
-class TlaserClock;
 class SimpleDisk;
 
-/*
+/**
  * Memory mapped interface to the system console. This device
  * represents a shared data region between the OS Kernel and the
  * System Console.
@@ -68,11 +69,17 @@ class SimpleDisk;
  * primarily used doing boot before the kernel has loaded its device
  * drivers.
  */
-class AlphaConsole : public MmapDevice
+class AlphaConsole : public PioDevice
 {
   protected:
+    struct Access : public AlphaAccess
+    {
+        void serialize(std::ostream &os);
+        void unserialize(Checkpoint *cp, const std::string &section);
+    };
+
     union {
-        AlphaAccess *alphaAccess;
+        Access *alphaAccess;
         uint8_t *consoleData;
     };
 
@@ -82,26 +89,38 @@ class AlphaConsole : public MmapDevice
     /** the system console (the terminal) is accessable from the console */
     SimConsole *console;
 
+    /** a pointer to the system we are running in */
+    System *system;
+
+    /** a pointer to the CPU boot cpu */
+    BaseCPU *cpu;
+
+    Addr addr;
+    static const Addr size = 0x80; // equal to sizeof(alpha_access);
+
   public:
     /** Standard Constructor */
-    AlphaConsole(const std::string &name, SimConsole *cons,
-                 SimpleDisk *d, int size,
-                 System *system, BaseCPU *cpu,
-                 TlaserClock *clock, int num_cpus,
-                 Addr addr, Addr mask, MemoryController *mmu);
+    AlphaConsole(const std::string &name, SimConsole *cons, SimpleDisk *d,
+                 System *s, BaseCPU *c, Platform *platform,
+                 MemoryController *mmu, Addr addr,
+                 HierParams *hier, Bus *bus);
+
+    virtual void startup();
 
-  public:
     /**
      * memory mapped reads and writes
      */
-    virtual Fault read(MemReqPtr req, uint8_t *data);
-    virtual Fault write(MemReqPtr req, const uint8_t *data);
+    virtual Fault read(MemReqPtr &req, uint8_t *data);
+    virtual Fault write(MemReqPtr &req, const uint8_t *data);
 
     /**
      * standard serialization routines for checkpointing
      */
     virtual void serialize(std::ostream &os);
     virtual void unserialize(Checkpoint *cp, const std::string &section);
+
+  public:
+    Tick cacheAccess(MemReqPtr &req);
 };
 
 #endif // __ALPHA_CONSOLE_HH__