From 10a906be528df1e7495a68f415833a27e8279840 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 27 Jun 2005 17:04:43 -0400 Subject: Update for console code reorganization dev/alpha_access.h: Update the ALPHA_ACCESS_VERSION move typedefs to this file since they're only used here. dev/alpha_console.cc: formatting sim/system.cc: xxm -> m5 --HG-- extra : convert_revision : 3aeca50d1385034f5a1e20dd8b0abd03bd6f26f0 --- sim/system.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sim') diff --git a/sim/system.cc b/sim/system.cc index a51cc03bf..3ac0fdce1 100644 --- a/sim/system.cc +++ b/sim/system.cc @@ -147,7 +147,7 @@ System::System(Params *p) * Set the hardware reset parameter block system type and revision * information to Tsunami. */ - if (consoleSymtab->findAddress("xxm_rpb", addr)) { + if (consoleSymtab->findAddress("m5_rpb", addr)) { Addr paddr = vtophys(physmem, addr); char *hwrpb = (char *)physmem->dma_addr(paddr, sizeof(uint64_t)); -- cgit v1.2.3 From d172447a7ae945139d0c3465b8504cd6b77ae819 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 28 Jun 2005 01:09:13 -0400 Subject: Pass the location of the m5 console backdoor to the console instead of compiling it into the console version dev/alpha_access.h: move serialization stuff to alpha_console.hh define the ALPHA_ACCESS_BASE in m5 instead of in console.c and have m5 pass the value to the console dev/alpha_console.cc: dev/alpha_console.hh: Move serialization stuff into a derived class of AlphaAccess sim/system.cc: pass the value of ALPHA_ACCESS_BASE to the console code via the m5AlphaAccess console variable. --HG-- extra : convert_revision : 0ea4ba239f03d6dad51a6efae0385aa543064117 --- sim/system.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'sim') diff --git a/sim/system.cc b/sim/system.cc index 3ac0fdce1..c1a4c2a87 100644 --- a/sim/system.cc +++ b/sim/system.cc @@ -30,6 +30,7 @@ #include "base/loader/symtab.hh" #include "base/remote_gdb.hh" #include "cpu/exec_context.hh" +#include "dev/alpha_access.h" #include "kern/kernel_stats.hh" #include "mem/functional/memory_control.hh" #include "mem/functional/physical.hh" @@ -143,6 +144,21 @@ System::System(Params *p) strcpy(osflags, params->boot_osflags.c_str()); } + /** + * Set the m5AlphaAccess pointer in the console + */ + if (consoleSymtab->findAddress("m5AlphaAccess", addr)) { + Addr paddr = vtophys(physmem, addr); + uint64_t *m5AlphaAccess = + (uint64_t *)physmem->dma_addr(paddr, sizeof(uint64_t)); + + if (!m5AlphaAccess) + panic("could not translate m5AlphaAccess addr\n"); + + *m5AlphaAccess = htoa(ALPHA_ACCESS_BASE); + } else + panic("could not find m5AlphaAccess\n"); + /** * Set the hardware reset parameter block system type and revision * information to Tsunami. -- cgit v1.2.3 From 036a8ceb8da8aff10b819b4aab32584d41282a64 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 28 Jun 2005 12:42:15 -0400 Subject: Don't hard code the location of m5AlphaAccess. Instead, move the code into a function that can be called by the AlphaConsole class. AlphaConsole will pass in its address. arch/alpha/ev5.hh: Move Phys2K0Seg to ev5.hh and fixup the TSUNAMI uncacheable bits so that they will be converted correctly. dev/alpha_access.h: Do not hard code the location of the AlphaConsole dev/alpha_console.cc: fixup #includes tell the system where the alpha console is sim/system.hh: Provide a function that will tell the system where the AlphaAccess structure (device) lives --HG-- extra : convert_revision : 92d70ca926151a32eebe9925de597459ac58013e --- sim/system.cc | 33 +++++++++++++++++---------------- sim/system.hh | 5 +++++ 2 files changed, 22 insertions(+), 16 deletions(-) (limited to 'sim') diff --git a/sim/system.cc b/sim/system.cc index c1a4c2a87..8397b8e01 100644 --- a/sim/system.cc +++ b/sim/system.cc @@ -30,7 +30,6 @@ #include "base/loader/symtab.hh" #include "base/remote_gdb.hh" #include "cpu/exec_context.hh" -#include "dev/alpha_access.h" #include "kern/kernel_stats.hh" #include "mem/functional/memory_control.hh" #include "mem/functional/physical.hh" @@ -144,21 +143,6 @@ System::System(Params *p) strcpy(osflags, params->boot_osflags.c_str()); } - /** - * Set the m5AlphaAccess pointer in the console - */ - if (consoleSymtab->findAddress("m5AlphaAccess", addr)) { - Addr paddr = vtophys(physmem, addr); - uint64_t *m5AlphaAccess = - (uint64_t *)physmem->dma_addr(paddr, sizeof(uint64_t)); - - if (!m5AlphaAccess) - panic("could not translate m5AlphaAccess addr\n"); - - *m5AlphaAccess = htoa(ALPHA_ACCESS_BASE); - } else - panic("could not find m5AlphaAccess\n"); - /** * Set the hardware reset parameter block system type and revision * information to Tsunami. @@ -196,6 +180,23 @@ System::~System() #endif } +void +System::setAlphaAccess(Addr access) +{ + Addr addr = 0; + if (consoleSymtab->findAddress("m5AlphaAccess", addr)) { + Addr paddr = vtophys(physmem, addr); + uint64_t *m5AlphaAccess = + (uint64_t *)physmem->dma_addr(paddr, sizeof(uint64_t)); + + if (!m5AlphaAccess) + panic("could not translate m5AlphaAccess addr\n"); + + *m5AlphaAccess = htoa(EV5::Phys2K0Seg(access)); + } else + panic("could not find m5AlphaAccess\n"); +} + bool System::breakpoint() { diff --git a/sim/system.hh b/sim/system.hh index c3e4d6d68..ab6d264ea 100644 --- a/sim/system.hh +++ b/sim/system.hh @@ -127,6 +127,11 @@ class System : public SimObject void startup(); public: + /** + * Set the m5AlphaAccess pointer in the console + */ + void setAlphaAccess(Addr access); + /** * Returns the addess the kernel starts at. * @return address the kernel starts at -- cgit v1.2.3