summaryrefslogtreecommitdiff
path: root/src/mem/ruby/common/Address.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/common/Address.cc')
-rw-r--r--src/mem/ruby/common/Address.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mem/ruby/common/Address.cc b/src/mem/ruby/common/Address.cc
index d3f678863..b075ef3c5 100644
--- a/src/mem/ruby/common/Address.cc
+++ b/src/mem/ruby/common/Address.cc
@@ -26,6 +26,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "arch/isa_traits.hh"
+#include "config/the_isa.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/system/System.hh"
@@ -134,3 +136,24 @@ Address::operator=(const Address& obj)
return *this;
}
+void
+Address::makePageAddress()
+{
+ m_address = maskLowOrderBits(TheISA::LogVMPageSize);
+}
+
+Address
+page_address(const Address& addr)
+{
+ Address temp = addr;
+ temp.makePageAddress();
+ return temp;
+}
+
+Address
+next_stride_address(const Address& addr, int stride)
+{
+ Address temp = addr;
+ temp.makeNextStrideAddress(stride);
+ return temp;
+}