From 81d5ffe7dea641402a5e1b92448646f515f46677 Mon Sep 17 00:00:00 2001 From: Andrew Schultz Date: Tue, 10 Feb 2004 00:19:43 -0500 Subject: Changed new linux stuff to work with new FunctionalMemory interface and some sundry problems with new interface dev/alpha_console.cc: dev/alpha_console.hh: dev/baddev.cc: dev/baddev.hh: dev/pciconfigall.cc: dev/pciconfigall.hh: dev/pcidev.cc: dev/pcidev.hh: dev/tsunami_cchip.cc: dev/tsunami_cchip.hh: dev/tsunami_io.cc: dev/tsunami_io.hh: dev/tsunami_pchip.cc: dev/tsunami_pchip.hh: dev/tsunami_uart.cc: dev/tsunami_uart.hh: Fixed to use new FunctionalMemory interface --HG-- extra : convert_revision : bee98e6285d92f28fafacf919ab06eaf333a9b56 --- dev/tsunami_io.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'dev/tsunami_io.cc') diff --git a/dev/tsunami_io.cc b/dev/tsunami_io.cc index 25323ee14..dd2ac3acc 100644 --- a/dev/tsunami_io.cc +++ b/dev/tsunami_io.cc @@ -125,9 +125,11 @@ TsunamiIO::ClockEvent::Status() } TsunamiIO::TsunamiIO(const string &name, Tsunami *t, time_t init_time, - Addr addr, Addr mask, MemoryController *mmu) - : MmapDevice(name, addr, mask, mmu), tsunami(t), rtc(t) + Addr a, MemoryController *mmu) + : FunctionalMemory(name), addr(a), tsunami(t), rtc(t) { + mmu->add_child(this, Range(addr, addr + size)); + // set the back pointer from tsunami to myself tsunami->io = this; @@ -151,7 +153,7 @@ TsunamiIO::read(MemReqPtr &req, uint8_t *data) DPRINTF(Tsunami, "io read va=%#x size=%d IOPorrt=%#x\n", req->vaddr, req->size, req->vaddr & 0xfff); - Addr daddr = (req->paddr & addr_mask); + Addr daddr = (req->paddr & size); // ExecContext *xc = req->xc; // int cpuid = xc->cpu_id; @@ -226,7 +228,7 @@ TsunamiIO::write(MemReqPtr &req, const uint8_t *data) DPRINTF(Tsunami, "io write - va=%#x size=%d IOPort=%#x Data=%#x\n", req->vaddr, req->size, req->vaddr & 0xfff, dt64); - Addr daddr = (req->paddr & addr_mask); + Addr daddr = (req->paddr & size); switch(req->size) { case sizeof(uint8_t): @@ -359,7 +361,6 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(TsunamiIO) Param time; SimObjectParam mmu; Param addr; - Param mask; END_DECLARE_SIM_OBJECT_PARAMS(TsunamiIO) @@ -369,15 +370,13 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(TsunamiIO) INIT_PARAM_DFLT(time, "System time to use " "(0 for actual time, default is 1/1/06", ULL(1136073600)), INIT_PARAM(mmu, "Memory Controller"), - INIT_PARAM(addr, "Device Address"), - INIT_PARAM(mask, "Address Mask") + INIT_PARAM(addr, "Device Address") END_INIT_SIM_OBJECT_PARAMS(TsunamiIO) CREATE_SIM_OBJECT(TsunamiIO) { - return new TsunamiIO(getInstanceName(), tsunami, time, addr, - mask, mmu); + return new TsunamiIO(getInstanceName(), tsunami, time, addr, mmu); } REGISTER_SIM_OBJECT("TsunamiIO", TsunamiIO) -- cgit v1.2.3