diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-10-16 05:49:43 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-10-16 05:49:43 -0400 |
commit | df973abef3a70074971375cfe52c46f53528c00e (patch) | |
tree | 7c10603edb5c66631288cb0f9fa334df4cf3d8a9 /src/sim/system.hh | |
parent | 37908d62a4b45962a6e6f5993027b6b9bafa296d (diff) | |
download | gem5-df973abef3a70074971375cfe52c46f53528c00e.tar.xz |
mem: Dynamically determine page bytes in memory components
This patch takes a step towards an ISA-agnostic memory
system by enabling the components to establish the page size after
instantiation. The swap operation in the memory is now also allowing
any granularity to avoid depending on the IntReg of the ISA.
Diffstat (limited to 'src/sim/system.hh')
-rw-r--r-- | src/sim/system.hh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/sim/system.hh b/src/sim/system.hh index 5b68373a6..d82978018 100644 --- a/src/sim/system.hh +++ b/src/sim/system.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 ARM Limited + * Copyright (c) 2012, 2014 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -51,9 +51,11 @@ #include <utility> #include <vector> +#include "arch/isa_traits.hh" #include "base/loader/symtab.hh" #include "base/misc.hh" #include "base/statistics.hh" +#include "config/the_isa.hh" #include "cpu/pc_event.hh" #include "enums/MemoryMode.hh" #include "kern/system_events.hh" @@ -269,6 +271,16 @@ class System : public MemObject */ bool isMemAddr(Addr addr) const; + /** + * Get the page bytes for the ISA. + */ + Addr getPageBytes() const { return TheISA::PageBytes; } + + /** + * Get the number of bits worth of in-page adress for the ISA. + */ + Addr getPageShift() const { return TheISA::PageShift; } + protected: PhysicalMemory physmem; |