summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorAndrew Schultz <alschult@umich.edu>2004-02-09 17:50:47 -0500
committerAndrew Schultz <alschult@umich.edu>2004-02-09 17:50:47 -0500
commiteac2d6a66863dcd7d5129ee5112ea49248f9efa8 (patch)
treed59508dd612d82b80fef69ded188e2704e074d40 /dev
parent48bb27be728db65ad521eb5bda8cb3411dfddc43 (diff)
parentda8a7022126eef87d4007b7135aa89c559eb6747 (diff)
downloadgem5-eac2d6a66863dcd7d5129ee5112ea49248f9efa8.tar.xz
Merge linux tree with head
arch/alpha/alpha_memory.cc: dev/alpha_console.cc: dev/alpha_console.hh: Merge --HG-- extra : convert_revision : 3233648f204338ab3f102ff117754dce955dcc37
Diffstat (limited to 'dev')
-rw-r--r--dev/alpha_access.h2
-rw-r--r--dev/alpha_console.cc19
-rw-r--r--dev/alpha_console.hh11
-rw-r--r--dev/etherlink.hh2
4 files changed, 17 insertions, 17 deletions
diff --git a/dev/alpha_access.h b/dev/alpha_access.h
index 7502635e9..40567e96f 100644
--- a/dev/alpha_access.h
+++ b/dev/alpha_access.h
@@ -36,7 +36,7 @@
#define ALPHA_ACCESS_VERSION (1301) /* CH++*/
#ifndef CONSOLE
-#include <ostream>
+#include <iosfwd>
#include <string>
class Checkpoint;
#endif
diff --git a/dev/alpha_console.cc b/dev/alpha_console.cc
index 9411c6470..e1b69c3ce 100644
--- a/dev/alpha_console.cc
+++ b/dev/alpha_console.cc
@@ -56,6 +56,8 @@ AlphaConsole::AlphaConsole(const string &name, SimConsole *cons,
Addr addr, Addr mask, MemoryController *mmu)
: MmapDevice(name, addr, mask, mmu), disk(d), console(cons)
{
+ mmu->add_child(this, Range<Addr>(addr, addr + size));
+
consoleData = new uint8_t[size];
memset(consoleData, 0, size);
@@ -66,7 +68,7 @@ AlphaConsole::AlphaConsole(const string &name, SimConsole *cons,
alphaAccess->version = ALPHA_ACCESS_VERSION;
alphaAccess->numCPUs = num_cpus;
- alphaAccess->mem_size = system->physmem->getSize();
+ alphaAccess->mem_size = system->physmem->size();
alphaAccess->cpuClock = cpu->getFreq() / 1000000;
alphaAccess->intrClockFrequency = clock->frequency();
@@ -79,7 +81,8 @@ AlphaConsole::read(MemReqPtr &req, uint8_t *data)
memset(data, 0, req->size);
uint64_t val;
- Addr daddr = req->paddr & addr_mask;
+ Addr daddr = req->paddr - addr;
+
switch (daddr) {
case offsetof(AlphaAccess, inputChar):
val = console->console_in();
@@ -126,7 +129,7 @@ AlphaConsole::write(MemReqPtr &req, const uint8_t *data)
return Machine_Check_Fault;
}
- Addr daddr = req->paddr & addr_mask;
+ Addr daddr = req->paddr - addr;
ExecContext *other_xc;
switch (daddr) {
@@ -244,11 +247,9 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(AlphaConsole)
SimObjectParam<SimConsole *> sim_console;
SimObjectParam<SimpleDisk *> disk;
- Param<int> size;
Param<int> num_cpus;
SimObjectParam<MemoryController *> mmu;
Param<Addr> addr;
- Param<Addr> mask;
SimObjectParam<System *> system;
SimObjectParam<BaseCPU *> cpu;
SimObjectParam<TsunamiIO *> clock;
@@ -259,11 +260,9 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(AlphaConsole)
INIT_PARAM(sim_console, "The Simulator Console"),
INIT_PARAM(disk, "Simple Disk"),
- INIT_PARAM_DFLT(size, "AlphaConsole size", sizeof(AlphaAccess)),
INIT_PARAM_DFLT(num_cpus, "Number of CPU's", 1),
INIT_PARAM(mmu, "Memory Controller"),
INIT_PARAM(addr, "Device Address"),
- INIT_PARAM(mask, "Address Mask"),
INIT_PARAM(system, "system object"),
INIT_PARAM(cpu, "Processor"),
INIT_PARAM(clock, "Turbolaser Clock")
@@ -272,10 +271,8 @@ END_INIT_SIM_OBJECT_PARAMS(AlphaConsole)
CREATE_SIM_OBJECT(AlphaConsole)
{
- return new AlphaConsole(getInstanceName(), sim_console,
- disk, size, system,
- cpu, clock, num_cpus,
- addr, mask, mmu);
+ return new AlphaConsole(getInstanceName(), sim_console, disk,
+ system, cpu, clock, num_cpus, mmu, addr);
}
REGISTER_SIM_OBJECT("AlphaConsole", AlphaConsole)
diff --git a/dev/alpha_console.hh b/dev/alpha_console.hh
index 4647be538..29ebec1bb 100644
--- a/dev/alpha_console.hh
+++ b/dev/alpha_console.hh
@@ -33,9 +33,10 @@
#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 "mem/functional_mem/functional_memory.hh"
+#include "sim/host.hh"
#include "dev/tsunami_io.hh"
class BaseCPU;
@@ -69,7 +70,7 @@ class SimpleDisk;
* primarily used doing boot before the kernel has loaded its device
* drivers.
*/
-class AlphaConsole : public MmapDevice
+class AlphaConsole : public FunctionalMemory
{
protected:
union {
@@ -83,6 +84,9 @@ class AlphaConsole : public MmapDevice
/** the system console (the terminal) is accessable from the console */
SimConsole *console;
+ Addr addr;
+ static const Addr size = 0x80; // equal to sizeof(alpha_access);
+
public:
/** Standard Constructor */
AlphaConsole(const std::string &name, SimConsole *cons,
@@ -91,7 +95,6 @@ class AlphaConsole : public MmapDevice
TsunamiIO *clock, int num_cpus,
Addr addr, Addr mask, MemoryController *mmu);
- public:
/**
* memory mapped reads and writes
*/
diff --git a/dev/etherlink.hh b/dev/etherlink.hh
index 895bac2e1..e1a7957ee 100644
--- a/dev/etherlink.hh
+++ b/dev/etherlink.hh
@@ -89,7 +89,7 @@ class EtherLink : public SimObject
Link(const std::string &name, double rate, EtherDump *dump);
~Link() {}
- virtual std::string name() const { return objName; }
+ virtual const std::string name() const { return objName; }
bool busy() const { return (bool)packet; }
bool transmit(PacketPtr &packet);