From 069c07f440ac207a3bbe71f79c2834a9f0b919e5 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Tue, 1 Nov 2011 15:32:49 -0700 Subject: [PATCH] Fixed tight coupling of host and target page size --- riscv/mmu.cc | 2 +- riscv/mmu.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/riscv/mmu.cc b/riscv/mmu.cc index b2c8c98..489aeee 100644 --- a/riscv/mmu.cc +++ b/riscv/mmu.cc @@ -53,7 +53,7 @@ void* mmu_t::refill(reg_t addr, bool store, bool fetch) tlb_insn_tag[idx] = (pte_perm & PTE_UX) ? expected_tag : -1; tlb_data[idx] = (long)(pte >> PTE_PPN_SHIFT << PGSHIFT) + (long)mem; - return (void*)(((long)addr & (PGSIZE-1)) | tlb_data[idx]); + return (void*)(((long)addr & (PGSIZE-1)) + tlb_data[idx]); } pte_t mmu_t::walk(reg_t addr) diff --git a/riscv/mmu.h b/riscv/mmu.h index d9a1ce3..9d648ef 100644 --- a/riscv/mmu.h +++ b/riscv/mmu.h @@ -179,7 +179,7 @@ private: reg_t* tlb_tag = fetch ? tlb_insn_tag : store ? tlb_store_tag :tlb_load_tag; reg_t expected_tag = addr & ~(PGSIZE-1); if(likely(tlb_tag[idx] == expected_tag)) - return (void*)(((long)addr & (PGSIZE-1)) | tlb_data[idx]); + return (void*)(((long)addr & (PGSIZE-1)) + tlb_data[idx]); return refill(addr, store, fetch); } -- 2.30.2